diff --git a/lld/test/ELF/aarch64-variant_pcs.s b/lld/test/ELF/aarch64-variant_pcs.s index b7f1efc16d6c..1aef62d5aaa2 100644 --- a/lld/test/ELF/aarch64-variant_pcs.s +++ b/lld/test/ELF/aarch64-variant_pcs.s @@ -49,7 +49,7 @@ # T5-PCSSYM: Symbol table '.symtab' contains 10 entries: # T5-PCSSYM: 0 NOTYPE LOCAL DEFAULT [VARIANT_PCS] [[#]] pcs_func_local # T5-PCSSYM-NEXT: 0 IFUNC LOCAL DEFAULT [VARIANT_PCS] [[#]] pcs_ifunc_local -# T5-PCSSYM-NEXT: 0 NOTYPE LOCAL HIDDEN [VARIANT_PCS] [[#]] pcs_func_global_hidden +# T5-PCSSYM: 0 NOTYPE LOCAL HIDDEN [VARIANT_PCS] [[#]] pcs_func_global_hidden # T5-PCSSYM-NEXT: 0 IFUNC LOCAL HIDDEN [VARIANT_PCS] [[#]] pcs_ifunc_global_hidden # T5-PCSSYM: 0 NOTYPE GLOBAL DEFAULT [VARIANT_PCS] [[#]] pcs_func_global_def # T5-PCSSYM-NEXT: 0 NOTYPE GLOBAL DEFAULT [VARIANT_PCS] UND pcs_func_global_undef diff --git a/lld/test/ELF/cgprofile-bad-clusters.s b/lld/test/ELF/cgprofile-bad-clusters.s index da159d2e166e..c162e981acdd 100644 --- a/lld/test/ELF/cgprofile-bad-clusters.s +++ b/lld/test/ELF/cgprofile-bad-clusters.s @@ -50,14 +50,14 @@ H: I: .fill 13, 1, 0 -# CHECK: Name: B -# CHECK-NEXT: Value: 0x201131 -# CHECK: Name: C -# CHECK-NEXT: Value: 0x20112F # CHECK: Name: D # CHECK-NEXT: Value: 0x201519 # CHECK: Name: E # CHECK-NEXT: Value: 0x201130 +# CHECK: Name: C +# CHECK-NEXT: Value: 0x20112F +# CHECK: Name: B +# CHECK-NEXT: Value: 0x201131 # CHECK: Name: F # CHECK-NEXT: Value: 0x201901 # CHECK: Name: G diff --git a/lld/test/ELF/discard-none.s b/lld/test/ELF/discard-none.s index fb5b66a5e977..1ddc42b33d13 100644 --- a/lld/test/ELF/discard-none.s +++ b/lld/test/ELF/discard-none.s @@ -20,8 +20,8 @@ // CHECK-NEXT: AddressAlignment: // CHECK-NEXT: EntrySize: // CHECK-NEXT: SectionData ( -// CHECK-NEXT: 0000: 002E4C6D 796F7468 65727661 72002E4C |..Lmyothervar..L| -// CHECK-NEXT: 0010: 6D797661 72005F44 594E414D 494300 |myvar._DYNAMIC.| +// CHECK-NEXT: 0000: 002E4C6D 79766172 002E4C6D 796F7468 |..Lmyvar..Lmyoth| +// CHECK-NEXT: 0010: 65727661 72005F44 594E414D 494300 |ervar._DYNAMIC.| // CHECK-NEXT: ) // CHECK-NEXT: } @@ -35,15 +35,6 @@ // CHECK-NEXT: Section: Undefined // CHECK-NEXT: } // CHECK-NEXT: Symbol { -// CHECK-NEXT: Name: .Lmyothervar -// CHECK-NEXT: Value: -// CHECK-NEXT: Size: 0 -// CHECK-NEXT: Binding: Local -// CHECK-NEXT: Type: None -// CHECK-NEXT: Other: 0 -// CHECK-NEXT: Section: .text -// CHECK-NEXT: } -// CHECK-NEXT: Symbol { // CHECK-NEXT: Name: .Lmyvar // CHECK-NEXT: Value: // CHECK-NEXT: Size: 0 @@ -52,3 +43,12 @@ // CHECK-NEXT: Other: 0 // CHECK-NEXT: Section: .text // CHECK-NEXT: } +// CHECK-NEXT: Symbol { +// CHECK-NEXT: Name: .Lmyothervar +// CHECK-NEXT: Value: +// CHECK-NEXT: Size: 0 +// CHECK-NEXT: Binding: Local +// CHECK-NEXT: Type: None +// CHECK-NEXT: Other: 0 +// CHECK-NEXT: Section: .text +// CHECK-NEXT: } diff --git a/lld/test/ELF/emit-relocs-discard-locals.s b/lld/test/ELF/emit-relocs-discard-locals.s index baf31503a67d..c9841a6fb518 100644 --- a/lld/test/ELF/emit-relocs-discard-locals.s +++ b/lld/test/ELF/emit-relocs-discard-locals.s @@ -27,9 +27,9 @@ ## --discard-locals removes unused local symbols which start with ".L" # DISCARD-LOCALS: 0: {{0+}} 0 NOTYPE LOCAL DEFAULT UND # DISCARD-LOCALS-NEXT: NOTYPE LOCAL DEFAULT {{.*}} .Lused +# DISCARD-LOCALS-NEXT: NOTYPE LOCAL DEFAULT {{.*}} used # DISCARD-LOCALS-NEXT: NOTYPE LOCAL DEFAULT {{.*}} unused # DISCARD-LOCALS-NOGC-NEXT: NOTYPE LOCAL DEFAULT {{.*}} unused_gc -# DISCARD-LOCALS-NEXT: NOTYPE LOCAL DEFAULT {{.*}} used # DISCARD-LOCALS-NEXT: SECTION LOCAL DEFAULT {{.*}} .text # DISCARD-LOCALS-NEXT: SECTION LOCAL DEFAULT {{.*}} text # DISCARD-LOCALS-NOGC-NEXT: SECTION LOCAL DEFAULT {{.*}} gc diff --git a/lld/test/ELF/local.s b/lld/test/ELF/local.s index 4567b7b34a2f..f33afc74a984 100644 --- a/lld/test/ELF/local.s +++ b/lld/test/ELF/local.s @@ -27,24 +27,6 @@ // CHECK-NEXT: Section: Undefined // CHECK-NEXT: } // CHECK-NEXT: Symbol { -// CHECK-NEXT: Name: .Labs -// CHECK-NEXT: Value: -// CHECK-NEXT: Size: 0 -// CHECK-NEXT: Binding: Local -// CHECK-NEXT: Type: None -// CHECK-NEXT: Other: 0 -// CHECK-NEXT: Section: Absolute -// CHECK-NEXT: } -// CHECK-NEXT: Symbol { -// CHECK-NEXT: Name: abs -// CHECK-NEXT: Value: -// CHECK-NEXT: Size: 0 -// CHECK-NEXT: Binding: Local -// CHECK-NEXT: Type: None -// CHECK-NEXT: Other: 0 -// CHECK-NEXT: Section: Absolute -// CHECK-NEXT: } -// CHECK-NEXT: Symbol { // CHECK-NEXT: Name: blah // CHECK-NEXT: Value: // CHECK-NEXT: Size: 0 @@ -72,6 +54,24 @@ // CHECK-NEXT: Section: .text // CHECK-NEXT: } // CHECK-NEXT: Symbol { +// CHECK-NEXT: Name: abs +// CHECK-NEXT: Value: +// CHECK-NEXT: Size: 0 +// CHECK-NEXT: Binding: Local +// CHECK-NEXT: Type: None +// CHECK-NEXT: Other: 0 +// CHECK-NEXT: Section: Absolute +// CHECK-NEXT: } +// CHECK-NEXT: Symbol { +// CHECK-NEXT: Name: .Labs +// CHECK-NEXT: Value: +// CHECK-NEXT: Size: 0 +// CHECK-NEXT: Binding: Local +// CHECK-NEXT: Type: None +// CHECK-NEXT: Other: 0 +// CHECK-NEXT: Section: Absolute +// CHECK-NEXT: } +// CHECK-NEXT: Symbol { // CHECK-NEXT: Name: _start // CHECK-NEXT: Value: // CHECK-NEXT: Size: 0 diff --git a/lld/test/ELF/merge-string.s b/lld/test/ELF/merge-string.s index fa5bd5ad4bcd..ac8f1d4b206e 100644 --- a/lld/test/ELF/merge-string.s +++ b/lld/test/ELF/merge-string.s @@ -94,12 +94,12 @@ zed: // CHECK-NEXT: ) -// CHECK: Name: bar -// CHECK-NEXT: Value: 0x20E - // CHECK: Name: foo // CHECK-NEXT: Value: 0x20D +// CHECK: Name: bar +// CHECK-NEXT: Value: 0x20E + // CHECK: Name: zed // CHECK-NEXT: Value: 0x212 // CHECK-NEXT: Size: 0 diff --git a/lld/test/ELF/mips-64-disp.s b/lld/test/ELF/mips-64-disp.s index 9c5e6d2eb186..98d8c1b4fe94 100644 --- a/lld/test/ELF/mips-64-disp.s +++ b/lld/test/ELF/mips-64-disp.s @@ -23,10 +23,10 @@ # CHECK-NEXT: {{.*}}: addiu $2, $2, -32712 # GOT: Symbol table '.symtab' -# GOT: {{.*}} [[B12:[0-9a-f]+]] {{.*}} b12 # GOT: {{.*}} [[B04:[0-9a-f]+]] {{.*}} b4 -# GOT: {{.*}} [[B08:[0-9a-f]+]] {{.*}} b8 # GOT: {{.*}} [[FOO:[0-9a-f]+]] {{.*}} foo +# GOT: {{.*}} [[B08:[0-9a-f]+]] {{.*}} b8 +# GOT: {{.*}} [[B12:[0-9a-f]+]] {{.*}} b12 # GOT: Primary GOT: # GOT-NEXT: Canonical gp value: diff --git a/lld/test/ELF/mips-got-page.s b/lld/test/ELF/mips-got-page.s index 62de3c963763..efb73f11c1e3 100644 --- a/lld/test/ELF/mips-got-page.s +++ b/lld/test/ELF/mips-got-page.s @@ -7,14 +7,14 @@ # RUN: ld.lld --section-start .rodata=0x27FFC -shared -o %t.so %t.o # RUN: llvm-readobj --symbols -A %t.so | FileCheck %s -# CHECK: Name: bar -# CHECK-NEXT: Value: 0x28000 -# ^ page-address = (0x28000 + 0x8000) & ~0xffff = 0x30000 - # CHECK: Name: foo # CHECK-NEXT: Value: 0x27FFC # ^ page-address = (0x27ffc + 0x8000) & ~0xffff = 0x20000 +# CHECK: Name: bar +# CHECK-NEXT: Value: 0x28000 +# ^ page-address = (0x28000 + 0x8000) & ~0xffff = 0x30000 + # CHECK: Local entries [ # CHECK-NEXT: Entry { # CHECK-NEXT: Address: diff --git a/lld/test/ELF/mips-gprel32-relocs.s b/lld/test/ELF/mips-gprel32-relocs.s index e11bf334a69b..82c361d1f010 100644 --- a/lld/test/ELF/mips-gprel32-relocs.s +++ b/lld/test/ELF/mips-gprel32-relocs.s @@ -24,8 +24,8 @@ v1: .gpword bar # CHECK: SYMBOL TABLE: -# CHECK: 00020008 l .text 00000000 bar # CHECK: 00020004 l .text 00000000 foo +# CHECK: 00020008 l .text 00000000 bar # CHECK: 00028000 l .got 00000000 .hidden _gp # CHECK: Contents of section .rodata: diff --git a/lld/test/ELF/ppc64-pcrel-call-to-pcrel.s b/lld/test/ELF/ppc64-pcrel-call-to-pcrel.s index 3b0d9e31fb7b..9d3c8ee7ce88 100644 --- a/lld/test/ELF/ppc64-pcrel-call-to-pcrel.s +++ b/lld/test/ELF/ppc64-pcrel-call-to-pcrel.s @@ -29,19 +29,19 @@ # RUN: llvm-objdump -d --no-show-raw-insn --mcpu=pwr10 %t | FileCheck %s # SYMBOL: 2: 0000000010010000 0 NOTYPE LOCAL DEFAULT 5 callee1_stother0_default -# SYMBOL-NEXT: 3: 0000000010020004 0 NOTYPE LOCAL DEFAULT [] 6 callee2_stother1_default -# SYMBOL-NEXT: 4: 0000000010010004 0 NOTYPE LOCAL DEFAULT [] 5 caller1 -# SYMBOL-NEXT: 5: 000000001002000c 0 NOTYPE LOCAL DEFAULT [] 6 caller2 -# SYMBOL-NEXT: 6: 0000000010030000 0 NOTYPE LOCAL DEFAULT [] 7 caller3 -# SYMBOL-NEXT: 7: 0000000010040000 0 NOTYPE LOCAL DEFAULT [] 8 caller4 -# SYMBOL-NEXT: 8: 0000000010020000 0 NOTYPE LOCAL DEFAULT 6 func_local +# SYMBOL-NEXT: 3: 0000000010010004 0 NOTYPE LOCAL DEFAULT [] 5 caller1 +# SYMBOL-NEXT: 4: 0000000010020000 0 NOTYPE LOCAL DEFAULT 6 func_local +# SYMBOL-NEXT: 5: 0000000010020004 0 NOTYPE LOCAL DEFAULT [] 6 callee2_stother1_default +# SYMBOL-NEXT: 6: 000000001002000c 0 NOTYPE LOCAL DEFAULT [] 6 caller2 +# SYMBOL-NEXT: 7: 0000000010030000 0 NOTYPE LOCAL DEFAULT [] 7 caller3 +# SYMBOL-NEXT: 8: 0000000010040000 0 NOTYPE LOCAL DEFAULT [] 8 caller4 # SYMBOL-NEXT: 9: 0000000010040008 0 NOTYPE LOCAL DEFAULT 9 func_extern # SYMBOL-NEXT: 10: 000000001004000c 0 NOTYPE LOCAL HIDDEN 9 callee3_stother0_hidden # SYMBOL-NEXT: 11: 0000000010040010 0 NOTYPE LOCAL HIDDEN [] 9 callee4_stother1_hidden # SYMBOL-GLOBAL: 2: 0000000010010004 0 NOTYPE LOCAL DEFAULT [] 1 caller1 -# SYMBOL-GLOBAL-NEXT: 3: 000000001002000c 0 NOTYPE LOCAL DEFAULT [] 2 caller2 -# SYMBOL-GLOBAL-NEXT: 4: 0000000010020000 0 NOTYPE LOCAL DEFAULT 2 func_local +# SYMBOL-GLOBAL-NEXT: 3: 0000000010020000 0 NOTYPE LOCAL DEFAULT 2 func_local +# SYMBOL-GLOBAL-NEXT: 4: 000000001002000c 0 NOTYPE LOCAL DEFAULT [] 2 caller2 # SYMBOL-GLOBAL-NEXT: 5: 0000000010010000 0 NOTYPE GLOBAL DEFAULT 1 callee1_stother0_default # SYMBOL-GLOBAL-NEXT: 6: 0000000010020004 0 NOTYPE GLOBAL DEFAULT [] 2 callee2_stother1_default diff --git a/lld/test/ELF/ppc64-pcrel-call-to-toc.s b/lld/test/ELF/ppc64-pcrel-call-to-toc.s index f7463f2daffd..8b61bf4827ba 100644 --- a/lld/test/ELF/ppc64-pcrel-call-to-toc.s +++ b/lld/test/ELF/ppc64-pcrel-call-to-toc.s @@ -18,9 +18,9 @@ ## When a function without TOC accesses a function using TOC, an r12 setup stub ## is inserted -# SYMBOL: 1: 0000000010020000 0 NOTYPE LOCAL DEFAULT [] 2 callee -# SYMBOL-NEXT: 2: 0000000010030000 0 NOTYPE LOCAL DEFAULT [] 3 caller -# SYMBOL-NEXT: 3: 0000000010010000 0 NOTYPE LOCAL DEFAULT 1 func +# SYMBOL: 1: 0000000010010000 0 NOTYPE LOCAL DEFAULT 1 func +# SYMBOL-NEXT: 2: 0000000010020000 0 NOTYPE LOCAL DEFAULT [] 2 callee +# SYMBOL: 4: 0000000010030000 0 NOTYPE LOCAL DEFAULT [] 3 caller # SYMBOL: 6: 0000000010030010 16 FUNC LOCAL DEFAULT 3 __gep_setup_callee # CHECK-LABEL: : diff --git a/lld/test/ELF/ppc64-tls-pcrel-ld.s b/lld/test/ELF/ppc64-tls-pcrel-ld.s index 811a6c20d8ab..33ddece4baab 100644 --- a/lld/test/ELF/ppc64-tls-pcrel-ld.s +++ b/lld/test/ELF/ppc64-tls-pcrel-ld.s @@ -22,8 +22,8 @@ # LD-RELOC: 0000000001004168 0000000000000044 R_PPC64_DTPMOD64 0 # LD-SYM: Symbol table '.symtab' contains 11 entries: -# LD-SYM: 5: 0000000000000000 0 TLS LOCAL DEFAULT 13 x -# LD-SYM-NEXT: 6: 0000000000000004 0 TLS LOCAL DEFAULT 13 y +# LD-SYM: 0000000000000000 0 TLS LOCAL DEFAULT 13 x +# LD-SYM: 0000000000000004 0 TLS LOCAL DEFAULT 13 y # LD-GOT: section '.got': # LD-GOT-NEXT: 0x01004160 60c10001 00000000 00000000 00000000 @@ -32,8 +32,8 @@ # LDTOLE-RELOC: There are no relocations in this file. # LDTOLE-SYM: Symbol table '.symtab' contains 9 entries: -# LDTOLE-SYM: 5: 0000000000000000 0 TLS LOCAL DEFAULT 6 x -# LDTOLE-SYM-NEXT: 6: 0000000000000004 0 TLS LOCAL DEFAULT 6 y +# LDTOLE-SYM: 0000000000000000 0 TLS LOCAL DEFAULT 6 x +# LDTOLE-SYM: 0000000000000004 0 TLS LOCAL DEFAULT 6 y # LDTOLE-GOT: section '.got': # LDTOLE-GOT-NEXT: 0x01004020 20c00001 00000000 diff --git a/lld/test/ELF/ppc64-tls-pcrel-le.s b/lld/test/ELF/ppc64-tls-pcrel-le.s index bff7d075eda4..683a3260c1e5 100644 --- a/lld/test/ELF/ppc64-tls-pcrel-le.s +++ b/lld/test/ELF/ppc64-tls-pcrel-le.s @@ -13,9 +13,9 @@ ## when using prefixed instructions like paddi. # SYMBOL: Symbol table '.symtab' contains 6 entries: -# SYMBOL: 3: 0000000000000000 0 TLS LOCAL DEFAULT 2 x -# SYMBOL-NEXT: 4: 0000000000000004 0 TLS LOCAL DEFAULT 2 y -# SYMBOL-NEXT: 5: 0000000000000008 0 TLS LOCAL DEFAULT 2 z +# SYMBOL: 0000000000000000 0 TLS LOCAL DEFAULT 2 x +# SYMBOL-NEXT: 0000000000000004 0 TLS LOCAL DEFAULT 2 y +# SYMBOL-NEXT: 0000000000000008 0 TLS LOCAL DEFAULT 2 z # CHECK-LABEL: : # CHECK: paddi 3, 13, -28672, 0 diff --git a/lld/test/ELF/ppc64-toc-call-to-pcrel-long-jump.s b/lld/test/ELF/ppc64-toc-call-to-pcrel-long-jump.s index 5f03ab13dfb4..0cd8fd15fbaa 100644 --- a/lld/test/ELF/ppc64-toc-call-to-pcrel-long-jump.s +++ b/lld/test/ELF/ppc64-toc-call-to-pcrel-long-jump.s @@ -13,8 +13,8 @@ # SYM: Symbol table '.symtab' contains 9 entries: # SYM: 1: 0000000010010000 0 NOTYPE LOCAL DEFAULT [] 1 callee -# SYM-NEXT: 2: 0000000020020008 0 NOTYPE LOCAL DEFAULT [] 3 caller -# SYM-NEXT: 3: 0000000010020008 0 NOTYPE LOCAL DEFAULT 2 caller_close +# SYM-NEXT: 2: 0000000010020008 0 NOTYPE LOCAL DEFAULT 2 caller_close +# SYM-NEXT: 3: 0000000020020008 0 NOTYPE LOCAL DEFAULT [] 3 caller # SYM-NEXT: 4: 0000000520020008 0 NOTYPE LOCAL DEFAULT 4 caller_far # SYM-NEXT: 5: 0000000520028038 0 NOTYPE LOCAL HIDDEN 6 .TOC. # SYM-NEXT: 6: 0000000010020020 8 FUNC LOCAL DEFAULT 2 __toc_save_callee diff --git a/lld/test/ELF/relocatable-discard-locals.s b/lld/test/ELF/relocatable-discard-locals.s index 298590def5f1..7f9640ceca19 100644 --- a/lld/test/ELF/relocatable-discard-locals.s +++ b/lld/test/ELF/relocatable-discard-locals.s @@ -15,9 +15,9 @@ ## --discard-locals removes unused local symbols which start with ".L" # DISCARD-LOCALS: 0: {{0+}} 0 NOTYPE LOCAL DEFAULT UND # DISCARD-LOCALS-NEXT: NOTYPE LOCAL DEFAULT {{.*}} .Lused +# DISCARD-LOCALS-NEXT: NOTYPE LOCAL DEFAULT {{.*}} used # DISCARD-LOCALS-NEXT: NOTYPE LOCAL DEFAULT {{.*}} unused # DISCARD-LOCALS-NEXT: NOTYPE LOCAL DEFAULT {{.*}} unused_gc -# DISCARD-LOCALS-NEXT: NOTYPE LOCAL DEFAULT {{.*}} used # DISCARD-LOCALS-NEXT: SECTION LOCAL DEFAULT {{.*}} .text # DISCARD-LOCALS-NEXT: SECTION LOCAL DEFAULT {{.*}} text # DISCARD-LOCALS-NEXT: SECTION LOCAL DEFAULT {{.*}} gc diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp index 69307b617552..74eb7b64c8a4 100644 --- a/llvm/lib/MC/ELFObjectWriter.cpp +++ b/llvm/lib/MC/ELFObjectWriter.cpp @@ -730,7 +730,7 @@ void ELFWriter::computeSymbolTable( ELF::SHN_ABS, true); // Symbols are required to be in lexicographic order. - array_pod_sort(LocalSymbolData.begin(), LocalSymbolData.end()); + //array_pod_sort(LocalSymbolData.begin(), LocalSymbolData.end()); array_pod_sort(ExternalSymbolData.begin(), ExternalSymbolData.end()); // Set the symbol indices. Local symbols must come before all other diff --git a/llvm/test/MC/AArch64/mapping-across-sections.s b/llvm/test/MC/AArch64/mapping-across-sections.s index ceb05dc13f90..053deb760dcf 100644 --- a/llvm/test/MC/AArch64/mapping-across-sections.s +++ b/llvm/test/MC/AArch64/mapping-across-sections.s @@ -21,8 +21,8 @@ // + .starts_data to have $d at 0 -// CHECK: 0000000000000000 l .starts_data 0000000000000000 $d -// CHECK-NEXT: 0000000000000000 l .text 0000000000000000 $x +// CHECK: 0000000000000000 l .text 0000000000000000 $x // CHECK-NEXT: 0000000000000000 l .wibble 0000000000000000 $x +// CHECK-NEXT: 0000000000000000 l .starts_data 0000000000000000 $d // CHECK-NOT: ${{[adtx]}} diff --git a/llvm/test/MC/AMDGPU/hsa-gfx10-v3.s b/llvm/test/MC/AMDGPU/hsa-gfx10-v3.s index 5df08e7c243d..dbf3c96023da 100644 --- a/llvm/test/MC/AMDGPU/hsa-gfx10-v3.s +++ b/llvm/test/MC/AMDGPU/hsa-gfx10-v3.s @@ -13,12 +13,12 @@ // READOBJ: 0000000000000090 {{[0-9a-f]+}}00000005 R_AMDGPU_REL64 0000000000000000 .text + 210 // READOBJ: Symbol table '.symtab' contains {{[0-9]+}} entries: -// READOBJ: {{[0-9]+}}: 0000000000000100 0 FUNC LOCAL PROTECTED 2 complete -// READOBJ: {{[0-9]+}}: 0000000000000040 64 OBJECT LOCAL DEFAULT 3 complete.kd -// READOBJ: {{[0-9]+}}: 0000000000000000 0 FUNC LOCAL PROTECTED 2 minimal -// READOBJ: {{[0-9]+}}: 0000000000000000 64 OBJECT LOCAL DEFAULT 3 minimal.kd -// READOBJ: {{[0-9]+}}: 0000000000000200 0 FUNC LOCAL PROTECTED 2 special_sgpr -// READOBJ: {{[0-9]+}}: 0000000000000080 64 OBJECT LOCAL DEFAULT 3 special_sgpr.kd +// READOBJ: 0000000000000000 0 FUNC LOCAL PROTECTED 2 minimal +// READOBJ-NEXT: 0000000000000100 0 FUNC LOCAL PROTECTED 2 complete +// READOBJ-NEXT: 0000000000000200 0 FUNC LOCAL PROTECTED 2 special_sgpr +// READOBJ-NEXT: 0000000000000000 64 OBJECT LOCAL DEFAULT 3 minimal.kd +// READOBJ-NEXT: 0000000000000040 64 OBJECT LOCAL DEFAULT 3 complete.kd +// READOBJ-NEXT: 0000000000000080 64 OBJECT LOCAL DEFAULT 3 special_sgpr.kd // OBJDUMP: Contents of section .rodata // Note, relocation for KERNEL_CODE_ENTRY_BYTE_OFFSET is not resolved here. diff --git a/llvm/test/MC/AMDGPU/hsa-gfx10.s b/llvm/test/MC/AMDGPU/hsa-gfx10.s index 5eb81ab2467c..938e48e6341e 100644 --- a/llvm/test/MC/AMDGPU/hsa-gfx10.s +++ b/llvm/test/MC/AMDGPU/hsa-gfx10.s @@ -18,12 +18,12 @@ // Windows and Linux because of carriage return on Windows // ELF: Symbol { -// ELF: Name: amd_kernel_code_t_minimal +// ELF: Name: amd_kernel_code_t_test_all // ELF: Type: AMDGPU_HSA_KERNEL (0xA) // ELF: Section: .text // ELF: } // ELF: Symbol { -// ELF: Name: amd_kernel_code_t_test_all +// ELF: Name: amd_kernel_code_t_minimal // ELF: Type: AMDGPU_HSA_KERNEL (0xA) // ELF: Section: .text // ELF: } diff --git a/llvm/test/MC/AMDGPU/hsa-v3.s b/llvm/test/MC/AMDGPU/hsa-v3.s index 380f9cfb6137..92c4d59a2e8d 100644 --- a/llvm/test/MC/AMDGPU/hsa-v3.s +++ b/llvm/test/MC/AMDGPU/hsa-v3.s @@ -14,14 +14,14 @@ // READOBJ: 00000000000000d0 {{[0-9a-f]+}}00000005 R_AMDGPU_REL64 0000000000000000 .text + 310 // READOBJ: Symbol table '.symtab' contains {{[0-9]+}} entries: -// READOBJ: {{[0-9]+}}: 0000000000000100 0 FUNC LOCAL PROTECTED 2 complete -// READOBJ: {{[0-9]+}}: 0000000000000040 64 OBJECT LOCAL DEFAULT 3 complete.kd -// READOBJ: {{[0-9]+}}: 0000000000000300 0 FUNC LOCAL PROTECTED 2 disabled_user_sgpr -// READOBJ: {{[0-9]+}}: 00000000000000c0 64 OBJECT LOCAL DEFAULT 3 disabled_user_sgpr.kd -// READOBJ: {{[0-9]+}}: 0000000000000000 0 FUNC LOCAL PROTECTED 2 minimal -// READOBJ: {{[0-9]+}}: 0000000000000000 64 OBJECT LOCAL DEFAULT 3 minimal.kd -// READOBJ: {{[0-9]+}}: 0000000000000200 0 FUNC LOCAL PROTECTED 2 special_sgpr -// READOBJ: {{[0-9]+}}: 0000000000000080 64 OBJECT LOCAL DEFAULT 3 special_sgpr.kd +// READOBJ: 0000000000000000 0 FUNC LOCAL PROTECTED 2 minimal +// READOBJ-NEXT: 0000000000000100 0 FUNC LOCAL PROTECTED 2 complete +// READOBJ-NEXT: 0000000000000200 0 FUNC LOCAL PROTECTED 2 special_sgpr +// READOBJ-NEXT: 0000000000000300 0 FUNC LOCAL PROTECTED 2 disabled_user_sgpr +// READOBJ-NEXT: 0000000000000000 64 OBJECT LOCAL DEFAULT 3 minimal.kd +// READOBJ-NEXT: 0000000000000040 64 OBJECT LOCAL DEFAULT 3 complete.kd +// READOBJ-NEXT: 0000000000000080 64 OBJECT LOCAL DEFAULT 3 special_sgpr.kd +// READOBJ-NEXT: 00000000000000c0 64 OBJECT LOCAL DEFAULT 3 disabled_user_sgpr.kd // OBJDUMP: Contents of section .rodata // Note, relocation for KERNEL_CODE_ENTRY_BYTE_OFFSET is not resolved here. diff --git a/llvm/test/MC/AMDGPU/hsa.s b/llvm/test/MC/AMDGPU/hsa.s index ceddbc678e65..12160e879324 100644 --- a/llvm/test/MC/AMDGPU/hsa.s +++ b/llvm/test/MC/AMDGPU/hsa.s @@ -18,12 +18,12 @@ // Windows and Linux because of carriage return on Windows // ELF: Symbol { -// ELF: Name: amd_kernel_code_t_minimal +// ELF: Name: amd_kernel_code_t_test_all // ELF: Type: AMDGPU_HSA_KERNEL (0xA) // ELF: Section: .text // ELF: } // ELF: Symbol { -// ELF: Name: amd_kernel_code_t_test_all +// ELF: Name: amd_kernel_code_t_minimal // ELF: Type: AMDGPU_HSA_KERNEL (0xA) // ELF: Section: .text // ELF: } diff --git a/llvm/test/MC/ARM/arm-elf-symver.s b/llvm/test/MC/ARM/arm-elf-symver.s index 24b19dcdc3d9..e49a7d7de7a7 100644 --- a/llvm/test/MC/ARM/arm-elf-symver.s +++ b/llvm/test/MC/ARM/arm-elf-symver.s @@ -32,6 +32,34 @@ global1: @ CHECK-NEXT: } @ CHECK-NEXT: ] +@ CHECK: Symbol { +@ CHECK: Symbol { +@ CHECK-NEXT: Name: .text (0) +@ CHECK-NEXT: Value: 0x0 +@ CHECK-NEXT: Size: 0 +@ CHECK-NEXT: Binding: Local (0x0) +@ CHECK-NEXT: Type: Section (0x3) +@ CHECK-NEXT: Other: 0 +@ CHECK-NEXT: Section: .text +@ CHECK-NEXT: } +@ CHECK-NEXT: Symbol { +@ CHECK-NEXT: Name: defined1 +@ CHECK-NEXT: Value: 0x0 +@ CHECK-NEXT: Size: 0 +@ CHECK-NEXT: Binding: Local (0x0) +@ CHECK-NEXT: Type: None (0x0) +@ CHECK-NEXT: Other: 0 +@ CHECK-NEXT: Section: .text +@ CHECK-NEXT: } +@ CHECK-NEXT: Symbol { +@ CHECK-NEXT: Name: defined2 +@ CHECK-NEXT: Value: 0x0 +@ CHECK-NEXT: Size: 0 +@ CHECK-NEXT: Binding: Local (0x0) +@ CHECK-NEXT: Type: None (0x0) +@ CHECK-NEXT: Other: 0 +@ CHECK-NEXT: Section: .text +@ CHECK-NEXT: } @ CHECK: Symbol { @ CHECK: Name: bar1@zed @ CHECK-NEXT: Value: 0x0 @@ -60,33 +88,6 @@ global1: @ CHECK-NEXT: Section: .text @ CHECK-NEXT: } @ CHECK-NEXT: Symbol { -@ CHECK-NEXT: Name: defined1 -@ CHECK-NEXT: Value: 0x0 -@ CHECK-NEXT: Size: 0 -@ CHECK-NEXT: Binding: Local (0x0) -@ CHECK-NEXT: Type: None (0x0) -@ CHECK-NEXT: Other: 0 -@ CHECK-NEXT: Section: .text -@ CHECK-NEXT: } -@ CHECK-NEXT: Symbol { -@ CHECK-NEXT: Name: defined2 -@ CHECK-NEXT: Value: 0x0 -@ CHECK-NEXT: Size: 0 -@ CHECK-NEXT: Binding: Local (0x0) -@ CHECK-NEXT: Type: None (0x0) -@ CHECK-NEXT: Other: 0 -@ CHECK-NEXT: Section: .text -@ CHECK-NEXT: } -@ CHECK-NEXT: Symbol { -@ CHECK-NEXT: Name: .text (0) -@ CHECK-NEXT: Value: 0x0 -@ CHECK-NEXT: Size: 0 -@ CHECK-NEXT: Binding: Local (0x0) -@ CHECK-NEXT: Type: Section (0x3) -@ CHECK-NEXT: Other: 0 -@ CHECK-NEXT: Section: .text -@ CHECK-NEXT: } -@ CHECK-NEXT: Symbol { @ CHECK-NEXT: Name: bar2@zed @ CHECK-NEXT: Value: 0x0 @ CHECK-NEXT: Size: 0 diff --git a/llvm/test/MC/ARM/data-in-code.ll b/llvm/test/MC/ARM/data-in-code.ll index dcd3947f7e0c..e863640bda75 100644 --- a/llvm/test/MC/ARM/data-in-code.ll +++ b/llvm/test/MC/ARM/data-in-code.ll @@ -43,7 +43,7 @@ exit: ;; ARM-NEXT: Section: [[MIXED_SECT:[^ ]+]] ;; ARM: Symbol { -;; ARM: Name: $a +;; ARM: Name: $d ;; ARM-NEXT: Value: 0x{{[0-9A-F]+}} ;; ARM-NEXT: Size: 0 ;; ARM-NEXT: Binding: Local @@ -52,7 +52,7 @@ exit: ;; ARM-NEXT: Section: [[MIXED_SECT]] ;; ARM: Symbol { -;; ARM: Name: $d +;; ARM: Name: $a ;; ARM-NEXT: Value: 0x{{[0-9A-F]+}} ;; ARM-NEXT: Size: 0 ;; ARM-NEXT: Binding: Local @@ -63,8 +63,8 @@ exit: ;; ARM-NOT: ${{[atd]}} ;; TMB: Symbol { -;; TMB: Name: $d.1 -;; TMB-NEXT: Value: 0x{{[0-9A-F]+}} +;; TMB: Name: $t +;; TMB-NEXT: Value: 0x0 ;; TMB-NEXT: Size: 0 ;; TMB-NEXT: Binding: Local ;; TMB-NEXT: Type: None @@ -72,8 +72,8 @@ exit: ;; TMB-NEXT: Section: [[MIXED_SECT:[^ ]+]] ;; TMB: Symbol { -;; TMB: Name: $t -;; TMB-NEXT: Value: 0x0 +;; TMB: Name: $d.1 +;; TMB-NEXT: Value: 0x{{[0-9A-F]+}} ;; TMB-NEXT: Size: 0 ;; TMB-NEXT: Binding: Local ;; TMB-NEXT: Type: None diff --git a/llvm/test/MC/ARM/mapping-within-section.s b/llvm/test/MC/ARM/mapping-within-section.s index 9c594fcf9054..1f15def4eafa 100644 --- a/llvm/test/MC/ARM/mapping-within-section.s +++ b/llvm/test/MC/ARM/mapping-within-section.s @@ -25,9 +25,9 @@ add r0, r0, r0 @ CHECK: 00000000 l .text 00000000 $a -@ CHECK-NEXT: 0000000c l .text 00000000 $a -@ CHECK-NEXT: 00000018 l .text 00000000 $a @ CHECK-NEXT: 00000004 l .text 00000000 $d -@ CHECK-NEXT: 00000012 l .text 00000000 $d @ CHECK-NEXT: 00000008 l .text 00000000 $t +@ CHECK-NEXT: 0000000c l .text 00000000 $a @ CHECK-NEXT: 00000010 l .text 00000000 $t +@ CHECK-NEXT: 00000012 l .text 00000000 $d +@ CHECK-NEXT: 00000018 l .text 00000000 $a diff --git a/llvm/test/MC/ARM/mappingsymbols.s b/llvm/test/MC/ARM/mappingsymbols.s index 3727e3ef7f2f..55a6be3c7bc6 100644 --- a/llvm/test/MC/ARM/mappingsymbols.s +++ b/llvm/test/MC/ARM/mappingsymbols.s @@ -36,13 +36,13 @@ @ RUN: llvm-mc -triple armv7-none-linux -filetype=obj -o %t.o %p/Inputs/7.s @ RUN: llvm-readelf -symbols %t.o | FileCheck %s -#CHECK: $a -#CHECK: $d +#CHECK-DAG: $a +#CHECK-DAG: $d -#MIX: $a +#MIX: $d #MIX: $a #MIX: $d -#MIX: $d +#MIX: $a #MAPPINGSYMBOLS-NOT: $a #MAPPINGSYMBOLS-NOT: $d diff --git a/llvm/test/MC/ARM/multi-section-mapping.s b/llvm/test/MC/ARM/multi-section-mapping.s index d0774693fa27..6107f262b0b8 100644 --- a/llvm/test/MC/ARM/multi-section-mapping.s +++ b/llvm/test/MC/ARM/multi-section-mapping.s @@ -42,10 +42,10 @@ @ + .starts_thumb to have $t at 0 @ + .starts_data to have $d at 0 -@ CHECK: 00000000 l .text 00000000 $a -@ CHECK-NEXT: 00000000 l .wibble 00000000 $a -@ CHECK-NEXT: 0000000a l .text 00000000 $d -@ CHECK-NEXT: 00000000 l .starts_thumb 00000000 $t -@ CHECK-NEXT: 00000008 l .text 00000000 $t +@ CHECK: 00000000 l .text 00000000 $a.0 +@ CHECK-NEXT: 00000000 l .wibble 00000000 $a.1 +@ CHECK-NEXT: 00000000 l .starts_thumb 00000000 $t.2 +@ CHECK-NEXT: 00000008 l .text 00000000 $t.3 +@ CHECK-NEXT: 0000000a l .text 00000000 $d.4 @ CHECK-NOT: ${{[adt]}} diff --git a/llvm/test/MC/ARM/relocated-mapping.s b/llvm/test/MC/ARM/relocated-mapping.s index 736ab0b8e2e2..b65e1c24cf12 100644 --- a/llvm/test/MC/ARM/relocated-mapping.s +++ b/llvm/test/MC/ARM/relocated-mapping.s @@ -7,5 +7,5 @@ add r0, r0, r0 @ CHECK: 00000000 l .text 00000000 $a -@ CHECK-NEXT: 00000008 l .text 00000000 $a @ CHECK-NEXT: 00000004 l .text 00000000 $d +@ CHECK-NEXT: 00000008 l .text 00000000 $a diff --git a/llvm/test/MC/ARM/thumb-types.s b/llvm/test/MC/ARM/thumb-types.s index 7d17017317d0..265f23ea6c42 100644 --- a/llvm/test/MC/ARM/thumb-types.s +++ b/llvm/test/MC/ARM/thumb-types.s @@ -1,5 +1,25 @@ -@ RUN: llvm-mc -triple armv7-elf -filetype obj -o - %s | llvm-readobj --symbols - \ -@ RUN: | FileCheck %s +@ RUN: llvm-mc -triple armv7-elf -filetype obj -o - %s | llvm-readelf -s - | FileCheck %s + +@ CHECK: Num: Value Size Type Bind Vis Ndx Name +@ CHECK-NEXT: 0: 00000000 0 NOTYPE LOCAL DEFAULT UND +@ CHECK-NEXT: 1: 00000001 0 FUNC LOCAL DEFAULT 2 implicit_function +@ CHECK-NEXT: 2: 00000000 0 NOTYPE LOCAL DEFAULT 2 $t.0 +@ CHECK-NEXT: 3: 00000002 0 OBJECT LOCAL DEFAULT 2 implicit_data +@ CHECK-NEXT: 4: 00000002 0 NOTYPE LOCAL DEFAULT 2 $d.1 +@ CHECK-NEXT: 5: 00000006 0 FUNC LOCAL DEFAULT 2 arm_function +@ CHECK-NEXT: 6: 00000006 0 NOTYPE LOCAL DEFAULT 2 $a.2 +@ CHECK-NEXT: 7: 0000000a 0 NOTYPE LOCAL DEFAULT 2 untyped_text_label +@ CHECK-NEXT: 8: 0000000a 0 NOTYPE LOCAL DEFAULT 2 $t.3 +@ CHECK-NEXT: 9: 0000000d 0 FUNC LOCAL DEFAULT 2 explicit_function +@ CHECK-NEXT: 10: 0000000e 0 NOTYPE LOCAL DEFAULT 2 $d.4 +@ CHECK-NEXT: 11: 00000000 4 TLS LOCAL DEFAULT 5 tls +@ CHECK-NEXT: 12: 00000013 0 IFUNC LOCAL DEFAULT 2 indirect_function +@ CHECK-NEXT: 13: 00000012 0 NOTYPE LOCAL DEFAULT 2 $t.5 +@ CHECK-NEXT: 14: 00000000 0 NOTYPE LOCAL DEFAULT 4 untyped_data_label +@ CHECK-NEXT: 15: 00000000 0 NOTYPE LOCAL DEFAULT 4 $t.6 +@ CHECK-NEXT: 16: 00000002 0 OBJECT LOCAL DEFAULT 4 explicit_data +@ CHECK-NEXT: 17: 00000002 0 NOTYPE LOCAL DEFAULT 4 $d.7 + .syntax unified @@ -51,58 +71,3 @@ tls: .long 42 .size tls, 4 - -@ CHECK: Symbol { -@ CHECK: Name: arm_function -@ CHECK: Value: 0x6 -@ CHECK: Type: Function -@ CHECK: } - -@ CHECK: Symbol { -@ CHECK: Name: explicit_data -@ CHECK: Value: 0x2 -@ CHECK: Type: Object -@ CHECK: } - -@ CHECK: Symbol { -@ CHECK: Name: explicit_function -@ CHECK: Value: 0xD -@ CHECK: Type: Function -@ CHECK: } - -@ CHECK: Symbol { -@ CHECK: Name: implicit_data -@ CHECK: Value: 0x2 -@ CHECK: Type: Object -@ CHECK: } - -@ CHECK: Symbol { -@ CHECK: Name: implicit_function -@ CHECK: Value: 0x1 -@ CHECK: Type: Function -@ CHECK: } - -@ CHECK: Symbol { -@ CHECK: Name: indirect_function -@ CHECK: Value: 0x13 -@ CHECK: Type: GNU_IFunc -@ CHECK: } - -@ CHECK: Symbol { -@ CHECK: Name: tls -@ CHECK: Value: 0x0 -@ CHECK: Type: TLS -@ CHECK: } - -@ CHECK: Symbol { -@ CHECK: Name: untyped_data_label -@ CHECK: Value: 0x0 -@ CHECK: Type: None -@ CHECK: } - -@ CHECK: Symbol { -@ CHECK: Name: untyped_text_label -@ CHECK: Value: 0xA -@ CHECK: Type: None -@ CHECK: } - diff --git a/llvm/test/MC/ARM/thumb_set.s b/llvm/test/MC/ARM/thumb_set.s index 1404bfd683f7..4bb7b599aaf1 100644 --- a/llvm/test/MC/ARM/thumb_set.s +++ b/llvm/test/MC/ARM/thumb_set.s @@ -1,9 +1,28 @@ -@ RUN: llvm-mc -triple armv7-eabi -filetype obj -o - %s | llvm-readobj --symbols - \ -@ RUN: | FileCheck %s +@ RUN: llvm-mc -triple armv7-eabi -filetype obj -o - %s | llvm-readelf -s - | FileCheck %s @ RUN: llvm-mc -triple armv7-eabi -filetype asm -o - %s \ @ RUN: | FileCheck --check-prefix=ASM %s +@ CHECK: Num: Value Size Type Bind Vis Ndx Name +@ CHECK-NEXT: 0: 00000000 0 NOTYPE LOCAL DEFAULT UND +@ CHECK-NEXT: 1: 00000000 0 FUNC LOCAL DEFAULT 2 arm_func +@ CHECK-NEXT: 2: 00000000 0 NOTYPE LOCAL DEFAULT 2 $a.0 +@ CHECK-NEXT: 3: 00000001 0 FUNC LOCAL DEFAULT 2 alias_arm_func +@ CHECK-NEXT: 4: 00000001 0 FUNC LOCAL DEFAULT 2 alias_arm_func2 +@ CHECK-NEXT: 5: 00000001 0 FUNC LOCAL DEFAULT 2 alias_arm_func3 +@ CHECK-NEXT: 6: 00000005 0 FUNC LOCAL DEFAULT 2 thumb_func +@ CHECK-NEXT: 7: 00000004 0 NOTYPE LOCAL DEFAULT 2 $t.1 +@ CHECK-NEXT: 8: 00000005 0 FUNC LOCAL DEFAULT 2 alias_thumb_func +@ CHECK-NEXT: 9: 5eed1e55 0 FUNC LOCAL DEFAULT ABS seedless +@ CHECK-NEXT: 10: e665a1ad 0 FUNC LOCAL DEFAULT ABS eggsalad +@ CHECK-NEXT: 11: face1e55 0 FUNC LOCAL DEFAULT ABS faceless +@ CHECK-NEXT: 12: 00000000 0 OBJECT LOCAL DEFAULT 3 alias_undefined_data +@ CHECK-NEXT: 13: 00000000 0 OBJECT LOCAL DEFAULT 3 badblood +@ CHECK-NEXT: 14: 00000004 0 OBJECT LOCAL DEFAULT 3 bedazzle +@ CHECK-NEXT: 15: 00000005 0 FUNC LOCAL DEFAULT 3 alias_defined_data +@ CHECK-NEXT: 16: 00000007 0 FUNC LOCAL DEFAULT 2 alpha +@ CHECK-NEXT: 17: 00000007 0 FUNC LOCAL DEFAULT 2 beta + .syntax unified .arm @@ -56,97 +75,3 @@ alpha: .type beta,%function .thumb_set beta, alpha - -@ CHECK: Symbol { -@ CHECK: Name: alias_arm_func -@ CHECK: Value: 0x1 -@ CHECK: Type: Function -@ CHECK: } - -@ CHECK: Symbol { -@ CHECK: Name: alias_arm_func2 -@ CHECK: Value: 0x1 -@ CHECK: Type: Function -@ CHECK: } - -@ CHECK: Symbol { -@ CHECK: Name: alias_arm_func3 -@ CHECK: Value: 0x1 -@ CHECK: Type: Function -@ CHECK: } - -@ CHECK: Symbol { -@ CHECK: Name: alias_defined_data -@ CHECK: Value: 0x5 -@ CHECK: Type: Function -@ CHECK: } - -@ CHECK: Symbol { -@ CHECK: Name: alias_thumb_func -@ CHECK: Value: 0x5 -@ CHECK: Type: Function -@ CHECK: } - -@ CHECK: Symbol { -@ CHECK: Name: alias_undefined_data -@ CHECK: Value: 0x0 -@ CHECK: Type: Object -@ CHECK: } - -@ CHECK: Symbol { -@ CHECK: Name: alpha -@ CHECK: Value: 0x7 -@ CHECK: Type: Function -@ CHECK: } - -@ CHECK: Symbol { -@ CHECK: Name: arm_func -@ CHECK: Value: 0x0 -@ CHECK: Type: Function -@ CHECK: } - -@ CHECK: Symbol { -@ CHECK: Name: badblood -@ CHECK-NEXT: Value: 0x0 -@ CHECK-NEXT: Size: 0 -@ CHECK-NEXT: Binding: Local -@ CHECK-NEXT: Type: Object -@ CHECK-NEXT: Other: 0 -@ CHECK-NEXT: Section: .data -@ CHECK-NEXT: } - -@ CHECK: Symbol { -@ CHECK: Name: bedazzle -@ CHECK: Value: 0x4 -@ CHECK: Type: Object -@ CHECK: } - -@ CHECK: Symbol { -@ CHECK: Name: beta -@ CHECK: Value: 0x7 -@ CHECK: Type: Function -@ CHECK: } - -@ CHECK: Symbol { -@ CHECK: Name: eggsalad -@ CHECK: Value: 0xE665A1AD -@ CHECK: Type: Function -@ CHECK: } - -@ CHECK: Symbol { -@ CHECK: Name: faceless -@ CHECK: Value: 0xFACE1E55 -@ CHECK: Type: Function -@ CHECK: } - -@ CHECK: Symbol { -@ CHECK: Name: seedless -@ CHECK: Value: 0x5EED1E55 -@ CHECK: Type: Function -@ CHECK: } - -@ CHECK: Symbol { -@ CHECK: Name: thumb_func -@ CHECK: Value: 0x5 -@ CHECK: Type: Function -@ CHECK: } diff --git a/llvm/test/MC/ELF/addrsig.s b/llvm/test/MC/ELF/addrsig.s index 5e5827440c6f..54abec564a8a 100644 --- a/llvm/test/MC/ELF/addrsig.s +++ b/llvm/test/MC/ELF/addrsig.s @@ -16,14 +16,16 @@ // CHECK-NEXT: AddressAlignment: 1 // CHECK-NEXT: EntrySize: 0 // CHECK-NEXT: SectionData ( -// CHECK-NEXT: 0000: 03050102 +// CHECK-NEXT: 0000: 03050201 // CHECK-NEXT: ) // CHECK-NEXT: } // CHECK-NEXT: Section { // CHECK-NEXT: Index: 4 // CHECK-NEXT: Name: .symtab -// CHECK: Name: local +// CHECK: Symbol { +// CHECK: Symbol { +// CHECK-NEXT: Name: // CHECK-NEXT: Value: // CHECK-NEXT: Size: // CHECK-NEXT: Binding: @@ -32,7 +34,7 @@ // CHECK-NEXT: Section: [[SEC:.*]] // CHECK-NEXT: } // CHECK-NEXT: Symbol { -// CHECK-NEXT: Name: +// CHECK-NEXT: Name: local // CHECK-NEXT: Value: // CHECK-NEXT: Size: // CHECK-NEXT: Binding: @@ -64,8 +66,8 @@ // CHECK: Addrsig [ // CHECK-NEXT: Sym: g1 (3) // CHECK-NEXT: Sym: g3 (5) -// CHECK-NEXT: Sym: local (1) -// CHECK-NEXT: Sym: (2) +// CHECK-NEXT: Sym: local (2) +// CHECK-NEXT: Sym: (1) // CHECK-NEXT: ] // ASM: .addrsig diff --git a/llvm/test/MC/ELF/alias.s b/llvm/test/MC/ELF/alias.s index 0aefc522052c..73e0c4405eeb 100644 --- a/llvm/test/MC/ELF/alias.s +++ b/llvm/test/MC/ELF/alias.s @@ -44,6 +44,15 @@ leaq .Llocal1(%rip), %rdi // CHECK-NEXT: Section: Undefined (0x0) // CHECK-NEXT: } // CHECK-NEXT: Symbol { +// CHECK-NEXT: Name: foo +// CHECK-NEXT: Value: 0x0 +// CHECK-NEXT: Size: 0 +// CHECK-NEXT: Binding: Local +// CHECK-NEXT: Type: None +// CHECK-NEXT: Other: 0 +// CHECK-NEXT: Section: .text +// CHECK-NEXT: } +// CHECK-NEXT: Symbol { // CHECK-NEXT: Name: bar // CHECK-NEXT: Value: 0x0 // CHECK-NEXT: Size: 0 @@ -53,6 +62,24 @@ leaq .Llocal1(%rip), %rdi // CHECK-NEXT: Section: .text // CHECK-NEXT: } // CHECK-NEXT: Symbol { +// CHECK-NEXT: Name: foo3 +// CHECK-NEXT: Value: 0x0 +// CHECK-NEXT: Size: 0 +// CHECK-NEXT: Binding: Local +// CHECK-NEXT: Type: None +// CHECK-NEXT: Other: 0 +// CHECK-NEXT: Section: .text +// CHECK-NEXT: } +// CHECK-NEXT: Symbol { +// CHECK-NEXT: Name: foo4 +// CHECK-NEXT: Value: 0x1 +// CHECK-NEXT: Size: 0 +// CHECK-NEXT: Binding: Local +// CHECK-NEXT: Type: Function +// CHECK-NEXT: Other: 0 +// CHECK-NEXT: Section: .text +// CHECK-NEXT: } +// CHECK-NEXT: Symbol { // CHECK-NEXT: Name: bar4 // CHECK-NEXT: Value: 0x1 // CHECK-NEXT: Size: 0 @@ -80,33 +107,6 @@ leaq .Llocal1(%rip), %rdi // CHECK-NEXT: Section: .text // CHECK-NEXT: } // CHECK-NEXT: Symbol { -// CHECK-NEXT: Name: foo -// CHECK-NEXT: Value: 0x0 -// CHECK-NEXT: Size: 0 -// CHECK-NEXT: Binding: Local -// CHECK-NEXT: Type: None -// CHECK-NEXT: Other: 0 -// CHECK-NEXT: Section: .text -// CHECK-NEXT: } -// CHECK-NEXT: Symbol { -// CHECK-NEXT: Name: foo3 -// CHECK-NEXT: Value: 0x0 -// CHECK-NEXT: Size: 0 -// CHECK-NEXT: Binding: Local -// CHECK-NEXT: Type: None -// CHECK-NEXT: Other: 0 -// CHECK-NEXT: Section: .text -// CHECK-NEXT: } -// CHECK-NEXT: Symbol { -// CHECK-NEXT: Name: foo4 -// CHECK-NEXT: Value: 0x1 -// CHECK-NEXT: Size: 0 -// CHECK-NEXT: Binding: Local -// CHECK-NEXT: Type: Function -// CHECK-NEXT: Other: 0 -// CHECK-NEXT: Section: .text -// CHECK-NEXT: } -// CHECK-NEXT: Symbol { // CHECK-NEXT: Name: .data (0) // CHECK-NOT: Symbol { // CHECK: } diff --git a/llvm/test/MC/ELF/cgprofile.s b/llvm/test/MC/ELF/cgprofile.s index 941bf7731f66..bf31d002e4fa 100644 --- a/llvm/test/MC/ELF/cgprofile.s +++ b/llvm/test/MC/ELF/cgprofile.s @@ -27,10 +27,10 @@ late3: # CHECK-NEXT: AddressAlignment: 1 # CHECK-NEXT: EntrySize: 16 # CHECK-NEXT: SectionData ( -# CHECK-NEXT: 0000: 01000000 05000000 20000000 00000000 -# CHECK-NEXT: 0010: 06000000 01000000 0B000000 00000000 -# CHECK-NEXT: 0020: 07000000 02000000 14000000 00000000 -# CHECK-NEXT: 0030: 04000000 05000000 2A000000 00000000 +# CHECK-NEXT: 0000: 02000000 05000000 20000000 00000000 +# CHECK-NEXT: 0010: 06000000 02000000 0B000000 00000000 +# CHECK-NEXT: 0020: 07000000 03000000 14000000 00000000 +# CHECK-NEXT: 0030: 01000000 05000000 2A000000 00000000 # CHECK-NEXT: ) # CHECK: Symbols [ @@ -97,4 +97,4 @@ late3: # CHECK-NEXT: To: b # CHECK-NEXT: Weight: 42 # CHECK-NEXT: } -# CHECK-NEXT: ] \ No newline at end of file +# CHECK-NEXT: ] diff --git a/llvm/test/MC/ELF/ifunc-alias.s b/llvm/test/MC/ELF/ifunc-alias.s index 6fd9845548e5..b3303d97907e 100644 --- a/llvm/test/MC/ELF/ifunc-alias.s +++ b/llvm/test/MC/ELF/ifunc-alias.s @@ -23,10 +23,10 @@ foo_resolver: .set tls,foo .type tls,@tls_object -// CHECK: IFUNC LOCAL DEFAULT 2 foo -// CHECK: IFUNC LOCAL DEFAULT 2 foo2 -// CHECK: IFUNC LOCAL DEFAULT 2 foo3 -// CHECK: IFUNC LOCAL DEFAULT 2 foo4 -// CHECK: FUNC LOCAL DEFAULT 2 foo_impl -// CHECK: FUNC LOCAL DEFAULT 2 foo_resolver -// CHECK: TLS LOCAL DEFAULT 2 tls +// CHECK: FUNC LOCAL DEFAULT 2 foo_impl +// CHECK-NEXT: FUNC LOCAL DEFAULT 2 foo_resolver +// CHECK-NEXT: IFUNC LOCAL DEFAULT 2 foo +// CHECK-NEXT: IFUNC LOCAL DEFAULT 2 foo2 +// CHECK-NEXT: IFUNC LOCAL DEFAULT 2 foo3 +// CHECK-NEXT: IFUNC LOCAL DEFAULT 2 foo4 +// CHECK-NEXT: TLS LOCAL DEFAULT 2 tls diff --git a/llvm/test/MC/ELF/many-sections-2.s b/llvm/test/MC/ELF/many-sections-2.s index 9571f9b24824..b782306aad2e 100644 --- a/llvm/test/MC/ELF/many-sections-2.s +++ b/llvm/test/MC/ELF/many-sections-2.s @@ -10,6 +10,14 @@ // Test that we don't create a symbol for the symtab_shndx section. // SYMBOLS-NOT: symtab_shndx +// SYMBOLS: Name: dm (0) +// SYMBOLS: Value: 0x0 +// SYMBOLS: Size: 0 +// SYMBOLS: Binding: Local (0x0) +// SYMBOLS: Type: Section (0x3) +// SYMBOLS: Other: 0 +// SYMBOLS: Section: dm (0xFF00) +// SYMBOLS-NEXT: } // Test that both a and b show up in the correct section. // SYMBOLS: Name: a @@ -29,17 +37,6 @@ // SYMBOLS-NEXT: Other: 0 // SYMBOLS-NEXT: Section: dm (0xFF00) // SYMBOLS-NEXT: } - - -// Test that this file has one section too many. -// SYMBOLS: Name: dm (0) -// SYMBOLS: Value: 0x0 -// SYMBOLS: Size: 0 -// SYMBOLS: Binding: Local (0x0) -// SYMBOLS: Type: Section (0x3) -// SYMBOLS: Other: 0 -// SYMBOLS: Section: dm (0xFF00) -// SYMBOLS-NEXT: } // SYMBOLS-NEXT:] .macro gen_sections4 x diff --git a/llvm/test/MC/ELF/reloc-same-name-section.s b/llvm/test/MC/ELF/reloc-same-name-section.s index a7f5c3cbfb2e..579d61702426 100644 --- a/llvm/test/MC/ELF/reloc-same-name-section.s +++ b/llvm/test/MC/ELF/reloc-same-name-section.s @@ -7,13 +7,13 @@ // CHECK-NEXT: Relocation { // CHECK-NEXT: Offset: // CHECK-NEXT: Type: -// CHECK-NEXT: Symbol: .foo (4) +// CHECK-NEXT: Symbol: .foo (2) // CHECK-NEXT: Addend: // CHECK-NEXT: } // CHECK-NEXT: Relocation { // CHECK-NEXT: Offset: // CHECK-NEXT: Type: -// CHECK-NEXT: Symbol: .foo (5) +// CHECK-NEXT: Symbol: .foo (4) // CHECK-NEXT: Addend: // CHECK-NEXT: } // CHECK-NEXT: } diff --git a/llvm/test/MC/ELF/section-sym.s b/llvm/test/MC/ELF/section-sym.s index e89b669bcb2c..309a98f60729 100644 --- a/llvm/test/MC/ELF/section-sym.s +++ b/llvm/test/MC/ELF/section-sym.s @@ -46,7 +46,7 @@ // CHECK-NEXT: Relocation { // CHECK-NEXT: Offset: 0x0 // CHECK-NEXT: Type: R_X86_64_32 (10) -// CHECK-NEXT: Symbol: foo (3) +// CHECK-NEXT: Symbol: foo (2) // CHECK-NEXT: Addend: 0x0 // CHECK-NEXT: } // CHECK-NEXT: } @@ -73,6 +73,15 @@ // CHECK-NEXT: Section: .group // CHECK-NEXT: } // CHECK-NEXT: Symbol { +// CHECK-NEXT: Name: foo (0) +// CHECK-NEXT: Value: 0x0 +// CHECK-NEXT: Size: 0 +// CHECK-NEXT: Binding: Local (0x0) +// CHECK-NEXT: Type: Section (0x3) +// CHECK-NEXT: Other: 0 +// CHECK-NEXT: Section: foo (0x4) +// CHECK-NEXT: } +// CHECK-NEXT: Symbol { // CHECK-NEXT: Name: f2 // CHECK-NEXT: Value: 0x0 // CHECK-NEXT: Size: 0 @@ -81,13 +90,4 @@ // CHECK-NEXT: Other: 0 // CHECK-NEXT: Section: .group // CHECK-NEXT: } -// CHECK-NEXT: Symbol { -// CHECK-NEXT: Name: foo (0) -// CHECK-NEXT: Value: 0x0 -// CHECK-NEXT: Size: 0 -// CHECK-NEXT: Binding: Local (0x0) -// CHECK-NEXT: Type: Section (0x3) -// CHECK-NEXT: Other: 0 -// CHECK-NEXT: Section: foo (0x4) -// CHECK-NEXT: } // CHECK-NEXT: ] diff --git a/llvm/test/MC/ELF/symver.s b/llvm/test/MC/ELF/symver.s index 33063accd5bf..442a68a62676 100644 --- a/llvm/test/MC/ELF/symver.s +++ b/llvm/test/MC/ELF/symver.s @@ -31,6 +31,32 @@ global1: // CHECK-NEXT: } // CHECK-NEXT: ] +// 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 +// CHECK-NEXT: } +// CHECK-NEXT: Symbol { +// CHECK-NEXT: Name: defined1 +// CHECK-NEXT: Value: 0x0 +// CHECK-NEXT: Size: 0 +// CHECK-NEXT: Binding: Local +// CHECK-NEXT: Type: None +// CHECK-NEXT: Other: 0 +// CHECK-NEXT: Section: .text +// CHECK-NEXT: } +// CHECK-NEXT: Symbol { +// CHECK-NEXT: Name: defined2 +// CHECK-NEXT: Value: 0x0 +// CHECK-NEXT: Size: 0 +// CHECK-NEXT: Binding: Local +// CHECK-NEXT: Type: None +// CHECK-NEXT: Other: 0 +// CHECK-NEXT: Section: .text +// CHECK-NEXT: } // CHECK: Symbol { // CHECK: Name: bar1@zed // CHECK-NEXT: Value: 0x0 @@ -59,33 +85,6 @@ global1: // CHECK-NEXT: Section: .text // CHECK-NEXT: } // CHECK-NEXT: Symbol { -// CHECK-NEXT: Name: defined1 -// CHECK-NEXT: Value: 0x0 -// CHECK-NEXT: Size: 0 -// CHECK-NEXT: Binding: Local -// CHECK-NEXT: Type: None -// CHECK-NEXT: Other: 0 -// CHECK-NEXT: Section: .text -// CHECK-NEXT: } -// CHECK-NEXT: Symbol { -// CHECK-NEXT: Name: defined2 -// CHECK-NEXT: Value: 0x0 -// CHECK-NEXT: Size: 0 -// CHECK-NEXT: Binding: Local -// CHECK-NEXT: Type: None -// CHECK-NEXT: Other: 0 -// CHECK-NEXT: Section: .text -// CHECK-NEXT: } -// CHECK-NEXT: Symbol { -// CHECK-NEXT: 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 -// CHECK-NEXT: } -// CHECK-NEXT: Symbol { // CHECK-NEXT: Name: bar2@zed // CHECK-NEXT: Value: 0x0 // CHECK-NEXT: Size: 0 diff --git a/llvm/test/MC/ELF/type-propagate.s b/llvm/test/MC/ELF/type-propagate.s index 183b45bb438c..17b4c0a5721c 100644 --- a/llvm/test/MC/ELF/type-propagate.s +++ b/llvm/test/MC/ELF/type-propagate.s @@ -105,6 +105,15 @@ sym10: // CHECK-NEXT: Section: .text // CHECK-NEXT: } // CHECK-NEXT: Symbol { +// CHECK-NEXT: Name: sym10 +// CHECK-NEXT: Value: 0x0 +// CHECK-NEXT: Size: 0 +// CHECK-NEXT: Binding: Local (0x0) +// CHECK-NEXT: Type: Function (0x2) +// CHECK-NEXT: Other: 0 +// CHECK-NEXT: Section: .text +// CHECK-NEXT: } +// CHECK-NEXT: Symbol { // CHECK-NEXT: Name: sym09 // CHECK-NEXT: Value: 0x1 // CHECK-NEXT: Size: 0 @@ -113,15 +122,6 @@ sym10: // GAS: Type: None (0x0) // CHECK-NEXT: Type: Function (0x2) -// CHECK-NEXT: Other: 0 -// CHECK-NEXT: Section: .text -// CHECK-NEXT: } -// CHECK-NEXT: Symbol { -// CHECK-NEXT: Name: sym10 -// CHECK-NEXT: Value: 0x0 -// CHECK-NEXT: Size: 0 -// CHECK-NEXT: Binding: Local (0x0) -// CHECK-NEXT: Type: Function (0x2) // CHECK-NEXT: Other: 0 // CHECK-NEXT: Section: .text // CHECK-NEXT: } diff --git a/llvm/test/MC/ELF/weakref.s b/llvm/test/MC/ELF/weakref.s index b866ffaef744..46b6f1d68949 100644 --- a/llvm/test/MC/ELF/weakref.s +++ b/llvm/test/MC/ELF/weakref.s @@ -80,6 +80,15 @@ bar15: // CHECK-NEXT: Section: Undefined (0x0) // CHECK-NEXT: } // CHECK-NEXT: Symbol { +// CHECK-NEXT: 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 +// CHECK-NEXT: } +// CHECK-NEXT: Symbol { // CHECK-NEXT: Name: bar6 // CHECK-NEXT: Value: 0x18 // CHECK-NEXT: Size: 0 @@ -116,15 +125,6 @@ bar15: // CHECK-NEXT: Section: .text // CHECK-NEXT: } // CHECK-NEXT: Symbol { -// CHECK-NEXT: 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 -// CHECK-NEXT: } -// CHECK-NEXT: Symbol { // CHECK-NEXT: Name: bar1 // CHECK-NEXT: Value: 0x0 // CHECK-NEXT: Size: 0 diff --git a/llvm/test/MC/Hexagon/lcomm.s b/llvm/test/MC/Hexagon/lcomm.s index 78a7e89a47c2..8d1c6ae35808 100644 --- a/llvm/test/MC/Hexagon/lcomm.s +++ b/llvm/test/MC/Hexagon/lcomm.s @@ -1,4 +1,14 @@ # RUN: llvm-mc -filetype=obj -triple=hexagon %s | llvm-objdump -t - | FileCheck %s + +# CHECK: 00000000 l O .sbss.1 00000001 dst1 +# CHECK-NEXT: 00000000 l d .sbss.1 00000000 .sbss.1 +# CHECK-NEXT: 00000000 l O .sbss.2 00000002 dst2 +# CHECK-NEXT: 00000000 l d .sbss.2 00000000 .sbss.2 +# CHECK-NEXT: 00000000 l O .sbss.4 00000004 dst4 +# CHECK-NEXT: 00000000 l d .sbss.4 00000000 .sbss.4 +# CHECK-NEXT: 00000000 l O .sbss.8 00000008 dst8 +# CHECK-NEXT: 00000000 l d .sbss.8 00000000 .sbss.8 + .lcomm dst1,1,1,1 .lcomm dst2,2,2,2 .lcomm dst4,4,4,4 @@ -8,12 +18,3 @@ r0 = add(pc, ##dst1@PCREL) r0 = add(pc, ##dst2@PCREL) r0 = add(pc, ##dst4@PCREL) r0 = add(pc, ##dst8@PCREL) - -# CHECK: 00000000 l O .sbss.1 00000001 dst1 -# CHECK: 00000000 l O .sbss.2 00000002 dst2 -# CHECK: 00000000 l O .sbss.4 00000004 dst4 -# CHECK: 00000000 l O .sbss.8 00000008 dst8 -# CHECK: 00000000 l d .sbss.1 00000000 .sbss.1 -# CHECK: 00000000 l d .sbss.2 00000000 .sbss.2 -# CHECK: 00000000 l d .sbss.4 00000000 .sbss.4 -# CHECK: 00000000 l d .sbss.8 00000000 .sbss.8 diff --git a/llvm/test/MC/Mips/micromips-label-test.s b/llvm/test/MC/Mips/micromips-label-test.s index 80336d107d73..8224398e6723 100644 --- a/llvm/test/MC/Mips/micromips-label-test.s +++ b/llvm/test/MC/Mips/micromips-label-test.s @@ -49,22 +49,6 @@ j: # CHECK: Section: .text # CHECK: } # CHECK: Symbol { -# CHECK: Name: i -# CHECK: Binding: Local -# CHECK: Type: None -# CHECK: Other [ (0x80) -# CHECK: STO_MIPS_MICROMIPS -# CHECK: ] -# CHECK: Section: .text -# CHECK: } -# CHECK: Symbol { -# CHECK: Name: j -# CHECK: Binding: Local -# CHECK: Type: None -# CHECK: Other: 0 -# CHECK: Section: .text -# CHECK: } -# CHECK: Symbol { # CHECK: Name: k # CHECK: Binding: Local # CHECK: Type: None @@ -99,4 +83,20 @@ j: # CHECK: Other: 0 # CHECK: Section: .text # CHECK: } +# CHECK: Symbol { +# CHECK-NEXT: Name: i +# CHECK: Binding: Local +# CHECK-NEXT: Type: None +# CHECK-NEXT: Other [ (0x80) +# CHECK-NEXT: STO_MIPS_MICROMIPS +# CHECK-NEXT: ] +# CHECK-NEXT: Section: .text +# CHECK-NEXT: } +# CHECK-NEXT: Symbol { +# CHECK-NEXT: Name: j +# CHECK: Binding: Local +# CHECK-NEXT: Type: None +# CHECK-NEXT: Other: 0 +# CHECK-NEXT: Section: .text +# CHECK-NEXT: } # CHECK: ]