diff options
author | Fangrui Song <maskray@google.com> | 2020-06-09 11:25:55 -0700 |
---|---|---|
committer | Fangrui Song <maskray@google.com> | 2020-06-09 11:27:34 -0700 |
commit | ba890da2878299dc82b104c06f067e45162d880f (patch) | |
tree | 4f8b2c579c3c411608e3113d29b149669317df84 /llvm/utils/FileCheck/FileCheck.cpp | |
parent | 2fea3fe41c5a177d019dd99fb1b43d767eccde24 (diff) | |
download | llvm-ba890da2878299dc82b104c06f067e45162d880f.zip llvm-ba890da2878299dc82b104c06f067e45162d880f.tar.gz llvm-ba890da2878299dc82b104c06f067e45162d880f.tar.bz2 |
[ELF] Demote lazy symbols relative to a discarded section to Undefined
Fixes PR45594.
In `ObjFile<ELFT>::initializeSymbols()`, for a defined symbol relative to
a discarded section (due to section group rules), it may have been
inserted as a lazy symbol. We need to demote it to an Undefined to
enable the `discarded section` error happened in a later pass.
Add `LazyObjFile::fetched` (if true) and `ArchiveFile::parsed` (if
false) to represent that there is an ongoing lazy symbol fetch and we
should replace the current lazy symbol with an Undefined, instead of
calling `Symbol::resolve` (`Symbol::resolve` should be called if the lazy
symbol was added by an unrelated archive/lazy object).
As a side result, one small issue in start-lib-comdat.s is now fixed.
The hack motivating D51892 will be unsupported: if
`.gnu.linkonce.t.__i686.get_pc_thunk.bx` in an archive is referenced
by another section, this will likely be errored unless the function is
also defined in a regular object file.
(Bringing back rL330869 would error `undefined symbol` instead of the
more relevant `discarded section`.)
Note, glibc i386's crti.o still works (PR31215), because
`.gnu.linkonce.t.__x86.get_pc_thunk.bx` is in crti.o (one of the first
regular object files in a linker command line).
Reviewed By: psmith
Differential Revision: https://reviews.llvm.org/D79300
Diffstat (limited to 'llvm/utils/FileCheck/FileCheck.cpp')
0 files changed, 0 insertions, 0 deletions