summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2018-01-05 21:41:17 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2018-01-05 21:41:17 +0000
commit8d13b213d4d6d88ed06bc1a0d7132d27d7ed9e80 (patch)
treec740c560f305ef43cab1eadec22aa3046c75520e
parent01ccebf031b2bf6dbe61964c8f2fb9727421ce19 (diff)
downloadbcm5719-llvm-8d13b213d4d6d88ed06bc1a0d7132d27d7ed9e80.tar.gz
bcm5719-llvm-8d13b213d4d6d88ed06bc1a0d7132d27d7ed9e80.zip
Simplify handling of size relocations.
This is possible now that getSize is not a template. llvm-svn: 321900
-rw-r--r--lld/ELF/InputSection.cpp2
-rw-r--r--lld/ELF/Relocations.cpp4
2 files changed, 1 insertions, 5 deletions
diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp
index 93baefadce6..260dddf7441 100644
--- a/lld/ELF/InputSection.cpp
+++ b/lld/ELF/InputSection.cpp
@@ -625,7 +625,7 @@ static uint64_t getRelocTargetVA(RelType Type, int64_t A, uint64_t P,
case R_NEG_TLS:
return Out::TlsPhdr->p_memsz - Sym.getVA(A);
case R_SIZE:
- return A; // Sym.getSize was already folded into the addend.
+ return Sym.getSize() + A;
case R_TLSDESC:
return InX::Got->getGlobalDynAddr(Sym) + A;
case R_TLSDESC_PAGE:
diff --git a/lld/ELF/Relocations.cpp b/lld/ELF/Relocations.cpp
index af4cb24f911..b91abfb5d9a 100644
--- a/lld/ELF/Relocations.cpp
+++ b/lld/ELF/Relocations.cpp
@@ -997,10 +997,6 @@ static void scanRelocs(InputSectionBase &Sec, ArrayRef<RelTy> Rels) {
continue;
}
- // The size is not going to change, so we fold it in here.
- if (Expr == R_SIZE)
- Addend += Sym.getSize();
-
// If the produced value is a constant, we just remember to write it
// when outputting this section. We also have to do it if the format
// uses Elf_Rel, since in that case the written value is the addend.
OpenPOWER on IntegriCloud