From c012db35d754a459dbe1738c596c09016a408c2c Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 7 Apr 2016 14:34:15 +0000 Subject: [PATCH] Delete Off_Bss. It is now just a special case of Off_Sec. llvm-svn: 265676 --- lld/ELF/OutputSections.cpp | 2 -- lld/ELF/OutputSections.h | 1 - lld/ELF/Writer.cpp | 4 ++-- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp index feaff82..243f571 100644 --- a/lld/ELF/OutputSections.cpp +++ b/lld/ELF/OutputSections.cpp @@ -308,8 +308,6 @@ typename ELFT::uint DynamicReloc::getOffset() const { return Out::Got->getTlsIndexVA(); case Off_Sec: return OffsetInSec + OffsetSec->getVA(); - case Off_Bss: - return cast>(Sym)->OffsetInBss + Out::Bss->getVA(); case Off_Got: return Sym->getGotVA(); case Off_GotPlt: diff --git a/lld/ELF/OutputSections.h b/lld/ELF/OutputSections.h index 95b6790..7abdd5b 100644 --- a/lld/ELF/OutputSections.h +++ b/lld/ELF/OutputSections.h @@ -176,7 +176,6 @@ template struct DynamicReloc { enum OffsetKind { Off_Got, // The got entry of Sym. Off_GotPlt, // The got.plt entry of Sym. - Off_Bss, // The bss entry of Sym (copy reloc). Off_Sec, // The final position of the given input section and offset. Off_LTlsIndex, // The local tls index. Off_GTlsIndex, // The global tls index of Sym. diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index 7d12a32..626e39a 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -738,8 +738,6 @@ void Writer::addCopyRelSymbol(SharedSymbol *SS) { Off = alignTo(Off, Align); Out::Bss->setSize(Off + SS->template getSize()); Out::Bss->updateAlign(Align); - Out::RelaDyn->addReloc( - {Target->CopyRel, DynamicReloc::Off_Bss, SS}); uintX_t Shndx = SS->Sym.st_shndx; uintX_t Value = SS->Sym.st_value; // Look through the DSO's dynamic symbol for aliases and create a dynamic @@ -753,6 +751,8 @@ void Writer::addCopyRelSymbol(SharedSymbol *SS) { S.setUsedInRegularObj(); S.MustBeInDynSym = true; } + Out::RelaDyn->addReloc( + {Target->CopyRel, Out::Bss, SS->OffsetInBss, false, SS, 0}); } template -- 2.7.4