Symbols re-defined with -wrap and -defsym need to be excluded from inter-
procedural optimizations to prevent dropping symbols and allow the linker
to process re-directs.
PR33145: --wrap doesn't work with lto.
Differential Revision: https://reviews.llvm.org/D33621
llvm-svn: 304719
diff --git a/lld/ELF/LTO.cpp b/lld/ELF/LTO.cpp
index 6915d97..5305b32 100644
--- a/lld/ELF/LTO.cpp
+++ b/lld/ELF/LTO.cpp
@@ -136,6 +136,7 @@
Sym->IsUsedInRegularObj || (R.Prevailing && Sym->includeInDynsym());
if (R.Prevailing)
undefine(Sym);
+ R.LinkerRedefined = Config->RenamedSymbols.count(Sym);
}
checkError(LTOObj->add(std::move(F.Obj), Resols));
}