Simplify handling of size relocations.

This is possible now that getSize is not a template.

llvm-svn: 321900
This commit is contained in:
Rafael Espindola 2018-01-05 21:41:17 +00:00
parent 01ccebf031
commit 8d13b213d4
2 changed files with 1 additions and 5 deletions

View File

@ -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:

View File

@ -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.