From 1c697e99b6628612be86e00b5411c9c39afd798d Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Wed, 3 May 2017 19:23:30 +0000 Subject: [PATCH] Revert r301897, "ELF: Set symbol binding to STB_GLOBAL when undefining symbols during LTO." It doesn't matter what binding we store in a non-UsedInRegularObj undefined symbol because we should reset it when we see a real undefined symbol in a combined LTO object. The fact that we weren't doing so before is a bug (PR32899) which is now fixed. llvm-svn: 302067 --- lld/ELF/LTO.cpp | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lld/ELF/LTO.cpp b/lld/ELF/LTO.cpp index de0d45b..dd43517 100644 --- a/lld/ELF/LTO.cpp +++ b/lld/ELF/LTO.cpp @@ -105,11 +105,6 @@ BitcodeCompiler::~BitcodeCompiler() = default; static void undefine(Symbol *S) { replaceBody(S, S->body()->getName(), /*IsLocal=*/false, STV_DEFAULT, S->body()->Type, nullptr); - // It shouldn't normally matter what the binding is, but if a bug in the LTO - // implementation causes it to fail to provide a definition for a symbol, - // setting the binding to STB_GLOBAL will cause the linker to report an - // undefined symbol error, even if the definition was weak. - S->Binding = STB_GLOBAL; } void BitcodeCompiler::add(BitcodeFile &F) { -- 2.7.4