FailedChanges

Summary

  1. ELF: Set symbol binding to STB_GLOBAL when undefining symbols during LTO. If there is a bug in the LTO implementation that causes it to fail to provide an expected symbol definition, the linker should report an undefined symbol error. Unfortunately, we were failing to do so if the symbol definition was weak, as the undefine() function was turning the definition into a weak undefined symbol, which resolves to zero if the symbol remains undefined. This patch causes us to set the binding to STB_GLOBAL when we undefine a symbol. I can't see a good way to test this. The behaviour should only be observable if there is a bug in the LTO implementation. Differential Revision: https://reviews.llvm.org/D32731
Revision 301897 by pcc:
ELF: Set symbol binding to STB_GLOBAL when undefining symbols during LTO.

If there is a bug in the LTO implementation that causes it to fail to provide
an expected symbol definition, the linker should report an undefined symbol
error. Unfortunately, we were failing to do so if the symbol definition
was weak, as the undefine() function was turning the definition into a weak
undefined symbol, which resolves to zero if the symbol remains undefined. This
patch causes us to set the binding to STB_GLOBAL when we undefine a symbol.

I can't see a good way to test this. The behaviour should only be observable
if there is a bug in the LTO implementation.

Differential Revision: https://reviews.llvm.org/D32731
Change TypePath in RepositoryPath in Workspace
The file was modified/lld/trunk/ELF/LTO.cpp (diff)llvm-revision.src/lld/trunk/ELF/LTO.cpp