summaryrefslogtreecommitdiffstats
path: root/lld/ELF/InputFiles.cpp
diff options
context:
space:
mode:
authorSean Fertile <sfertile@ca.ibm.com>2019-06-06 20:16:53 +0000
committerSean Fertile <sfertile@ca.ibm.com>2019-06-06 20:16:53 +0000
commit6ba76dd77952af32d08fa547e8b3984c7816bbd1 (patch)
treee50976feffe2671ff46ef4114eaf858b1f9a2a5a /lld/ELF/InputFiles.cpp
parent38c5ee180280816ed9e8ff36afa4520b682d0679 (diff)
downloadbcm5719-llvm-6ba76dd77952af32d08fa547e8b3984c7816bbd1.tar.gz
bcm5719-llvm-6ba76dd77952af32d08fa547e8b3984c7816bbd1.zip
Revert "Revert "Reland D61583 [ELF] Error on relocations to STT_SECTION symbols if the sections were discarded""
This reverts commit 729111cf1824159bb4dd331cab8a829eab30313f. Reverting the previous commit breaks other LLD buildbots. llvm-svn: 362743
Diffstat (limited to 'lld/ELF/InputFiles.cpp')
-rw-r--r--lld/ELF/InputFiles.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp
index 815a4ad4c2a..dd384788e34 100644
--- a/lld/ELF/InputFiles.cpp
+++ b/lld/ELF/InputFiles.cpp
@@ -1075,6 +1075,9 @@ template <class ELFT> void ObjFile<ELFT>::initializeSymbols() {
if (ESym.st_shndx == SHN_UNDEF)
this->Symbols[I] = make<Undefined>(this, Name, Binding, StOther, Type);
+ else if (Sec == &InputSection::Discarded)
+ this->Symbols[I] = make<Undefined>(this, Name, Binding, StOther, Type,
+ /*DiscardedSecIdx=*/SecIdx);
else
this->Symbols[I] =
make<Defined>(this, Name, Binding, StOther, Type, Value, Size, Sec);
OpenPOWER on IntegriCloud