Update tests to not be as dependent on section numbers.
Many of these predate llvm-readobj. With elf-dump we had to match
a relocation to symbol number and symbol number to symbol name or
section number.
llvm-svn: 235015
diff --git a/llvm/test/MC/ELF/basic-elf-32.s b/llvm/test/MC/ELF/basic-elf-32.s
index e12fc52..16266af 100644
--- a/llvm/test/MC/ELF/basic-elf-32.s
+++ b/llvm/test/MC/ELF/basic-elf-32.s
@@ -45,7 +45,7 @@
// CHECK: Name: .rel.text
// CHECK: Relocations [
-// CHECK: Section (2) .rel.text {
+// CHECK: Section {{.*}} .rel.text {
// CHECK: 0x6 R_386_32 .L.str1
// CHECK: 0xB R_386_PC32 puts
// CHECK: 0x12 R_386_32 .L.str2
diff --git a/llvm/test/MC/ELF/basic-elf-64.s b/llvm/test/MC/ELF/basic-elf-64.s
index a77f3e6..d99125e 100644
--- a/llvm/test/MC/ELF/basic-elf-64.s
+++ b/llvm/test/MC/ELF/basic-elf-64.s
@@ -45,7 +45,7 @@
// CHECK: Name: .rela.text
// CHECK: Relocations [
-// CHECK: Section (2) .rela.text {
+// CHECK: Section {{.*}} .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/llvm/test/MC/ELF/common.s b/llvm/test/MC/ELF/common.s
index bd96564..b7e6ba0 100644
--- a/llvm/test/MC/ELF/common.s
+++ b/llvm/test/MC/ELF/common.s
@@ -45,7 +45,7 @@
// CHECK-NEXT: Binding: Local
// CHECK-NEXT: Type: Object
// CHECK-NEXT: Other: 0
-// CHECK-NEXT: Section: .bss (0x4)
+// CHECK-NEXT: Section: .bss
// CHECK-NEXT: }
diff --git a/llvm/test/MC/ELF/compression.s b/llvm/test/MC/ELF/compression.s
index 07b689e..5560ba7 100644
--- a/llvm/test/MC/ELF/compression.s
+++ b/llvm/test/MC/ELF/compression.s
@@ -10,7 +10,6 @@
// Check for the 'ZLIB' file magic at the start of the section only
// CHECK-NEXT: ZLIB
// CHECK-NOT: ZLIB
-// CHECK: Contents of
// Don't compress small sections, such as this simple debug_abbrev example
// CHECK: Contents of section .debug_abbrev:
diff --git a/llvm/test/MC/ELF/ifunc-reloc.s b/llvm/test/MC/ELF/ifunc-reloc.s
index 0195463..6f1d79b2 100644
--- a/llvm/test/MC/ELF/ifunc-reloc.s
+++ b/llvm/test/MC/ELF/ifunc-reloc.s
@@ -10,7 +10,7 @@
callq sym
// CHECK: Relocations [
-// CHECK-NEXT: Section (2) .rela.text {
+// CHECK-NEXT: Section {{.*}} .rela.text {
// CHECK-NEXT: 0x1 R_X86_64_PC32 sym 0xFFFFFFFFFFFFFFFC
// CHECK-NEXT: }
// CHECK-NEXT: ]
diff --git a/llvm/test/MC/ELF/local-reloc.s b/llvm/test/MC/ELF/local-reloc.s
index 19b9509..ce0b674 100644
--- a/llvm/test/MC/ELF/local-reloc.s
+++ b/llvm/test/MC/ELF/local-reloc.s
@@ -7,7 +7,7 @@
foo:
// CHECK: Relocations [
-// CHECK: Section (2) .rela.text {
+// CHECK: Section {{.*}} .rela.text {
// CHECK-NEXT: 0x{{[^ ]+}} R_X86_64_32S .text 0x{{[^ ]+}}
// CHECK-NEXT: }
// CHECK-NEXT: ]
diff --git a/llvm/test/MC/ELF/merge.s b/llvm/test/MC/ELF/merge.s
index d6e0b7c..e787728 100644
--- a/llvm/test/MC/ELF/merge.s
+++ b/llvm/test/MC/ELF/merge.s
@@ -21,7 +21,7 @@
foo:
// CHECK: Relocations [
-// CHECK-NEXT: Section (2) .rela.text {
+// CHECK-NEXT: Section {{.*}} .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/llvm/test/MC/ELF/relocation-386.s b/llvm/test/MC/ELF/relocation-386.s
index b998ea5..2af6add 100644
--- a/llvm/test/MC/ELF/relocation-386.s
+++ b/llvm/test/MC/ELF/relocation-386.s
@@ -4,7 +4,7 @@
// correctly point to the section or the symbol.
// CHECK: Relocations [
-// CHECK-NEXT: Section (2) .rel.text {
+// CHECK-NEXT: Section {{.*}} .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
@@ -79,7 +79,7 @@
// CHECK-NEXT: Binding: Local
// CHECK-NEXT: Type: TLS
// CHECK-NEXT: Other: 0
-// CHECK-NEXT: Section: zedsec (0x5)
+// CHECK-NEXT: Section: zedsec
// CHECK-NEXT: }
// Symbol 7 is section 4
// CHECK: Symbol {
@@ -89,7 +89,7 @@
// CHECK-NEXT: Binding: Local
// CHECK-NEXT: Type: Section
// CHECK-NEXT: Other: 0
-// CHECK-NEXT: Section: .bss (0x4)
+// CHECK-NEXT: Section: .bss
// CHECK-NEXT: }
.text
diff --git a/llvm/test/MC/ELF/relocation-pc.s b/llvm/test/MC/ELF/relocation-pc.s
index dc60c1a..a8783a7 100644
--- a/llvm/test/MC/ELF/relocation-pc.s
+++ b/llvm/test/MC/ELF/relocation-pc.s
@@ -13,8 +13,8 @@
// CHECK-NEXT: }
// CHECK: Section {
-// CHECK: Index: 2
-// CHECK-NEXT: Name: .rela.text
+// CHECK: Index:
+// CHECK: Name: .rela.text
// CHECK-NEXT: Type: SHT_RELA
// CHECK-NEXT: Flags [
// CHECK-NEXT: ]
diff --git a/llvm/test/MC/ELF/rename.s b/llvm/test/MC/ELF/rename.s
index 7031c01..a7f9638 100644
--- a/llvm/test/MC/ELF/rename.s
+++ b/llvm/test/MC/ELF/rename.s
@@ -15,28 +15,9 @@
.global defined1
-// Section 1 is .text
// CHECK: Section {
-// CHECK: Index: 1
-// CHECK-NEXT: Name: .text
-// CHECK-NEXT: Type: SHT_PROGBITS
-// CHECK-NEXT: Flags [
-// CHECK-NEXT: SHF_ALLOC
-// CHECK-NEXT: SHF_EXECINSTR
-// CHECK-NEXT: ]
-// CHECK-NEXT: Address: 0x0
-// CHECK-NEXT: Offset: 0x40
-// CHECK-NEXT: Size: 4
-// CHECK-NEXT: Link: 0
-// CHECK-NEXT: Info: 0
-// 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: Index:
+// CHECK: Name: .rela.text
// CHECK-NEXT: Type: SHT_RELA (0x4)
// CHECK-NEXT: Flags [ (0x0)
// CHECK-NEXT: ]
@@ -51,15 +32,3 @@
// CHECK-NEXT: 0x0 R_X86_64_32 .text 0x0
// CHECK-NEXT: ]
// CHECK-NEXT: }
-
-
-// Symbol 2 is section 1
-// CHECK: Symbol {
-// CHECK: Name: .text (0)
-// CHECK-NEXT: Value: 0x0
-// CHECK-NEXT: Size: 0
-// CHECK-NEXT: Binding: Local
-// CHECK-NEXT: Type: Section
-// CHECK-NEXT: Other: 0
-// CHECK-NEXT: Section: .text (0x1)
-// CHECK-NEXT: }
diff --git a/llvm/test/MC/ELF/section-sym2.s b/llvm/test/MC/ELF/section-sym2.s
index acdb7d9..f62e3f9 100644
--- a/llvm/test/MC/ELF/section-sym2.s
+++ b/llvm/test/MC/ELF/section-sym2.s
@@ -6,7 +6,7 @@
.section .rodata
// CHECK:Relocations [
-// CHECK: Section (2) .rela.text {
+// CHECK: Section {{.*}} .rela.text {
// CHECK: Relocation {
// CHECK: Offset: 0x4
// CHECK: Type: R_X86_64_32S (11)
diff --git a/llvm/test/MC/ELF/symver-msvc.s b/llvm/test/MC/ELF/symver-msvc.s
index d6730ca..a726ff3 100644
--- a/llvm/test/MC/ELF/symver-msvc.s
+++ b/llvm/test/MC/ELF/symver-msvc.s
@@ -11,7 +11,7 @@
// CHECK: Relocations [
-// CHECK-NEXT: Section (2) .rela.text {
+// CHECK-NEXT: Section {{.*}} .rela.text {
// CHECK-NEXT: 0x0 R_X86_64_32 ??_R0?AVexception@std@@@8 0x0
// CHECK-NEXT: 0x4 R_X86_64_32 @??_R0?AVinvalid_argument@std@@@8 0x0
// CHECK-NEXT: 0x8 R_X86_64_32 __imp_??_R0?AVlogic_error@std@@@8 0x0
diff --git a/llvm/test/MC/ELF/symver.s b/llvm/test/MC/ELF/symver.s
index 6e5825f..80d71fd 100644
--- a/llvm/test/MC/ELF/symver.s
+++ b/llvm/test/MC/ELF/symver.s
@@ -22,7 +22,7 @@
global1:
// CHECK: Relocations [
-// CHECK-NEXT: Section (2) .rela.text {
+// CHECK-NEXT: Section {{.*}} .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/llvm/test/MC/ELF/tls.s b/llvm/test/MC/ELF/tls.s
index 79865cd..940827b 100644
--- a/llvm/test/MC/ELF/tls.s
+++ b/llvm/test/MC/ELF/tls.s
@@ -19,7 +19,7 @@
// CHECK-NEXT: Binding: Local
// CHECK-NEXT: Type: TLS
// CHECK-NEXT: Other: 0
-// CHECK-NEXT: Section: .zed (0x5)
+// CHECK-NEXT: Section: .zed
// CHECK-NEXT: }
// CHECK: Symbol {
diff --git a/llvm/test/MC/ELF/weakref.s b/llvm/test/MC/ELF/weakref.s
index 2288264..9485e49 100644
--- a/llvm/test/MC/ELF/weakref.s
+++ b/llvm/test/MC/ELF/weakref.s
@@ -131,7 +131,7 @@
// CHECK-NEXT: Binding: Local
// CHECK-NEXT: Type: Section
// CHECK-NEXT: Other: 0
-// CHECK-NEXT: Section: .data (0x3)
+// CHECK-NEXT: Section: .data
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
// CHECK-NEXT: Name: .bss
@@ -140,7 +140,7 @@
// CHECK-NEXT: Binding: Local
// CHECK-NEXT: Type: Section
// CHECK-NEXT: Other: 0
-// CHECK-NEXT: Section: .bss (0x4)
+// CHECK-NEXT: Section: .bss
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
// CHECK-NEXT: Name: bar10