From 11751538678a971a5d261eb0b3af3eafc2361942 Mon Sep 17 00:00:00 2001 From: Shankar Easwaran Date: Sun, 19 Oct 2014 03:28:13 +0000 Subject: [PATCH] [ELF][Cleanup] Remove unused code. The old code was used as a workaround to fix how relocations are calculated for sections with SHF_MERGE|SHF_STRINGS attribute. This patch removes the erroneous code. llvm-svn: 220159 --- lld/lib/ReaderWriter/ELF/ELFFile.h | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/lld/lib/ReaderWriter/ELF/ELFFile.h b/lld/lib/ReaderWriter/ELF/ELFFile.h index 1b479ca..a240bcf 100644 --- a/lld/lib/ReaderWriter/ELF/ELFFile.h +++ b/lld/lib/ReaderWriter/ELF/ELFFile.h @@ -201,9 +201,6 @@ protected: StringRef sectionName, ArrayRef contents); - /// Return the default reloc addend for references. - virtual int64_t defaultRelocAddend(const Reference &) const; - /// Returns the symbol's content size. The nextSymbol should be null if the /// symbol is the last one in the section. virtual uint64_t symbolContentSize(const Elf_Shdr *section, @@ -796,11 +793,6 @@ void ELFFile::createRelocationReferences(const Elf_Sym &symbol, } } -template -int64_t ELFFile::defaultRelocAddend(const Reference &) const { - return 0; -} - template void ELFFile::updateReferences() { for (auto &ri : _references) { if (ri->kindNamespace() == lld::Reference::KindNamespace::ELF) { @@ -817,7 +809,7 @@ template void ELFFile::updateReferences() { // If the target atom is mergeable string atom, the atom might have been // merged with other atom having the same contents. Try to find the // merged one if that's the case. - uint64_t addend = ri->addend() + defaultRelocAddend(*ri); + uint64_t addend = ri->addend(); const MergeSectionKey ms(shdr, addend); auto msec = _mergedSectionMap.find(ms); if (msec != _mergedSectionMap.end()) { -- 2.7.4