diff --git a/lib/MC/ELFObjectWriter.cpp b/lib/MC/ELFObjectWriter.cpp index 69307b61755..74eb7b64c8a 100644 --- a/lib/MC/ELFObjectWriter.cpp +++ b/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/test/MC/AArch64/mapping-across-sections.s b/test/MC/AArch64/mapping-across-sections.s index ceb05dc13f9..053deb760dc 100644 --- a/test/MC/AArch64/mapping-across-sections.s +++ b/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/test/MC/AMDGPU/hsa-gfx10-v3.s b/test/MC/AMDGPU/hsa-gfx10-v3.s index 5df08e7c243..dbf3c96023d 100644 --- a/test/MC/AMDGPU/hsa-gfx10-v3.s +++ b/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/test/MC/AMDGPU/hsa-gfx10.s b/test/MC/AMDGPU/hsa-gfx10.s index 5eb81ab2467..938e48e6341 100644 --- a/test/MC/AMDGPU/hsa-gfx10.s +++ b/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/test/MC/AMDGPU/hsa-v3.s b/test/MC/AMDGPU/hsa-v3.s index 380f9cfb613..92c4d59a2e8 100644 --- a/test/MC/AMDGPU/hsa-v3.s +++ b/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/test/MC/AMDGPU/hsa.s b/test/MC/AMDGPU/hsa.s index ceddbc678e6..12160e87932 100644 --- a/test/MC/AMDGPU/hsa.s +++ b/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/test/MC/ARM/arm-elf-symver.s b/test/MC/ARM/arm-elf-symver.s index 24b19dcdc3d..e49a7d7de7a 100644 --- a/test/MC/ARM/arm-elf-symver.s +++ b/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/test/MC/ARM/data-in-code.ll b/test/MC/ARM/data-in-code.ll index dcd3947f7e0..e863640bda7 100644 --- a/test/MC/ARM/data-in-code.ll +++ b/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/test/MC/ARM/mapping-within-section.s b/test/MC/ARM/mapping-within-section.s index 9c594fcf905..1f15def4eaf 100644 --- a/test/MC/ARM/mapping-within-section.s +++ b/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/test/MC/ARM/mappingsymbols.s b/test/MC/ARM/mappingsymbols.s index 3727e3ef7f2..55a6be3c7bc 100644 --- a/test/MC/ARM/mappingsymbols.s +++ b/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/test/MC/ARM/multi-section-mapping.s b/test/MC/ARM/multi-section-mapping.s index d0774693fa2..6107f262b0b 100644 --- a/test/MC/ARM/multi-section-mapping.s +++ b/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/test/MC/ARM/relocated-mapping.s b/test/MC/ARM/relocated-mapping.s index 736ab0b8e2e..b65e1c24cf1 100644 --- a/test/MC/ARM/relocated-mapping.s +++ b/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/test/MC/ARM/thumb-types.s b/test/MC/ARM/thumb-types.s index 7d17017317d..265f23ea6c4 100644 --- a/test/MC/ARM/thumb-types.s +++ b/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/test/MC/ARM/thumb_set.s b/test/MC/ARM/thumb_set.s index 1404bfd683f..4bb7b599aaf 100644 --- a/test/MC/ARM/thumb_set.s +++ b/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/test/MC/ELF/addrsig.s b/test/MC/ELF/addrsig.s index 5e5827440c6..54abec564a8 100644 --- a/test/MC/ELF/addrsig.s +++ b/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/test/MC/ELF/alias.s b/test/MC/ELF/alias.s index 0aefc522052..73e0c4405ee 100644 --- a/test/MC/ELF/alias.s +++ b/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/test/MC/ELF/cgprofile.s b/test/MC/ELF/cgprofile.s index 941bf7731f6..bf31d002e4f 100644 --- a/test/MC/ELF/cgprofile.s +++ b/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/test/MC/ELF/ifunc-alias.s b/test/MC/ELF/ifunc-alias.s index 6fd9845548e..b3303d97907 100644 --- a/test/MC/ELF/ifunc-alias.s +++ b/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/test/MC/ELF/many-sections-2.s b/test/MC/ELF/many-sections-2.s index 9571f9b2482..b782306aad2 100644 --- a/test/MC/ELF/many-sections-2.s +++ b/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/test/MC/ELF/reloc-same-name-section.s b/test/MC/ELF/reloc-same-name-section.s index a7f5c3cbfb2..579d6170242 100644 --- a/test/MC/ELF/reloc-same-name-section.s +++ b/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/test/MC/ELF/section-sym.s b/test/MC/ELF/section-sym.s index e89b669bcb2..309a98f6072 100644 --- a/test/MC/ELF/section-sym.s +++ b/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/test/MC/ELF/symver.s b/test/MC/ELF/symver.s index 33063accd5b..442a68a6267 100644 --- a/test/MC/ELF/symver.s +++ b/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/test/MC/ELF/type-propagate.s b/test/MC/ELF/type-propagate.s index 183b45bb438..17b4c0a5721 100644 --- a/test/MC/ELF/type-propagate.s +++ b/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/test/MC/ELF/weakref.s b/test/MC/ELF/weakref.s index b866ffaef74..46b6f1d6894 100644 --- a/test/MC/ELF/weakref.s +++ b/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/test/MC/Hexagon/lcomm.s b/test/MC/Hexagon/lcomm.s index 78a7e89a47c..8d1c6ae3580 100644 --- a/test/MC/Hexagon/lcomm.s +++ b/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/test/MC/Mips/micromips-label-test.s b/test/MC/Mips/micromips-label-test.s index 80336d107d7..8224398e672 100644 --- a/test/MC/Mips/micromips-label-test.s +++ b/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: ]