[all-commits] [llvm/llvm-project] 1af25a: [ELF] Fix wrapping symbols produced during LTO cod...
Shoaib Meenai via All-commits
all-commits at lists.llvm.org
Fri Apr 22 16:46:16 PDT 2022
Author: Shoaib Meenai <smeenai at fb.com>
Date: 2022-04-22 (Fri, 22 Apr 2022)
[ELF] Fix wrapping symbols produced during LTO codegen
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
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.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D124056
More information about the All-commits