diff options
Diffstat (limited to 'lld/ELF/SyntheticSections.cpp')
| -rw-r--r-- | lld/ELF/SyntheticSections.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lld/ELF/SyntheticSections.cpp b/lld/ELF/SyntheticSections.cpp index bc398fed17c..e32b8c29fc1 100644 --- a/lld/ELF/SyntheticSections.cpp +++ b/lld/ELF/SyntheticSections.cpp @@ -1493,9 +1493,12 @@ void RelocationBaseSection::addReloc(const DynamicReloc &Reloc) { void RelocationBaseSection::finalizeContents() { // If all relocations are R_*_RELATIVE they don't refer to any // dynamic symbol and we don't need a dynamic symbol table. If that - // is the case, just use 0 as the link. - getParent()->Link = - In.DynSymTab ? In.DynSymTab->getParent()->SectionIndex : 0; + // is the case, just use the index of the regular symbol table section. + getParent()->Link = In.DynSymTab ? In.DynSymTab->getParent()->SectionIndex + : In.SymTab->getParent()->SectionIndex; + + if (In.RelaIplt == this || In.RelaPlt == this) + getParent()->Info = In.GotPlt->getParent()->SectionIndex; } RelrBaseSection::RelrBaseSection() |

