aboutsummaryrefslogtreecommitdiffstats
path: root/test/MC/ELF
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-05-30 03:05:14 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-05-30 03:05:14 +0000
commit7486d92a6c949a193bb75c0ffa0170eeb2fabb80 (patch)
treeca8e73e165c5f83e01e2d97998f7baf7cd711f7e /test/MC/ELF
parentd2df98f3aad701512c6f14579a24672a49df1150 (diff)
downloadexternal_llvm-7486d92a6c949a193bb75c0ffa0170eeb2fabb80.zip
external_llvm-7486d92a6c949a193bb75c0ffa0170eeb2fabb80.tar.gz
external_llvm-7486d92a6c949a193bb75c0ffa0170eeb2fabb80.tar.bz2
Change how we iterate over relocations on ELF.
For COFF and MachO, sections semantically have relocations that apply to them. That is not the case on ELF. In relocatable objects (.o), a section with relocations in ELF has offsets to another section where the relocations should be applied. In dynamic objects and executables, relocations don't have an offset, they have a virtual address. The section sh_info may or may not point to another section, but that is not actually used for resolving the relocations. This patch exposes that in the ObjectFile API. It has the following advantages: * Most (all?) clients can handle this more efficiently. They will normally walk all relocations, so doing an effort to iterate in a particular order doesn't save time. * llvm-readobj now prints relocations in the same way the native readelf does. * probably most important, relocations that don't point to any section are now visible. This is the case of relocations in the rela.dyn section. See the updated relocation-executable.test for example. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@182908 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/MC/ELF')
-rw-r--r--test/MC/ELF/alias-reloc.s2
-rw-r--r--test/MC/ELF/basic-elf-32.s2
-rw-r--r--test/MC/ELF/basic-elf-64.s2
-rw-r--r--test/MC/ELF/cfi-adjust-cfa-offset.s2
-rw-r--r--test/MC/ELF/cfi-advance-loc2.s2
-rw-r--r--test/MC/ELF/cfi-def-cfa-offset.s2
-rw-r--r--test/MC/ELF/cfi-def-cfa-register.s2
-rw-r--r--test/MC/ELF/cfi-def-cfa.s2
-rw-r--r--test/MC/ELF/cfi-escape.s2
-rw-r--r--test/MC/ELF/cfi-offset.s2
-rw-r--r--test/MC/ELF/cfi-register.s2
-rw-r--r--test/MC/ELF/cfi-rel-offset.s2
-rw-r--r--test/MC/ELF/cfi-rel-offset2.s2
-rw-r--r--test/MC/ELF/cfi-remember.s2
-rw-r--r--test/MC/ELF/cfi-restore.s2
-rw-r--r--test/MC/ELF/cfi-same-value.s2
-rw-r--r--test/MC/ELF/cfi-undefined.s2
-rw-r--r--test/MC/ELF/cfi-zero-addr-delta.s2
-rw-r--r--test/MC/ELF/cfi.s144
-rw-r--r--test/MC/ELF/gen-dwarf.s4
-rw-r--r--test/MC/ELF/got.s2
-rw-r--r--test/MC/ELF/local-reloc.s2
-rw-r--r--test/MC/ELF/merge.s2
-rw-r--r--test/MC/ELF/relocation-386.s2
-rw-r--r--test/MC/ELF/relocation-pc.s4
-rw-r--r--test/MC/ELF/relocation.s2
-rw-r--r--test/MC/ELF/rename.s17
-rw-r--r--test/MC/ELF/symref.s2
-rw-r--r--test/MC/ELF/weak-relocation.s2
-rw-r--r--test/MC/ELF/x86_64-reloc-sizetest.s2
30 files changed, 119 insertions, 102 deletions
diff --git a/test/MC/ELF/alias-reloc.s b/test/MC/ELF/alias-reloc.s
index c25c259..f5448e5 100644
--- a/test/MC/ELF/alias-reloc.s
+++ b/test/MC/ELF/alias-reloc.s
@@ -18,7 +18,7 @@ foo2:
.quad bar2
// CHECK: Relocations [
-// CHECK-NEXT: Section ({{[0-9]+}}) zed {
+// CHECK-NEXT: Section ({{[0-9]+}}) .relazed {
// CHECK-NEXT: 0x1 R_X86_64_PLT32 bar 0xFFFFFFFFFFFFFFFC
// CHECK-NEXT: 0x5 R_X86_64_64 bar2 0x0
// CHECK-NEXT: }
diff --git a/test/MC/ELF/basic-elf-32.s b/test/MC/ELF/basic-elf-32.s
index 3ddb539..1f618e1 100644
--- a/test/MC/ELF/basic-elf-32.s
+++ b/test/MC/ELF/basic-elf-32.s
@@ -45,7 +45,7 @@ main: # @main
// CHECK: Name: .rel.text
// CHECK: Relocations [
-// CHECK: Section (1) .text {
+// CHECK: Section (2) .rel.text {
// CHECK: 0x6 R_386_32 .rodata.str1.1
// CHECK: 0xB R_386_PC32 puts
// CHECK: 0x12 R_386_32 .rodata.str1.1
diff --git a/test/MC/ELF/basic-elf-64.s b/test/MC/ELF/basic-elf-64.s
index f98623a..a77f3e6 100644
--- a/test/MC/ELF/basic-elf-64.s
+++ b/test/MC/ELF/basic-elf-64.s
@@ -45,7 +45,7 @@ main: # @main
// CHECK: Name: .rela.text
// CHECK: Relocations [
-// CHECK: Section (1) .text {
+// CHECK: Section (2) .rela.text {
// CHECK: 0x5 R_X86_64_32 .rodata.str1.1 0x0
// CHECK: 0xA R_X86_64_PC32 puts 0xFFFFFFFFFFFFFFFC
// CHECK: 0xF R_X86_64_32 .rodata.str1.1 0x6
diff --git a/test/MC/ELF/cfi-adjust-cfa-offset.s b/test/MC/ELF/cfi-adjust-cfa-offset.s
index 137b8b6..b3768cb 100644
--- a/test/MC/ELF/cfi-adjust-cfa-offset.s
+++ b/test/MC/ELF/cfi-adjust-cfa-offset.s
@@ -26,7 +26,6 @@ f:
// CHECK-NEXT: AddressAlignment: 8
// CHECK-NEXT: EntrySize: 0
// CHECK-NEXT: Relocations [
-// CHECK-NEXT: 0x20 R_X86_64_PC32 .text 0x0
// CHECK-NEXT: ]
// CHECK-NEXT: SectionData (
// CHECK-NEXT: 0000: 14000000 00000000 017A5200 01781001
@@ -49,5 +48,6 @@ f:
// CHECK-NEXT: AddressAlignment: 8
// CHECK-NEXT: EntrySize: 24
// CHECK-NEXT: Relocations [
+// CHECK-NEXT: 0x20 R_X86_64_PC32 .text 0x0
// CHECK-NEXT: ]
// CHECK: }
diff --git a/test/MC/ELF/cfi-advance-loc2.s b/test/MC/ELF/cfi-advance-loc2.s
index 1cad325..d7a53c4 100644
--- a/test/MC/ELF/cfi-advance-loc2.s
+++ b/test/MC/ELF/cfi-advance-loc2.s
@@ -24,7 +24,6 @@ f:
// CHECK-NEXT: AddressAlignment: 8
// CHECK-NEXT: EntrySize: 0
// CHECK-NEXT: Relocations [
-// CHECK-NEXT: 0x20 R_X86_64_PC32 .text 0x0
// CHECK-NEXT: ]
// CHECK-NEXT: SectionData (
// CHECK-NEXT: 0000: 14000000 00000000 017A5200 01781001
@@ -46,5 +45,6 @@ f:
// CHECK-NEXT: AddressAlignment: 8
// CHECK-NEXT: EntrySize: 24
// CHECK-NEXT: Relocations [
+// CHECK-NEXT: 0x20 R_X86_64_PC32 .text 0x0
// CHECK-NEXT: ]
// CHECK: }
diff --git a/test/MC/ELF/cfi-def-cfa-offset.s b/test/MC/ELF/cfi-def-cfa-offset.s
index f1a54a8..eac2c73 100644
--- a/test/MC/ELF/cfi-def-cfa-offset.s
+++ b/test/MC/ELF/cfi-def-cfa-offset.s
@@ -25,7 +25,6 @@ f:
// CHECK-NEXT: AddressAlignment: 8
// CHECK-NEXT: EntrySize: 0
// CHECK-NEXT: Relocations [
-// CHECK-NEXT: 0x20 R_X86_64_PC32 .text 0x0
// CHECK-NEXT: ]
// CHECK-NEXT: SectionData (
// CHECK-NEXT: 0000: 14000000 00000000 017A5200 01781001
@@ -48,5 +47,6 @@ f:
// CHECK-NEXT: AddressAlignment: 8
// CHECK-NEXT: EntrySize: 24
// CHECK-NEXT: Relocations [
+// CHECK-NEXT: 0x20 R_X86_64_PC32 .text 0x0
// CHECK-NEXT: ]
// CHECK: }
diff --git a/test/MC/ELF/cfi-def-cfa-register.s b/test/MC/ELF/cfi-def-cfa-register.s
index b1e74ea..00d8b99 100644
--- a/test/MC/ELF/cfi-def-cfa-register.s
+++ b/test/MC/ELF/cfi-def-cfa-register.s
@@ -21,7 +21,6 @@ f:
// CHECK-NEXT: AddressAlignment: 8
// CHECK-NEXT: EntrySize: 0
// CHECK-NEXT: Relocations [
-// CHECK-NEXT: 0x20 R_X86_64_PC32 .text 0x0
// CHECK-NEXT: ]
// CHECK-NEXT: SectionData (
// CHECK-NEXT: 0000: 14000000 00000000 017A5200 01781001
@@ -43,5 +42,6 @@ f:
// CHECK-NEXT: AddressAlignment: 8
// CHECK-NEXT: EntrySize: 24
// CHECK-NEXT: Relocations [
+// CHECK-NEXT: 0x20 R_X86_64_PC32 .text 0x0
// CHECK-NEXT: ]
// CHECK: }
diff --git a/test/MC/ELF/cfi-def-cfa.s b/test/MC/ELF/cfi-def-cfa.s
index abde0de..36e147f 100644
--- a/test/MC/ELF/cfi-def-cfa.s
+++ b/test/MC/ELF/cfi-def-cfa.s
@@ -21,7 +21,6 @@ f:
// CHECK-NEXT: AddressAlignment: 8
// CHECK-NEXT: EntrySize: 0
// CHECK-NEXT: Relocations [
-// CHECK-NEXT: 0x20 R_X86_64_PC32 .text 0x0
// CHECK-NEXT: ]
// CHECK-NEXT: SectionData (
// CHECK-NEXT: 0000: 14000000 00000000 017A5200 01781001
@@ -43,5 +42,6 @@ f:
// CHECK-NEXT: AddressAlignment: 8
// CHECK-NEXT: EntrySize: 24
// CHECK-NEXT: Relocations [
+// CHECK-NEXT: 0x20 R_X86_64_PC32 .text 0x0
// CHECK-NEXT: ]
// CHECK: }
diff --git a/test/MC/ELF/cfi-escape.s b/test/MC/ELF/cfi-escape.s
index a910fab..839d671 100644
--- a/test/MC/ELF/cfi-escape.s
+++ b/test/MC/ELF/cfi-escape.s
@@ -22,7 +22,6 @@ f:
// CHECK-NEXT: AddressAlignment: 8
// CHECK-NEXT: EntrySize: 0
// CHECK-NEXT: Relocations [
-// CHECK-NEXT: 0x20 R_X86_64_PC32 .text 0x0
// CHECK-NEXT: ]
// CHECK-NEXT: SectionData (
// CHECK-NEXT: 0000: 14000000 00000000 017A5200 01781001
@@ -44,5 +43,6 @@ f:
// CHECK-NEXT: AddressAlignment: 8
// CHECK-NEXT: EntrySize: 24
// CHECK-NEXT: Relocations [
+// CHECK-NEXT: 0x20 R_X86_64_PC32 .text 0x0
// CHECK-NEXT: ]
// CHECK: }
diff --git a/test/MC/ELF/cfi-offset.s b/test/MC/ELF/cfi-offset.s
index f7f95fb..951a600 100644
--- a/test/MC/ELF/cfi-offset.s
+++ b/test/MC/ELF/cfi-offset.s
@@ -21,7 +21,6 @@ f:
// CHECK-NEXT: AddressAlignment: 8
// CHECK-NEXT: EntrySize: 0
// CHECK-NEXT: Relocations [
-// CHECK-NEXT: 0x20 R_X86_64_PC32 .text 0x0
// CHECK-NEXT: ]
// CHECK-NEXT: SectionData (
// CHECK-NEXT: 0000: 14000000 00000000 017A5200 01781001
@@ -43,5 +42,6 @@ f:
// CHECK-NEXT: AddressAlignment: 8
// CHECK-NEXT: EntrySize: 24
// CHECK-NEXT: Relocations [
+// CHECK-NEXT: 0x20 R_X86_64_PC32 .text 0x0
// CHECK-NEXT: ]
// CHECK: }
diff --git a/test/MC/ELF/cfi-register.s b/test/MC/ELF/cfi-register.s
index f7a07e4..4abbb53 100644
--- a/test/MC/ELF/cfi-register.s
+++ b/test/MC/ELF/cfi-register.s
@@ -22,7 +22,6 @@ f:
// CHECK-NEXT: AddressAlignment: 8
// CHECK-NEXT: EntrySize: 0
// CHECK-NEXT: Relocations [
-// CHECK-NEXT: 0x20 R_X86_64_PC32 .text 0x0
// CHECK-NEXT: ]
// CHECK-NEXT: SectionData (
// CHECK-NEXT: 0000: 14000000 00000000 017A5200 01781001
@@ -44,5 +43,6 @@ f:
// CHECK-NEXT: AddressAlignment: 8
// CHECK-NEXT: EntrySize: 24
// CHECK-NEXT: Relocations [
+// CHECK-NEXT: 0x20 R_X86_64_PC32 .text 0x0
// CHECK-NEXT: ]
// CHECK: }
diff --git a/test/MC/ELF/cfi-rel-offset.s b/test/MC/ELF/cfi-rel-offset.s
index 35a73ef..34254c8 100644
--- a/test/MC/ELF/cfi-rel-offset.s
+++ b/test/MC/ELF/cfi-rel-offset.s
@@ -29,7 +29,6 @@ f:
// CHECK-NEXT: AddressAlignment: 8
// CHECK-NEXT: EntrySize: 0
// CHECK-NEXT: Relocations [
-// CHECK-NEXT: 0x20 R_X86_64_PC32 .text 0x0
// CHECK-NEXT: ]
// CHECK-NEXT: SectionData (
// CHECK-NEXT: 0000: 14000000 00000000 017A5200 01781001
@@ -52,5 +51,6 @@ f:
// CHECK-NEXT: AddressAlignment: 8
// CHECK-NEXT: EntrySize: 24
// CHECK-NEXT: Relocations [
+// CHECK-NEXT: 0x20 R_X86_64_PC32 .text 0x0
// CHECK-NEXT: ]
// CHECK: }
diff --git a/test/MC/ELF/cfi-rel-offset2.s b/test/MC/ELF/cfi-rel-offset2.s
index 5817d1f..3de769f 100644
--- a/test/MC/ELF/cfi-rel-offset2.s
+++ b/test/MC/ELF/cfi-rel-offset2.s
@@ -21,7 +21,6 @@ f:
// CHECK-NEXT: AddressAlignment: 8
// CHECK-NEXT: EntrySize: 0
// CHECK-NEXT: Relocations [
-// CHECK-NEXT: 0x20 R_X86_64_PC32 .text 0x0
// CHECK-NEXT: ]
// CHECK-NEXT: SectionData (
// CHECK-NEXT: 0000: 14000000 00000000 017A5200 01781001
@@ -43,5 +42,6 @@ f:
// CHECK-NEXT: AddressAlignment: 8
// CHECK-NEXT: EntrySize: 24
// CHECK-NEXT: Relocations [
+// CHECK-NEXT: 0x20 R_X86_64_PC32 .text 0x0
// CHECK-NEXT: ]
// CHECK: }
diff --git a/test/MC/ELF/cfi-remember.s b/test/MC/ELF/cfi-remember.s
index 932a182..98c759d 100644
--- a/test/MC/ELF/cfi-remember.s
+++ b/test/MC/ELF/cfi-remember.s
@@ -24,7 +24,6 @@ f:
// CHECK-NEXT: AddressAlignment: 8
// CHECK-NEXT: EntrySize: 0
// CHECK-NEXT: Relocations [
-// CHECK-NEXT: 0x20 R_X86_64_PC32 .text 0x0
// CHECK-NEXT: ]
// CHECK-NEXT: SectionData (
// CHECK-NEXT: 0000: 14000000 00000000 017A5200 01781001
@@ -46,5 +45,6 @@ f:
// CHECK-NEXT: AddressAlignment: 8
// CHECK-NEXT: EntrySize: 24
// CHECK-NEXT: Relocations [
+// CHECK-NEXT: 0x20 R_X86_64_PC32 .text 0x0
// CHECK-NEXT: ]
// CHECK: }
diff --git a/test/MC/ELF/cfi-restore.s b/test/MC/ELF/cfi-restore.s
index 6c25d5b..d25b5ff 100644
--- a/test/MC/ELF/cfi-restore.s
+++ b/test/MC/ELF/cfi-restore.s
@@ -22,7 +22,6 @@ f:
// CHECK-NEXT: AddressAlignment: 8
// CHECK-NEXT: EntrySize: 0
// CHECK-NEXT: Relocations [
-// CHECK-NEXT: 0x20 R_X86_64_PC32 .text 0x0
// CHECK-NEXT: ]
// CHECK-NEXT: SectionData (
// CHECK-NEXT: 0000: 14000000 00000000 017A5200 01781001
@@ -44,5 +43,6 @@ f:
// CHECK-NEXT: AddressAlignment: 8
// CHECK-NEXT: EntrySize: 24
// CHECK-NEXT: Relocations [
+// CHECK-NEXT: 0x20 R_X86_64_PC32 .text 0x0
// CHECK-NEXT: ]
// CHECK: }
diff --git a/test/MC/ELF/cfi-same-value.s b/test/MC/ELF/cfi-same-value.s
index 075c6b9..9f5ae4b 100644
--- a/test/MC/ELF/cfi-same-value.s
+++ b/test/MC/ELF/cfi-same-value.s
@@ -22,7 +22,6 @@ f:
// CHECK-NEXT: AddressAlignment: 8
// CHECK-NEXT: EntrySize: 0
// CHECK-NEXT: Relocations [
-// CHECK-NEXT: 0x20 R_X86_64_PC32 .text 0x0
// CHECK-NEXT: ]
// CHECK-NEXT: SectionData (
// CHECK-NEXT: 0000: 14000000 00000000 017A5200 01781001
@@ -44,5 +43,6 @@ f:
// CHECK-NEXT: AddressAlignment: 8
// CHECK-NEXT: EntrySize: 24
// CHECK-NEXT: Relocations [
+// CHECK-NEXT: 0x20 R_X86_64_PC32 .text 0x0
// CHECK-NEXT: ]
// CHECK: }
diff --git a/test/MC/ELF/cfi-undefined.s b/test/MC/ELF/cfi-undefined.s
index c83b47c..9773a36 100644
--- a/test/MC/ELF/cfi-undefined.s
+++ b/test/MC/ELF/cfi-undefined.s
@@ -22,7 +22,6 @@ f:
// CHECK-NEXT: AddressAlignment: 8
// CHECK-NEXT: EntrySize: 0
// CHECK-NEXT: Relocations [
-// CHECK-NEXT: 0x20 R_X86_64_PC32 .text 0x0
// CHECK-NEXT: ]
// CHECK-NEXT: SectionData (
// CHECK-NEXT: 0000: 14000000 00000000 017A5200 01781001
@@ -44,5 +43,6 @@ f:
// CHECK-NEXT: AddressAlignment: 8
// CHECK-NEXT: EntrySize: 24
// CHECK-NEXT: Relocations [
+// CHECK-NEXT: 0x20 R_X86_64_PC32 .text 0x0
// CHECK-NEXT: ]
// CHECK: }
diff --git a/test/MC/ELF/cfi-zero-addr-delta.s b/test/MC/ELF/cfi-zero-addr-delta.s
index 4ac0e34..05cb0ae 100644
--- a/test/MC/ELF/cfi-zero-addr-delta.s
+++ b/test/MC/ELF/cfi-zero-addr-delta.s
@@ -28,7 +28,6 @@ f:
// CHECK-NEXT: AddressAlignment: 8
// CHECK-NEXT: EntrySize: 0
// CHECK-NEXT: Relocations [
-// CHECK-NEXT: 0x20 R_X86_64_PC32 .text 0x0
// CHECK-NEXT: ]
// CHECK-NEXT: SectionData (
// CHECK-NEXT: 0000: 14000000 00000000 017A5200 01781001
@@ -51,4 +50,5 @@ f:
// CHECK-NEXT: AddressAlignment: 8
// CHECK-NEXT: EntrySize: 24
// CHECK-NEXT: Relocations [
+// CHECK-NEXT: 0x20 R_X86_64_PC32 .text 0x0
// CHECK-NEXT: ]
diff --git a/test/MC/ELF/cfi.s b/test/MC/ELF/cfi.s
index 98f4fa9..b8b6e6b 100644
--- a/test/MC/ELF/cfi.s
+++ b/test/MC/ELF/cfi.s
@@ -227,78 +227,6 @@ f36:
// CHECK-NEXT: AddressAlignment: 8
// CHECK-NEXT: EntrySize: 0
// CHECK-NEXT: Relocations [
-// CHECK-NEXT: 0x20 R_X86_64_PC32 .text 0x0
-// CHECK-NEXT: 0x29 R_X86_64_32 bar 0x0
-// CHECK-NEXT: 0x43 R_X86_64_64 foo 0x0
-// CHECK-NEXT: 0x5C R_X86_64_PC32 .text 0x1
-// CHECK-NEXT: 0x65 R_X86_64_32 bar 0x0
-// CHECK-NEXT: 0x74 R_X86_64_PC32 .text 0x2
-// CHECK-NEXT: 0x7D R_X86_64_32 bar 0x0
-// CHECK-NEXT: 0x97 R_X86_64_64 foo 0x0
-// CHECK-NEXT: 0xB0 R_X86_64_PC32 .text 0x3
-// CHECK-NEXT: 0xB9 R_X86_64_16 bar 0x0
-// CHECK-NEXT: 0xCE R_X86_64_16 foo 0x0
-// CHECK-NEXT: 0xE0 R_X86_64_PC32 .text 0x4
-// CHECK-NEXT: 0xFE R_X86_64_32 foo 0x0
-// CHECK-NEXT: 0x110 R_X86_64_PC32 .text 0x5
-// CHECK-NEXT: 0x12E R_X86_64_64 foo 0x0
-// CHECK-NEXT: 0x144 R_X86_64_PC32 .text 0x6
-// CHECK-NEXT: 0x162 R_X86_64_16 foo 0x0
-// CHECK-NEXT: 0x174 R_X86_64_PC32 .text 0x7
-// CHECK-NEXT: 0x192 R_X86_64_32 foo 0x0
-// CHECK-NEXT: 0x1A4 R_X86_64_PC32 .text 0x8
-// CHECK-NEXT: 0x1C2 R_X86_64_64 foo 0x0
-// CHECK-NEXT: 0x1D8 R_X86_64_PC32 .text 0x9
-// CHECK-NEXT: 0x1F6 R_X86_64_64 foo 0x0
-// CHECK-NEXT: 0x20C R_X86_64_PC32 .text 0xA
-// CHECK-NEXT: 0x22A R_X86_64_PC64 foo 0x0
-// CHECK-NEXT: 0x240 R_X86_64_PC32 .text 0xB
-// CHECK-NEXT: 0x25E R_X86_64_PC16 foo 0x0
-// CHECK-NEXT: 0x270 R_X86_64_PC32 .text 0xC
-// CHECK-NEXT: 0x28E R_X86_64_PC32 foo 0x0
-// CHECK-NEXT: 0x2A0 R_X86_64_PC32 .text 0xD
-// CHECK-NEXT: 0x2BE R_X86_64_PC64 foo 0x0
-// CHECK-NEXT: 0x2D4 R_X86_64_PC32 .text 0xE
-// CHECK-NEXT: 0x2F2 R_X86_64_PC16 foo 0x0
-// CHECK-NEXT: 0x304 R_X86_64_PC32 .text 0xF
-// CHECK-NEXT: 0x322 R_X86_64_PC32 foo 0x0
-// CHECK-NEXT: 0x334 R_X86_64_PC32 .text 0x10
-// CHECK-NEXT: 0x352 R_X86_64_PC64 foo 0x0
-// CHECK-NEXT: 0x368 R_X86_64_PC32 .text 0x11
-// CHECK-NEXT: 0x386 R_X86_64_PC64 foo 0x0
-// CHECK-NEXT: 0x39C R_X86_64_PC32 .text 0x12
-// CHECK-NEXT: 0x3BA R_X86_64_64 foo 0x0
-// CHECK-NEXT: 0x3D0 R_X86_64_PC32 .text 0x13
-// CHECK-NEXT: 0x3EE R_X86_64_16 foo 0x0
-// CHECK-NEXT: 0x400 R_X86_64_PC32 .text 0x14
-// CHECK-NEXT: 0x41E R_X86_64_32 foo 0x0
-// CHECK-NEXT: 0x430 R_X86_64_PC32 .text 0x15
-// CHECK-NEXT: 0x44E R_X86_64_64 foo 0x0
-// CHECK-NEXT: 0x464 R_X86_64_PC32 .text 0x16
-// CHECK-NEXT: 0x482 R_X86_64_16 foo 0x0
-// CHECK-NEXT: 0x494 R_X86_64_PC32 .text 0x17
-// CHECK-NEXT: 0x4B2 R_X86_64_32 foo 0x0
-// CHECK-NEXT: 0x4C4 R_X86_64_PC32 .text 0x18
-// CHECK-NEXT: 0x4E2 R_X86_64_64 foo 0x0
-// CHECK-NEXT: 0x4F8 R_X86_64_PC32 .text 0x19
-// CHECK-NEXT: 0x516 R_X86_64_64 foo 0x0
-// CHECK-NEXT: 0x52C R_X86_64_PC32 .text 0x1A
-// CHECK-NEXT: 0x54A R_X86_64_PC64 foo 0x0
-// CHECK-NEXT: 0x560 R_X86_64_PC32 .text 0x1B
-// CHECK-NEXT: 0x57E R_X86_64_PC16 foo 0x0
-// CHECK-NEXT: 0x590 R_X86_64_PC32 .text 0x1C
-// CHECK-NEXT: 0x5AE R_X86_64_PC32 foo 0x0
-// CHECK-NEXT: 0x5C0 R_X86_64_PC32 .text 0x1D
-// CHECK-NEXT: 0x5DE R_X86_64_PC64 foo 0x0
-// CHECK-NEXT: 0x5F4 R_X86_64_PC32 .text 0x1E
-// CHECK-NEXT: 0x612 R_X86_64_PC16 foo 0x0
-// CHECK-NEXT: 0x624 R_X86_64_PC32 .text 0x1F
-// CHECK-NEXT: 0x642 R_X86_64_PC32 foo 0x0
-// CHECK-NEXT: 0x654 R_X86_64_PC32 .text 0x20
-// CHECK-NEXT: 0x672 R_X86_64_PC64 foo 0x0
-// CHECK-NEXT: 0x688 R_X86_64_PC32 .text 0x21
-// CHECK-NEXT: 0x6A6 R_X86_64_PC64 foo 0x0
-// CHECK-NEXT: 0x6BC R_X86_64_PC32 .text 0x22
// CHECK-NEXT: ]
// CHECK-NEXT: SectionData (
// CHECK-NEXT: 0000: 14000000 00000000 017A4C52 00017810
@@ -427,5 +355,77 @@ f36:
// CHECK-NEXT: AddressAlignment: 8
// CHECK-NEXT: EntrySize: 24
// CHECK-NEXT: Relocations [
+// CHECK-NEXT: 0x20 R_X86_64_PC32 .text 0x0
+// CHECK-NEXT: 0x29 R_X86_64_32 bar 0x0
+// CHECK-NEXT: 0x43 R_X86_64_64 foo 0x0
+// CHECK-NEXT: 0x5C R_X86_64_PC32 .text 0x1
+// CHECK-NEXT: 0x65 R_X86_64_32 bar 0x0
+// CHECK-NEXT: 0x74 R_X86_64_PC32 .text 0x2
+// CHECK-NEXT: 0x7D R_X86_64_32 bar 0x0
+// CHECK-NEXT: 0x97 R_X86_64_64 foo 0x0
+// CHECK-NEXT: 0xB0 R_X86_64_PC32 .text 0x3
+// CHECK-NEXT: 0xB9 R_X86_64_16 bar 0x0
+// CHECK-NEXT: 0xCE R_X86_64_16 foo 0x0
+// CHECK-NEXT: 0xE0 R_X86_64_PC32 .text 0x4
+// CHECK-NEXT: 0xFE R_X86_64_32 foo 0x0
+// CHECK-NEXT: 0x110 R_X86_64_PC32 .text 0x5
+// CHECK-NEXT: 0x12E R_X86_64_64 foo 0x0
+// CHECK-NEXT: 0x144 R_X86_64_PC32 .text 0x6
+// CHECK-NEXT: 0x162 R_X86_64_16 foo 0x0
+// CHECK-NEXT: 0x174 R_X86_64_PC32 .text 0x7
+// CHECK-NEXT: 0x192 R_X86_64_32 foo 0x0
+// CHECK-NEXT: 0x1A4 R_X86_64_PC32 .text 0x8
+// CHECK-NEXT: 0x1C2 R_X86_64_64 foo 0x0
+// CHECK-NEXT: 0x1D8 R_X86_64_PC32 .text 0x9
+// CHECK-NEXT: 0x1F6 R_X86_64_64 foo 0x0
+// CHECK-NEXT: 0x20C R_X86_64_PC32 .text 0xA
+// CHECK-NEXT: 0x22A R_X86_64_PC64 foo 0x0
+// CHECK-NEXT: 0x240 R_X86_64_PC32 .text 0xB
+// CHECK-NEXT: 0x25E R_X86_64_PC16 foo 0x0
+// CHECK-NEXT: 0x270 R_X86_64_PC32 .text 0xC
+// CHECK-NEXT: 0x28E R_X86_64_PC32 foo 0x0
+// CHECK-NEXT: 0x2A0 R_X86_64_PC32 .text 0xD
+// CHECK-NEXT: 0x2BE R_X86_64_PC64 foo 0x0
+// CHECK-NEXT: 0x2D4 R_X86_64_PC32 .text 0xE
+// CHECK-NEXT: 0x2F2 R_X86_64_PC16 foo 0x0
+// CHECK-NEXT: 0x304 R_X86_64_PC32 .text 0xF
+// CHECK-NEXT: 0x322 R_X86_64_PC32 foo 0x0
+// CHECK-NEXT: 0x334 R_X86_64_PC32 .text 0x10
+// CHECK-NEXT: 0x352 R_X86_64_PC64 foo 0x0
+// CHECK-NEXT: 0x368 R_X86_64_PC32 .text 0x11
+// CHECK-NEXT: 0x386 R_X86_64_PC64 foo 0x0
+// CHECK-NEXT: 0x39C R_X86_64_PC32 .text 0x12
+// CHECK-NEXT: 0x3BA R_X86_64_64 foo 0x0
+// CHECK-NEXT: 0x3D0 R_X86_64_PC32 .text 0x13
+// CHECK-NEXT: 0x3EE R_X86_64_16 foo 0x0
+// CHECK-NEXT: 0x400 R_X86_64_PC32 .text 0x14
+// CHECK-NEXT: 0x41E R_X86_64_32 foo 0x0
+// CHECK-NEXT: 0x430 R_X86_64_PC32 .text 0x15
+// CHECK-NEXT: 0x44E R_X86_64_64 foo 0x0
+// CHECK-NEXT: 0x464 R_X86_64_PC32 .text 0x16
+// CHECK-NEXT: 0x482 R_X86_64_16 foo 0x0
+// CHECK-NEXT: 0x494 R_X86_64_PC32 .text 0x17
+// CHECK-NEXT: 0x4B2 R_X86_64_32 foo 0x0
+// CHECK-NEXT: 0x4C4 R_X86_64_PC32 .text 0x18
+// CHECK-NEXT: 0x4E2 R_X86_64_64 foo 0x0
+// CHECK-NEXT: 0x4F8 R_X86_64_PC32 .text 0x19
+// CHECK-NEXT: 0x516 R_X86_64_64 foo 0x0
+// CHECK-NEXT: 0x52C R_X86_64_PC32 .text 0x1A
+// CHECK-NEXT: 0x54A R_X86_64_PC64 foo 0x0
+// CHECK-NEXT: 0x560 R_X86_64_PC32 .text 0x1B
+// CHECK-NEXT: 0x57E R_X86_64_PC16 foo 0x0
+// CHECK-NEXT: 0x590 R_X86_64_PC32 .text 0x1C
+// CHECK-NEXT: 0x5AE R_X86_64_PC32 foo 0x0
+// CHECK-NEXT: 0x5C0 R_X86_64_PC32 .text 0x1D
+// CHECK-NEXT: 0x5DE R_X86_64_PC64 foo 0x0
+// CHECK-NEXT: 0x5F4 R_X86_64_PC32 .text 0x1E
+// CHECK-NEXT: 0x612 R_X86_64_PC16 foo 0x0
+// CHECK-NEXT: 0x624 R_X86_64_PC32 .text 0x1F
+// CHECK-NEXT: 0x642 R_X86_64_PC32 foo 0x0
+// CHECK-NEXT: 0x654 R_X86_64_PC32 .text 0x20
+// CHECK-NEXT: 0x672 R_X86_64_PC64 foo 0x0
+// CHECK-NEXT: 0x688 R_X86_64_PC32 .text 0x21
+// CHECK-NEXT: 0x6A6 R_X86_64_PC64 foo 0x0
+// CHECK-NEXT: 0x6BC R_X86_64_PC32 .text 0x22
// CHECK-NEXT: ]
// CHECK: }
diff --git a/test/MC/ELF/gen-dwarf.s b/test/MC/ELF/gen-dwarf.s
index 907bf42..a702bc8 100644
--- a/test/MC/ELF/gen-dwarf.s
+++ b/test/MC/ELF/gen-dwarf.s
@@ -15,11 +15,11 @@ foo:
.size foo, .-foo
// CHECK: Relocations [
-// CHECK: Section ({{[^ ]+}}) .debug_info {
+// CHECK: Section ({{[^ ]+}}) .rel.debug_info {
// CHECK-NEXT: 0x6 R_386_32 .debug_abbrev 0x0
// CHECK-NEXT: 0xC R_386_32 .debug_line 0x0
// CHECK: }
-// CHECK-NEXT: Section ({{[^ ]+}}) .debug_aranges {
+// CHECK-NEXT: Section ({{[^ ]+}}) .rel.debug_aranges {
// CHECK-NEXT: 0x6 R_386_32 .debug_info 0x0
// CHECK-NEXT: 0x10 R_386_32 .text 0x0
// CHECK-NEXT: }
diff --git a/test/MC/ELF/got.s b/test/MC/ELF/got.s
index 60dea6d..30114b7 100644
--- a/test/MC/ELF/got.s
+++ b/test/MC/ELF/got.s
@@ -7,7 +7,7 @@
movl foo@GOTPCREL(%rip), %eax
// CHECK: Relocations [
-// CHECK: Section ({{[^ ]+}}) .text {
+// CHECK: Section ({{[^ ]+}}) .rela.text {
// CHECK-NEXT: 0x{{[^ ]+}} R_X86_64_GOT32 foo 0x{{[^ ]+}}
// CHECK-NEXT: 0x{{[^ ]+}} R_X86_64_GOTPCREL foo 0x{{[^ ]+}}
// CHECK-NEXT: }
diff --git a/test/MC/ELF/local-reloc.s b/test/MC/ELF/local-reloc.s
index 4241ba5..0c74519 100644
--- a/test/MC/ELF/local-reloc.s
+++ b/test/MC/ELF/local-reloc.s
@@ -7,7 +7,7 @@
foo:
// CHECKT: Relocations [
-// CHECK: Section (1) .text {
+// CHECK: Section (2) .rela.text {
// CHECK-NEXT: 0x{{[^ ]+}} R_X86_64_32S .text 0x{{[^ ]+}}
// CHECK-NEXT: }
// CHECK-NEXT: ]
diff --git a/test/MC/ELF/merge.s b/test/MC/ELF/merge.s
index d34635a..0e92583 100644
--- a/test/MC/ELF/merge.s
+++ b/test/MC/ELF/merge.s
@@ -23,7 +23,7 @@ zed:
foo:
// CHECK: Relocations [
-// CHECK-NEXT: Section (1) .text {
+// CHECK-NEXT: Section (2) .rela.text {
// CHECK-NEXT: 0x{{[^ ]+}} R_X86_64_PC32 .Lfoo 0x{{[^ ]+}}
// CHECK-NEXT: 0x{{[^ ]+}} R_X86_64_32 .sec1 0x{{[^ ]+}}
// CHECK-NEXT: 0x{{[^ ]+}} R_X86_64_32 .Lfoo 0x{{[^ ]+}}
diff --git a/test/MC/ELF/relocation-386.s b/test/MC/ELF/relocation-386.s
index 24d0172..9bc8310 100644
--- a/test/MC/ELF/relocation-386.s
+++ b/test/MC/ELF/relocation-386.s
@@ -4,7 +4,7 @@
// correctly point to the section or the symbol.
// CHECK: Relocations [
-// CHECK-NEXT: Section (1) .text {
+// CHECK-NEXT: Section (2) .rel.text {
// CHECK-NEXT: 0x2 R_386_GOTOFF .Lfoo 0x0
// CHECK-NEXT: 0x{{[^ ]+}} R_386_PLT32 bar2 0x0
// CHECK-NEXT: 0x{{[^ ]+}} R_386_GOTPC _GLOBAL_OFFSET_TABLE_ 0x0
diff --git a/test/MC/ELF/relocation-pc.s b/test/MC/ELF/relocation-pc.s
index 551f5ff..fc7420c 100644
--- a/test/MC/ELF/relocation-pc.s
+++ b/test/MC/ELF/relocation-pc.s
@@ -9,8 +9,6 @@
// CHECK: Index: 1
// CHECK-NEXT: Name: .text
// CHECK: Relocations [
-// CHECK-NEXT: 0x1 R_X86_64_PC8 - 0x0
-// CHECK-NEXT: 0x3 R_X86_64_PC32 - 0x0
// CHECK-NEXT: ]
// CHECK-NEXT: }
@@ -28,5 +26,7 @@
// CHECK-NEXT: AddressAlignment: 8
// CHECK-NEXT: EntrySize: 24
// CHECK-NEXT: Relocations [
+// CHECK-NEXT: 0x1 R_X86_64_PC8 - 0x0
+// CHECK-NEXT: 0x3 R_X86_64_PC32 - 0x0
// CHECK-NEXT: ]
// CHECK-NEXT: }
diff --git a/test/MC/ELF/relocation.s b/test/MC/ELF/relocation.s
index 19bcc18..18d43da 100644
--- a/test/MC/ELF/relocation.s
+++ b/test/MC/ELF/relocation.s
@@ -21,7 +21,7 @@ bar:
// CHECK: Section {
-// CHECK: Name: .text
+// CHECK: Name: .rela.text
// CHECK: Relocations [
// CHECK-NEXT: 0x1 R_X86_64_32 .text
// CHECK-NEXT: 0x8 R_X86_64_32S .text
diff --git a/test/MC/ELF/rename.s b/test/MC/ELF/rename.s
index c50910b..5364dde 100644
--- a/test/MC/ELF/rename.s
+++ b/test/MC/ELF/rename.s
@@ -32,10 +32,27 @@ defined3:
// CHECK-NEXT: AddressAlignment: 4
// CHECK-NEXT: EntrySize: 0
// CHECK-NEXT: Relocations [
+// CHECK-NEXT: ]
+// CHECK-NEXT: }
+// CHECK-NEXT: Section {
+// CHECK-NEXT: Index: 2
+// CHECK-NEXT: Name: .rela.text (1)
+// CHECK-NEXT: Type: SHT_RELA (0x4)
+// CHECK-NEXT: Flags [ (0x0)
+// CHECK-NEXT: ]
+// CHECK-NEXT: Address: 0x0
+// CHECK-NEXT: Offset: 0x320
+// CHECK-NEXT: Size: 24
+// CHECK-NEXT: Link: 6
+// CHECK-NEXT: Info: 1
+// CHECK-NEXT: AddressAlignment: 8
+// CHECK-NEXT: EntrySize: 24
+// CHECK-NEXT: Relocations [
// CHECK-NEXT: 0x0 R_X86_64_32 .text 0x0
// CHECK-NEXT: ]
// CHECK-NEXT: }
+
// Symbol 2 is section 1
// CHECK: Symbol {
// CHECK: Name: .text (0)
diff --git a/test/MC/ELF/symref.s b/test/MC/ELF/symref.s
index 9a71a81..c8015b9 100644
--- a/test/MC/ELF/symref.s
+++ b/test/MC/ELF/symref.s
@@ -22,7 +22,7 @@ defined3:
global1:
// CHECK: Relocations [
-// CHECK-NEXT: Section (1) .text {
+// CHECK-NEXT: Section (2) .rela.text {
// CHECK-NEXT: 0x0 R_X86_64_32 .text 0x0
// CHECK-NEXT: 0x4 R_X86_64_32 bar2@zed 0x0
// CHECK-NEXT: 0x8 R_X86_64_32 .text 0x0
diff --git a/test/MC/ELF/weak-relocation.s b/test/MC/ELF/weak-relocation.s
index 0f5bba2..19153aa 100644
--- a/test/MC/ELF/weak-relocation.s
+++ b/test/MC/ELF/weak-relocation.s
@@ -8,7 +8,7 @@ bar:
call foo
// CHECK: Relocations [
-// CHECK-NEXT: Section ({{[0-9]+}}) .text {
+// CHECK-NEXT: Section ({{[0-9]+}}) .rela.text {
// CHECK-NEXT: 0x1 R_X86_64_PC32 foo 0xFFFFFFFFFFFFFFFC
// CHECK-NEXT: }
// CHECK-NEXT: ]
diff --git a/test/MC/ELF/x86_64-reloc-sizetest.s b/test/MC/ELF/x86_64-reloc-sizetest.s
index bd67ee0..10c1312 100644
--- a/test/MC/ELF/x86_64-reloc-sizetest.s
+++ b/test/MC/ELF/x86_64-reloc-sizetest.s
@@ -7,7 +7,7 @@ L: movq $(L + 2147483648),%rax
// CHECK: Relocations [
-// CHECK-NEXT: Section ({{[0-9]+}}) .text {
+// CHECK-NEXT: Section ({{[0-9]+}}) .rela.text {
// CHECK-NEXT: 0x3 R_X86_64_32S {{[^ ]+}} 0x80000000
// CHECK-NEXT: }
// CHECK-NEXT: ]