Skip to content

Commit c60c8ec

Browse files
Include linker generated symbol in default defined set
It seems like `_GLOBAL_OFFSET_TABLE_` is defined by the linker without being present in any object file on x86_64. There are a few other symbols that the linker automatically defines although we haven't run into issues with them. I am including the full list I gathered from lld's source code [1] by default. [1] https://github.com/llvm/llvm-project/blob/177e38286cd61a7b5a968636e1f147f128dd25a2/lld/ELF/Config.h#L632
1 parent 2096cff commit c60c8ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/BinarySymbols/ReferencedSymbols.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ package struct ReferencedSymbols {
1313
package private(set) var undefined: Set<String>
1414

1515
package init() {
16-
self.defined = []
16+
self.defined = ["_GLOBAL_OFFSET_TABLE_"]
1717
self.undefined = []
1818
}
1919

0 commit comments

Comments
 (0)