mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-04 03:44:59 +00:00
84579fc24f
When parsing bitcode, convert LTO Symbols to LLD Symbols in order to perform resolution. The "winning" symbol will then be marked as Prevailing at LTO compilation time. This is similar to what the other LLD ports do. This change allows us to handle `linkonce` symbols correctly, and to deal with duplicate bitcode symbols gracefully. Previously, both scenarios would result in an assertion failure inside the LTO code, complaining that multiple Prevailing definitions are not allowed. While at it, I also added basic logic around visibility. We don't do anything useful with it yet, but we do check that its value is valid. LLD-ELF appears to use it only to set FinalDefinitionInLinkageUnit for LTO, which I think is just a performance optimization. From my local experimentation, the linker itself doesn't seem to do anything differently when encountering linkonce / linkonce_odr / weak / weak_odr. So I've only written a test for one of them. LLD-ELF has more, but they seem to mostly be testing the intermediate bitcode output of their LTO backend...? I'm far from an expert here though, so I might very well be missing things. Reviewed By: #lld-macho, MaskRay, smeenai Differential Revision: https://reviews.llvm.org/D94342 |
||
---|---|---|
.. | ||
Arch | ||
CMakeLists.txt | ||
Config.h | ||
Driver.cpp | ||
Driver.h | ||
DriverUtils.cpp | ||
Dwarf.cpp | ||
Dwarf.h | ||
ExportTrie.cpp | ||
ExportTrie.h | ||
InputFiles.cpp | ||
InputFiles.h | ||
InputSection.cpp | ||
InputSection.h | ||
LTO.cpp | ||
LTO.h | ||
MachOStructs.h | ||
MergedOutputSection.cpp | ||
MergedOutputSection.h | ||
ObjC.cpp | ||
ObjC.h | ||
Options.td | ||
OutputSection.cpp | ||
OutputSection.h | ||
OutputSegment.cpp | ||
OutputSegment.h | ||
Symbols.cpp | ||
Symbols.h | ||
SymbolTable.cpp | ||
SymbolTable.h | ||
SyntheticSections.cpp | ||
SyntheticSections.h | ||
Target.cpp | ||
Target.h | ||
UnwindInfoSection.cpp | ||
UnwindInfoSection.h | ||
Writer.cpp | ||
Writer.h |