forked from OSchip/llvm-project
1af25a9860
We were previously not correctly wrapping symbols that were only produced during LTO codegen and unreferenced before then, or symbols only referenced from such symbols. The root cause was that we weren't marking the wrapped symbol as used if we only saw the use after LTO codegen, leading to the failed wrapping. Fix this by explicitly tracking whether a symbol will become referenced after wrapping is done. We can use this property to tell LTO to preserve such symbols, instead of overload isUsedInRegularObj for this purpose. Since we're no longer setting isUsedInRegularObj for all symbols which will be wrapped, its value at the time of performing the wrapping in the symbol table will accurately reflect whether the symbol was actually used in an object (including in an LTO-generated object), and we can propagate that value to the wrapped symbol and thereby ensure we wrap correctly. This incorrect wrapping was the only scenario I was aware of where we produced an invalid PLT relocation, which D123985 started diagnosing, and with it fixed, we lose the test for that diagnosis. I think it's worth keeping the diagnosis though, in case we run into other issues in the future which would be caught by it. Fixes PR50675. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D124056 |
||
---|---|---|
.. | ||
Arch | ||
AArch64ErrataFix.cpp | ||
AArch64ErrataFix.h | ||
ARMErrataFix.cpp | ||
ARMErrataFix.h | ||
CMakeLists.txt | ||
CallGraphSort.cpp | ||
CallGraphSort.h | ||
Config.h | ||
DWARF.cpp | ||
DWARF.h | ||
Driver.cpp | ||
Driver.h | ||
DriverUtils.cpp | ||
EhFrame.cpp | ||
EhFrame.h | ||
ICF.cpp | ||
ICF.h | ||
InputFiles.cpp | ||
InputFiles.h | ||
InputSection.cpp | ||
InputSection.h | ||
LTO.cpp | ||
LTO.h | ||
LinkerScript.cpp | ||
LinkerScript.h | ||
MapFile.cpp | ||
MapFile.h | ||
MarkLive.cpp | ||
MarkLive.h | ||
Options.td | ||
OutputSections.cpp | ||
OutputSections.h | ||
README.md | ||
Relocations.cpp | ||
Relocations.h | ||
ScriptLexer.cpp | ||
ScriptLexer.h | ||
ScriptParser.cpp | ||
ScriptParser.h | ||
SymbolTable.cpp | ||
SymbolTable.h | ||
Symbols.cpp | ||
Symbols.h | ||
SyntheticSections.cpp | ||
SyntheticSections.h | ||
Target.cpp | ||
Target.h | ||
Thunks.cpp | ||
Thunks.h | ||
Writer.cpp | ||
Writer.h |
README.md
See docs/NewLLD.rst