summaryrefslogtreecommitdiffstats
path: root/lld/ELF/LTO.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/ELF/LTO.cpp')
-rw-r--r--lld/ELF/LTO.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/lld/ELF/LTO.cpp b/lld/ELF/LTO.cpp
index f24327a139a..228dc95d78f 100644
--- a/lld/ELF/LTO.cpp
+++ b/lld/ELF/LTO.cpp
@@ -202,8 +202,6 @@ void BitcodeCompiler::add(BitcodeFile &F) {
continue;
}
SymbolBody *B = S->body();
- if (B->kind() != SymbolBody::DefinedRegularKind)
- continue;
if (B->File != &F)
continue;
@@ -221,7 +219,12 @@ void BitcodeCompiler::add(BitcodeFile &F) {
// needs to be able to replace the original definition without conflicting.
// In the latter case, we need to allow the combined LTO object to provide a
// definition with the same name, for example when doing parallel codegen.
- undefine(S);
+ if (auto *C = dyn_cast<DefinedCommon>(B)) {
+ if (auto *GO = dyn_cast<GlobalObject>(GV))
+ GO->setAlignment(C->Alignment);
+ } else {
+ undefine(S);
+ }
if (!GV)
// Module asm symbol.
OpenPOWER on IntegriCloud