summaryrefslogtreecommitdiff
path: root/ELF/LTO.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-05-02 18:31:09 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-05-02 18:31:09 +0000
commit274c9ff5404582ff22769d9599ab10ed216ceec3 (patch)
tree8eccb2d5ca32dbec2ab6a1a3b8ac6a593f0e1b6f /ELF/LTO.cpp
parente06a19b85dfce9ea18be97247d4ca315963edc5c (diff)
Notes
Diffstat (limited to 'ELF/LTO.cpp')
-rw-r--r--ELF/LTO.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/ELF/LTO.cpp b/ELF/LTO.cpp
index dd435173101a..de0d45bea1c4 100644
--- a/ELF/LTO.cpp
+++ b/ELF/LTO.cpp
@@ -105,6 +105,11 @@ BitcodeCompiler::~BitcodeCompiler() = default;
static void undefine(Symbol *S) {
replaceBody<Undefined>(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) {