-
Couldn't load subscription status.
- Fork 10.6k
Restore -static-executable on Linux. #29039
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,7 +22,10 @@ | |
|
|
||
| #include "ImageInspection.h" | ||
| #include "ImageInspectionELF.h" | ||
|
|
||
| #ifndef ELF_STATIC_LIB | ||
| #include <dlfcn.h> | ||
| #endif | ||
|
|
||
| using namespace swift; | ||
|
|
||
|
|
@@ -56,6 +59,7 @@ void swift::initializeProtocolLookup() { | |
| sections = sections->next; | ||
| } | ||
| } | ||
|
|
||
| void swift::initializeProtocolConformanceLookup() { | ||
| const swift::MetadataSections *sections = registered; | ||
| while (true) { | ||
|
|
@@ -89,10 +93,8 @@ void swift::initializeTypeMetadataRecordLookup() { | |
| void swift::initializeDynamicReplacementLookup() { | ||
| } | ||
|
|
||
| // As ELF images are loaded, ImageInspectionInit:sectionDataInit() will call | ||
| // addNewDSOImage() with an address in the image that can later be used via | ||
| // dladdr() to dlopen() the image after the appropriate initialize*Lookup() | ||
| // function has been called. | ||
| // As ELF images are loaded, SwiftRT-ELF:swift_image_constructor() will call | ||
| // addNewDSOImage() with a pointer to the MetadataSections in the image. | ||
| SWIFT_RUNTIME_EXPORT | ||
| void swift_addNewDSOImage(const void *addr) { | ||
| const swift::MetadataSections *sections = | ||
|
|
@@ -131,6 +133,12 @@ void swift_addNewDSOImage(const void *addr) { | |
| } | ||
| } | ||
|
|
||
| #ifndef ELF_STATIC_LIB | ||
|
|
||
| // For shared executables only, static executables use the version defined in | ||
| // StaticBinaryELF.cpp. | ||
| // libswiftImageInspectionShared.a contains the below function and | ||
| // libswiftImageInspectionStatic.a contains the version in StaticBinaryELF.cpp | ||
| int swift::lookupSymbol(const void *address, SymbolInfo *info) { | ||
| Dl_info dlinfo; | ||
| if (dladdr(address, &dlinfo) == 0) { | ||
|
|
@@ -144,6 +152,8 @@ int swift::lookupSymbol(const void *address, SymbolInfo *info) { | |
| return 1; | ||
| } | ||
|
|
||
| #endif | ||
|
||
|
|
||
| // This is only used for backward deployment hooks, which we currently only support for | ||
| // MachO. Add a stub here to make sure it still compiles. | ||
| void *swift::lookupSection(const char *segment, const char *section, size_t *outSize) { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.