summaryrefslogtreecommitdiffstats
path: root/lld/ELF/InputFiles.cpp
diff options
context:
space:
mode:
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