diff options
Diffstat (limited to 'lld/ELF/InputFiles.cpp')
| -rw-r--r-- | lld/ELF/InputFiles.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp index 2b89533191a..16991421fe6 100644 --- a/lld/ELF/InputFiles.cpp +++ b/lld/ELF/InputFiles.cpp @@ -997,6 +997,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); |

