summaryrefslogtreecommitdiffstats
path: root/lld/ELF/OutputSections.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lld/ELF/OutputSections.cpp')
-rw-r--r--lld/ELF/OutputSections.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp
index cfd6133cfee..0a6c33c1d02 100644
--- a/lld/ELF/OutputSections.cpp
+++ b/lld/ELF/OutputSections.cpp
@@ -707,7 +707,7 @@ lld::elf2::getLocalRelTarget(const ObjectFile<ELFT> &File,
// and must be treated specially. For now we just replace the symbol with
// 0.
InputSectionBase<ELFT> *Section = File.getSection(*Sym);
- if (Section == &InputSection<ELFT>::Discarded)
+ if (Section == &InputSection<ELFT>::Discarded || !Section->isLive())
return Addend;
uintX_t VA = Section->OutSec->getVA();
OpenPOWER on IntegriCloud