From c53addf38e24e4dafe992aafb3ae928bfa8fdb0a Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Mon, 22 May 2017 19:44:12 +0000 Subject: Vendor import of lld trunk r303571: https://llvm.org/svn/llvm-project/lld/trunk@303571 --- ELF/Relocations.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ELF/Relocations.cpp') diff --git a/ELF/Relocations.cpp b/ELF/Relocations.cpp index c505a14f3c649..5564ea246eeb9 100644 --- a/ELF/Relocations.cpp +++ b/ELF/Relocations.cpp @@ -935,6 +935,10 @@ static void scanRelocs(InputSectionBase &Sec, ArrayRef Rels) { bool IsConstant = isStaticLinkTimeConstant(Expr, Type, Body, Sec, Rel.r_offset); + // The size is not going to change, so we fold it in here. + if (Expr == R_SIZE) + Addend += Body.getSize(); + // If the output being produced is position independent, the final value // is still not known. In that case we still need some help from the // dynamic linker. We can however do better than just copying the incoming -- cgit v1.2.3