[lld] r220159 - [ELF][Cleanup] Remove unused code.
Shankar Easwaran
shankarke at gmail.com
Sat Oct 18 20:28:13 PDT 2014
Author: shankare
Date: Sat Oct 18 22:28:13 2014
New Revision: 220159
URL: http://llvm.org/viewvc/llvm-project?rev=220159&view=rev
Log:
[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.
Modified:
lld/trunk/lib/ReaderWriter/ELF/ELFFile.h
Modified: lld/trunk/lib/ReaderWriter/ELF/ELFFile.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/ELFFile.h?rev=220159&r1=220158&r2=220159&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/ELF/ELFFile.h (original)
+++ lld/trunk/lib/ReaderWriter/ELF/ELFFile.h Sat Oct 18 22:28:13 2014
@@ -201,9 +201,6 @@ protected:
StringRef sectionName,
ArrayRef<uint8_t> 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<ELFT>::createRelocationRefe
}
}
-template <class ELFT>
-int64_t ELFFile<ELFT>::defaultRelocAddend(const Reference &) const {
- return 0;
-}
-
template <class ELFT> void ELFFile<ELFT>::updateReferences() {
for (auto &ri : _references) {
if (ri->kindNamespace() == lld::Reference::KindNamespace::ELF) {
@@ -817,7 +809,7 @@ template <class ELFT> void ELFFile<ELFT>
// 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()) {
More information about the llvm-commits
mailing list