[lld] r266810 - Fix pr27420.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 19 13:25:23 PDT 2016


On Tue, Apr 19, 2016 at 1:18 PM, Rafael Espindola via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: rafael
> Date: Tue Apr 19 15:18:52 2016
> New Revision: 266810
>
> URL: http://llvm.org/viewvc/llvm-project?rev=266810&view=rev
> Log:
> Fix pr27420.
>
> Return the right expression for R_X86_64_GOTPCRELX and
> R_X86_64_REX_GOTPCRELX.
>
> Added:
>     lld/trunk/test/ELF/Inputs/gotpcrelx.o
>     lld/trunk/test/ELF/gotpcrelx.s
> Modified:
>     lld/trunk/ELF/Target.cpp
>
> Modified: lld/trunk/ELF/Target.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Target.cpp?rev=266810&r1=266809&r2=266810&view=diff
>
> ==============================================================================
> --- lld/trunk/ELF/Target.cpp (original)
> +++ lld/trunk/ELF/Target.cpp Tue Apr 19 15:18:52 2016
> @@ -651,6 +651,8 @@ RelExpr X86_64TargetInfo::getRelExpr(uin
>    case R_X86_64_GOT32:
>      return R_GOT_FROM_END;
>    case R_X86_64_GOTPCREL:
> +  case R_X86_64_GOTPCRELX:
> +  case R_X86_64_REX_GOTPCRELX:
>    case R_X86_64_GOTTPOFF:
>      return R_GOT_PC;
>    }
>
> Added: lld/trunk/test/ELF/Inputs/gotpcrelx.o
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/Inputs/gotpcrelx.o?rev=266810&view=auto
>
> ==============================================================================
> Binary files lld/trunk/test/ELF/Inputs/gotpcrelx.o (added) and
> lld/trunk/test/ELF/Inputs/gotpcrelx.o Tue Apr 19 15:18:52 2016 differ
>

How did you create this binary file?


> Added: lld/trunk/test/ELF/gotpcrelx.s
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/gotpcrelx.s?rev=266810&view=auto
>
> ==============================================================================
> --- lld/trunk/test/ELF/gotpcrelx.s (added)
> +++ lld/trunk/test/ELF/gotpcrelx.s Tue Apr 19 15:18:52 2016
> @@ -0,0 +1,17 @@
> +// RUN: ld.lld %p/Inputs/gotpcrelx.o -o %t.so -shared
> +// RUN: llvm-readobj -s -r %t.so | FileCheck %s
> +
> +// CHECK:      Name: .got
> +// CHECK-NEXT: Type: SHT_PROGBITS
> +// CHECK-NEXT: Flags [
> +// CHECK-NEXT:   SHF_ALLOC
> +// CHECK-NEXT:   SHF_WRITE
> +// CHECK-NEXT: ]
> +// CHECK-NEXT: Address: 0x2090
> +
> +// CHECK:      Relocations [
> +// CHECK-NEXT:   Section ({{.*}}) .rela.dyn {
> +// CHECK-NEXT:     0x2090 R_X86_64_GLOB_DAT foo 0x0
> +// CHECK-NEXT:     0x2098 R_X86_64_GLOB_DAT bar 0x0
> +// CHECK-NEXT:   }
> +// CHECK-NEXT: ]
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160419/f9368f0c/attachment.html>


More information about the llvm-commits mailing list