[lld] r224013 - ELF/AArch64: Add a test for R_AARCH64_ABS64

Will Newton will.newton at linaro.org
Thu Dec 11 04:36:58 PST 2014


Author: wnewton
Date: Thu Dec 11 06:36:58 2014
New Revision: 224013

URL: http://llvm.org/viewvc/llvm-project?rev=224013&view=rev
Log:
ELF/AArch64: Add a test for R_AARCH64_ABS64

Added:
    lld/trunk/test/elf/AArch64/rel-abs64.test

Added: lld/trunk/test/elf/AArch64/rel-abs64.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/AArch64/rel-abs64.test?rev=224013&view=auto
==============================================================================
--- lld/trunk/test/elf/AArch64/rel-abs64.test (added)
+++ lld/trunk/test/elf/AArch64/rel-abs64.test Thu Dec 11 06:36:58 2014
@@ -0,0 +1,59 @@
+# Check handling of R_AARCH64_ABS64 relocation.
+# RUN: yaml2obj -format=elf %s > %t-obj
+# RUN: lld -flavor gnu -target arm64 -o %t-exe %t-obj
+# RUN: llvm-objdump -s -t %t-exe | FileCheck %s
+
+# CHECK: Contents of section .data:
+# CHECK-NEXT: 401060 69104000 00000080 61104000 00000080 i. at .....a.@.....
+#                    ^^ data2 + 0x8000000000000001 = 0x8000000000401069
+#                                      ^^ data1 + 0x8000000000000001 = 0x8000000000401061
+# CHECK: SYMBOL TABLE:
+# CHECK: 00401060 g  .data  00000008 data1
+# CHECK: 00401068 g  .data  00000008 data2
+
+!ELF
+FileHeader: !FileHeader
+  Class: ELFCLASS64
+  Data: ELFDATA2LSB
+  Type: ET_REL
+  Machine: EM_AARCH64
+
+Sections:
+- Name: .text
+  Type: SHT_PROGBITS
+  Content: "00000000"
+  AddressAlign: 16
+  Flags: [SHF_ALLOC, SHF_EXECINSTR]
+- Name: .data
+  Type: SHT_PROGBITS
+  Content: "00000000000000000000000000000000"
+  AddressAlign: 16
+  Flags: [SHF_ALLOC, SHF_WRITE]
+
+- Name: .rela.data
+  Type: SHT_RELA
+  Info: .data
+  AddressAlign: 8
+  Relocations:
+    - Offset: 0x0
+      Symbol: data2
+      Type: R_AARCH64_ABS64
+      Addend: -9223372036854775807
+    - Offset: 0x8
+      Symbol: data1
+      Type: R_AARCH64_ABS64
+      Addend: -9223372036854775807
+
+Symbols:
+  Global:
+    - Name: _start
+      Section: .text
+      Value: 0x0
+      Size: 4
+    - Name: data1
+      Section: .data
+      Size: 8
+    - Name: data2
+      Section: .data
+      Value: 0x8
+      Size: 8





More information about the llvm-commits mailing list