diff --git a/lld/test/ELF/arm-target1.s b/lld/test/ELF/arm-target1.s --- a/lld/test/ELF/arm-target1.s +++ b/lld/test/ELF/arm-target1.s @@ -26,7 +26,7 @@ // Force generation of $d.0 as section is not all data nop // RELATIVE: SYMBOL TABLE: -// RELATIVE: 00001154 .text 00000000 patatino +// RELATIVE: 00001154 l .text 00000000 patatino // RELATIVE: Disassembly of section .text: // RELATIVE-EMPTY: // RELATIVE: $d.0: diff --git a/lld/test/ELF/edata-etext.s b/lld/test/ELF/edata-etext.s --- a/lld/test/ELF/edata-etext.s +++ b/lld/test/ELF/edata-etext.s @@ -18,13 +18,13 @@ # CHECK-NEXT: 2 .data 00000002 0000000000202159 DATA # CHECK-NEXT: 3 .bss 00000006 000000000020215c BSS # CHECK: SYMBOL TABLE: -# CHECK-NEXT: 000000000020215b .data 0000000000000000 _edata -# CHECK-NEXT: 0000000000202162 .bss 0000000000000000 _end -# CHECK-NEXT: 0000000000201159 .text 0000000000000000 _etext -# CHECK-NEXT: 0000000000201158 .text 0000000000000000 _start -# CHECK-NEXT: 000000000020215b .data 0000000000000000 edata -# CHECK-NEXT: 0000000000202162 .bss 0000000000000000 end -# CHECK-NEXT: 0000000000201159 .text 0000000000000000 etext +# CHECK-NEXT: 000000000020215b g .data 0000000000000000 _edata +# CHECK-NEXT: 0000000000202162 g .bss 0000000000000000 _end +# CHECK-NEXT: 0000000000201159 g .text 0000000000000000 _etext +# CHECK-NEXT: 0000000000201158 g .text 0000000000000000 _start +# CHECK-NEXT: 000000000020215b g .data 0000000000000000 edata +# CHECK-NEXT: 0000000000202162 g .bss 0000000000000000 end +# CHECK-NEXT: 0000000000201159 g .text 0000000000000000 etext # RUN: ld.lld -r %t.o -o %t2 # RUN: llvm-objdump -t %t2 | FileCheck %s --check-prefix=RELOCATABLE diff --git a/lld/test/ELF/edata-no-bss.s b/lld/test/ELF/edata-no-bss.s --- a/lld/test/ELF/edata-no-bss.s +++ b/lld/test/ELF/edata-no-bss.s @@ -8,7 +8,7 @@ # CHECK: .data 00000008 000000000020215c DATA -# CHECK: 0000000000202164 .data 0000000000000000 _edata +# CHECK: 0000000000202164 g .data 0000000000000000 _edata .text .globl _start diff --git a/llvm/test/MC/AArch64/inst-directive.s b/llvm/test/MC/AArch64/inst-directive.s --- a/llvm/test/MC/AArch64/inst-directive.s +++ b/llvm/test/MC/AArch64/inst-directive.s @@ -30,6 +30,6 @@ // CHECK-OBJ-NEXT: 0000: 2040105E // CHECK-OBJ-NEXT: ) -// CHECK-SYMS-NOT: 0000000000000000 .inst.aarch64_inst 0000000000000000 $d -// CHECK-SYMS: 0000000000000000 .inst.aarch64_inst 0000000000000000 $x -// CHECK-SYMS-NOT: 0000000000000000 .inst.aarch64_inst 0000000000000000 $d +// CHECK-SYMS-NOT: 0000000000000000 l .inst.aarch64_inst 0000000000000000 $d +// CHECK-SYMS: 0000000000000000 l .inst.aarch64_inst 0000000000000000 $x +// CHECK-SYMS-NOT: 0000000000000000 l .inst.aarch64_inst 0000000000000000 $d diff --git a/llvm/test/MC/AArch64/mapping-across-sections.s b/llvm/test/MC/AArch64/mapping-across-sections.s --- 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 .starts_data 0000000000000000 $d -// CHECK-NEXT: 0000000000000000 .text 0000000000000000 $x -// CHECK-NEXT: 0000000000000000 .wibble 0000000000000000 $x +// CHECK: 0000000000000000 l .starts_data 0000000000000000 $d +// CHECK-NEXT: 0000000000000000 l .text 0000000000000000 $x +// CHECK-NEXT: 0000000000000000 l .wibble 0000000000000000 $x // CHECK-NOT: ${{[adtx]}} diff --git a/llvm/test/MC/ARM/mapping-initial.s b/llvm/test/MC/ARM/mapping-initial.s --- a/llvm/test/MC/ARM/mapping-initial.s +++ b/llvm/test/MC/ARM/mapping-initial.s @@ -5,5 +5,5 @@ add r0, r0, r0 -@ ARM: 00000000 .text 00000000 $a -@ THUMB: 00000000 .text 00000000 $t +@ ARM: 00000000 l .text 00000000 $a +@ THUMB: 00000000 l .text 00000000 $t diff --git a/llvm/test/MC/ARM/mapping-within-section.s b/llvm/test/MC/ARM/mapping-within-section.s --- a/llvm/test/MC/ARM/mapping-within-section.s +++ b/llvm/test/MC/ARM/mapping-within-section.s @@ -24,10 +24,10 @@ .arm add r0, r0, r0 -@ CHECK: 00000000 .text 00000000 $a -@ CHECK-NEXT: 0000000c .text 00000000 $a -@ CHECK-NEXT: 00000018 .text 00000000 $a -@ CHECK-NEXT: 00000004 .text 00000000 $d -@ CHECK-NEXT: 00000012 .text 00000000 $d -@ CHECK-NEXT: 00000008 .text 00000000 $t -@ CHECK-NEXT: 00000010 .text 00000000 $t +@ 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: 00000010 l .text 00000000 $t diff --git a/llvm/test/MC/ARM/multi-section-mapping.s b/llvm/test/MC/ARM/multi-section-mapping.s --- 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 .text 00000000 $a -@ CHECK-NEXT: 00000000 .wibble 00000000 $a -@ CHECK-NEXT: 0000000a .text 00000000 $d -@ CHECK-NEXT: 00000000 .starts_thumb 00000000 $t -@ CHECK-NEXT: 00000008 .text 00000000 $t +@ 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-NOT: ${{[adt]}} diff --git a/llvm/test/MC/ARM/relocated-mapping.s b/llvm/test/MC/ARM/relocated-mapping.s --- a/llvm/test/MC/ARM/relocated-mapping.s +++ b/llvm/test/MC/ARM/relocated-mapping.s @@ -6,6 +6,6 @@ .word somewhere add r0, r0, r0 -@ CHECK: 00000000 .text 00000000 $a -@ CHECK-NEXT: 00000008 .text 00000000 $a -@ CHECK-NEXT: 00000004 .text 00000000 $d +@ CHECK: 00000000 l .text 00000000 $a +@ CHECK-NEXT: 00000008 l .text 00000000 $a +@ CHECK-NEXT: 00000004 l .text 00000000 $d diff --git a/llvm/test/MC/AsmParser/defsym.s b/llvm/test/MC/AsmParser/defsym.s --- a/llvm/test/MC/AsmParser/defsym.s +++ b/llvm/test/MC/AsmParser/defsym.s @@ -16,5 +16,5 @@ .err .endif -# CHECK: 00000007 *ABS* 00000000 a -# CHECK: 0000000b *ABS* 00000000 b \ No newline at end of file +# CHECK: 00000007 l *ABS* 00000000 a +# CHECK: 0000000b l *ABS* 00000000 b diff --git a/llvm/test/MC/Hexagon/common-redeclare.s b/llvm/test/MC/Hexagon/common-redeclare.s --- a/llvm/test/MC/Hexagon/common-redeclare.s +++ b/llvm/test/MC/Hexagon/common-redeclare.s @@ -1,6 +1,6 @@ # RUN: llvm-mc -arch=hexagon -filetype=obj %s | llvm-objdump -t - | FileCheck %s -# CHECK: 00000062 g O *COM* 00000008 quartet_table_isqrt +# CHECK: 00000062 O *COM* 00000008 quartet_table_isqrt .common quartet_table_isqrt, 98, 8 .common quartet_table_isqrt, 98, 8 diff --git a/llvm/test/MC/Hexagon/offset.s b/llvm/test/MC/Hexagon/offset.s --- a/llvm/test/MC/Hexagon/offset.s +++ b/llvm/test/MC/Hexagon/offset.s @@ -3,5 +3,5 @@ sym_a: .set sym_d, sym_a + 8 -# CHECK: 00000000 .text 00000000 sym_a -# CHECK: 00000008 .text 00000000 sym_d +# CHECK: 00000000 l .text 00000000 sym_a +# CHECK: 00000008 l .text 00000000 sym_d diff --git a/llvm/test/tools/llvm-objdump/WebAssembly/symbol-table.test b/llvm/test/tools/llvm-objdump/WebAssembly/symbol-table.test --- a/llvm/test/tools/llvm-objdump/WebAssembly/symbol-table.test +++ b/llvm/test/tools/llvm-objdump/WebAssembly/symbol-table.test @@ -3,7 +3,7 @@ CHECK: SYMBOL TABLE: CHECK-NEXT: 00000001 g F CODE main CHECK-NEXT: 00000000 l O DATA .L.str -CHECK-NEXT: 00000000 g F *UND* puts +CHECK-NEXT: 00000000 F *UND* puts CHECK-NEXT: 00000019 l F CODE .LSomeOtherFunction_bitcast -CHECK-NEXT: 00000000 g F *UND* SomeOtherFunction +CHECK-NEXT: 00000000 F *UND* SomeOtherFunction CHECK-NEXT: 00000010 g O DATA var diff --git a/llvm/test/tools/llvm-objdump/X86/adjust-vma.test b/llvm/test/tools/llvm-objdump/X86/adjust-vma.test --- a/llvm/test/tools/llvm-objdump/X86/adjust-vma.test +++ b/llvm/test/tools/llvm-objdump/X86/adjust-vma.test @@ -29,7 +29,7 @@ # COMMON: SYMBOL TABLE: # COMMON-NEXT: 0000000000000001 l F .text 0000000000000000 func -# COMMON-NEXT: 0000000000000000 .text 0000000000000000 sym +# COMMON-NEXT: 0000000000000000 l .text 0000000000000000 sym # COMMON-NEXT: 0000000000000000 l d .text 0000000000000000 .text # NOADJUST: 0000000000000000 sym: diff --git a/llvm/test/tools/llvm-objdump/X86/out-of-section-sym.test b/llvm/test/tools/llvm-objdump/X86/out-of-section-sym.test --- a/llvm/test/tools/llvm-objdump/X86/out-of-section-sym.test +++ b/llvm/test/tools/llvm-objdump/X86/out-of-section-sym.test @@ -7,9 +7,9 @@ CHECK: SYMBOL TABLE: CHECK-NEXT: 00000010 l d .text 00000000 .text -CHECK-NEXT: 00000010 .text 00000000 _start -CHECK-NEXT: 00000020 .text 00000000 _fdata -CHECK-NEXT: 00000010 .text 00000000 _ftext +CHECK-NEXT: 00000010 l .text 00000000 _start +CHECK-NEXT: 00000020 g .text 00000000 _fdata +CHECK-NEXT: 00000010 g .text 00000000 _ftext CHECK-EMPTY: CHECK-NEXT: Disassembly of section .text: CHECK-EMPTY: diff --git a/llvm/test/tools/llvm-objdump/common-symbol-elf.test b/llvm/test/tools/llvm-objdump/common-symbol-elf.test --- a/llvm/test/tools/llvm-objdump/common-symbol-elf.test +++ b/llvm/test/tools/llvm-objdump/common-symbol-elf.test @@ -1,3 +1,3 @@ // RUN: llvm-objdump -t %p/Inputs/common-symbol-elf | FileCheck %s -CHECK: 00000400 g O *COM* 00000008 common_symbol +CHECK: 00000400 O *COM* 00000008 common_symbol diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp --- a/llvm/tools/llvm-objdump/llvm-objdump.cpp +++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp @@ -1898,7 +1898,7 @@ bool Hidden = Flags & SymbolRef::SF_Hidden; char GlobLoc = ' '; - if (Type != SymbolRef::ST_Unknown) + if ((Section != O->section_end() || Absolute) && !Weak) GlobLoc = Global ? 'g' : 'l'; char Debug = (Type == SymbolRef::ST_Debug || Type == SymbolRef::ST_File) ? 'd' : ' ';