[lld] r288477 - Add a test documenting how we handle addends on Elf_Rela.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 1 20:20:47 PST 2016
Author: rafael
Date: Thu Dec 1 22:20:47 2016
New Revision: 288477
URL: http://llvm.org/viewvc/llvm-project?rev=288477&view=rev
Log:
Add a test documenting how we handle addends on Elf_Rela.
Added:
lld/trunk/test/ELF/dynamic-got-rela.s
Added: lld/trunk/test/ELF/dynamic-got-rela.s
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/ELF/dynamic-got-rela.s?rev=288477&view=auto
==============================================================================
--- lld/trunk/test/ELF/dynamic-got-rela.s (added)
+++ lld/trunk/test/ELF/dynamic-got-rela.s Thu Dec 1 22:20:47 2016
@@ -0,0 +1,34 @@
+// REQUIRES: x86
+// RUN: llvm-mc -filetype=obj -triple=x86_64-pc-linux %s -o %t.o
+// RUN: ld.lld %t.o -o %t.so -shared
+// RUN: llvm-readobj -r -s -l -section-data %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: 0x[[GOT:.*]]
+// CHECK-NEXT: Offset:
+// CHECK-NEXT: Size:
+// CHECK-NEXT: Link:
+// CHECK-NEXT: Info:
+// CHECK-NEXT: AddressAlignment:
+// CHECK-NEXT: EntrySize:
+// CHECK-NEXT: SectionData (
+// CHECK-NEXT: 0000: 00000000 00000000 |
+// CHECK-NEXT: )
+
+// CHECK: Relocations [
+// CHECK-NEXT: Section ({{.*}}) .rela.dyn {
+// CHECK-NEXT: 0x[[GOT]] R_X86_64_RELATIVE - 0x[[ADDEND:.*]]
+// CHECK-NEXT: }
+// CHECK-NEXT: ]
+
+// CHECK: Type: PT_DYNAMIC
+// CHECK-NEXT: Offset: 0x[[ADDEND]]
+// CHECK-NEXT: VirtualAddress: 0x[[ADDEND]]
+// CHECK-NEXT: PhysicalAddress: 0x[[ADDEND]]
+
+cmpq $0, _DYNAMIC at GOTPCREL(%rip)
More information about the llvm-commits
mailing list