[llvm] f9a0056 - [llvm-objdump] --syms: make flags closer to GNU objdump
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 5 10:00:06 PST 2020
Author: Fangrui Song
Date: 2020-03-05T09:59:53-08:00
New Revision: f9a0056016fb89c84b5663642d0c836430a3ad87
URL: https://github.com/llvm/llvm-project/commit/f9a0056016fb89c84b5663642d0c836430a3ad87
DIFF: https://github.com/llvm/llvm-project/commit/f9a0056016fb89c84b5663642d0c836430a3ad87.diff
LOG: [llvm-objdump] --syms: make flags closer to GNU objdump
This fixes several issues. The behavior changes are:
A SHN_COMMON symbol does not have the 'g' flag.
An undefined symbol does not have 'g' or 'l' flag.
A STB_GLOBAL SymbolRef::ST_Unknown symbol has the 'g' flag.
A STB_LOCAL SymbolRef::ST_Unknown symbol has the 'l' flag.
Reviewed By: rupprecht
Differential Revision: https://reviews.llvm.org/D75659
Added:
Modified:
lld/test/ELF/arm-target1.s
lld/test/ELF/bss-start-common.s
lld/test/ELF/edata-etext.s
lld/test/ELF/edata-no-bss.s
lld/test/ELF/i386-pc8-pc16-addend.s
lld/test/ELF/i386-reloc8-reloc16-addend.s
lld/test/ELF/linkerscript/absolute2.s
lld/test/ELF/linkerscript/align4.test
lld/test/ELF/linkerscript/align5.test
lld/test/ELF/linkerscript/data-commands-gc.s
lld/test/ELF/linkerscript/loadaddr.s
lld/test/ELF/linkerscript/symbol-only.test
lld/test/ELF/linkerscript/symbol-reserved.s
lld/test/ELF/linkerscript/symbolreferenced.s
lld/test/ELF/linkerscript/symbols-non-alloc.test
lld/test/ELF/linkerscript/symbols.s
lld/test/ELF/linkerscript/synthetic-symbols1.test
lld/test/ELF/linkerscript/synthetic-symbols3.test
lld/test/ELF/linkerscript/synthetic-symbols4.test
lld/test/ELF/mips-32.s
lld/test/ELF/mips-64-got.s
lld/test/ELF/mips-64-rels.s
lld/test/ELF/mips-64.s
lld/test/ELF/mips-got16-relocatable.s
lld/test/ELF/mips-got16.s
lld/test/ELF/mips-gp-disp.s
lld/test/ELF/mips-gp-ext.s
lld/test/ELF/mips-gp-local.s
lld/test/ELF/mips-gprel32-relocs-gp0.s
lld/test/ELF/mips-gprel32-relocs.s
lld/test/ELF/mips-hilo-gp-disp.s
lld/test/ELF/mips-hilo-hi-only.s
lld/test/ELF/mips-hilo.s
lld/test/ELF/mips-mgot.s
lld/test/ELF/mips-micro-cross-calls.s
lld/test/ELF/mips-micro-relocs.s
lld/test/ELF/mips-micror6-relocs.s
lld/test/ELF/mips-n32-rels.s
lld/test/ELF/mips-nonalloc.s
lld/test/ELF/mips-pc-relocs.s
lld/test/ELF/mips-tls-64.s
lld/test/ELF/mips-tls-static-64.s
lld/test/ELF/mips-tls-static.s
lld/test/ELF/mips-tls.s
lld/test/ELF/wrap-no-real.s
llvm/test/MC/AArch64/inst-directive.s
llvm/test/MC/AArch64/mapping-across-sections.s
llvm/test/MC/ARM/mapping-initial.s
llvm/test/MC/ARM/mapping-within-section.s
llvm/test/MC/ARM/multi-section-mapping.s
llvm/test/MC/ARM/relocated-mapping.s
llvm/test/MC/AsmParser/defsym.s
llvm/test/MC/Hexagon/common-redeclare.s
llvm/test/MC/Hexagon/offset.s
llvm/test/tools/llvm-objdump/WebAssembly/symbol-table.test
llvm/test/tools/llvm-objdump/X86/adjust-vma.test
llvm/test/tools/llvm-objdump/X86/out-of-section-sym.test
llvm/test/tools/llvm-objdump/common-symbol-elf.test
llvm/tools/llvm-objdump/llvm-objdump.cpp
Removed:
################################################################################
diff --git a/lld/test/ELF/arm-target1.s b/lld/test/ELF/arm-target1.s
index 3bd8cb645dc2..95df5611158f 100644
--- 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/bss-start-common.s b/lld/test/ELF/bss-start-common.s
index 62b9ead699db..afb157f3521c 100644
--- a/lld/test/ELF/bss-start-common.s
+++ b/lld/test/ELF/bss-start-common.s
@@ -9,7 +9,7 @@
# CHECK: Idx Name Size VMA Type
# CHECK: 2 .bss 00000004 [[ADDR:[0-za-f]+]] BSS
# CHECK: SYMBOL TABLE:
-# CHECK: [[ADDR]] .bss 0000000000000000 __bss_start
+# CHECK: [[ADDR]] g .bss 0000000000000000 __bss_start
.global __bss_start
.text
diff --git a/lld/test/ELF/edata-etext.s b/lld/test/ELF/edata-etext.s
index 99a571a0cd65..f7048c310290 100644
--- 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
index bc459ab3d462..c5f0c776d8c7 100644
--- 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/lld/test/ELF/i386-pc8-pc16-addend.s b/lld/test/ELF/i386-pc8-pc16-addend.s
index 5660f012265b..f71eba27ba17 100644
--- a/lld/test/ELF/i386-pc8-pc16-addend.s
+++ b/lld/test/ELF/i386-pc8-pc16-addend.s
@@ -4,7 +4,7 @@
# RUN: ld.lld %t1.o -o %t.out
# RUN: llvm-objdump -s -t %t.out | FileCheck %s
# CHECK: SYMBOL TABLE:
-# CHECK: 004010b7 .und
+# CHECK: 004010b7 l .und
# CHECK: Contents of section .text:
# CHECK-NEXT: 4010b4 020000
## 0x4010b7 - 0x4010b4 + addend(-1) = 0x02
diff --git a/lld/test/ELF/i386-reloc8-reloc16-addend.s b/lld/test/ELF/i386-reloc8-reloc16-addend.s
index 0fb71241293e..b86654c6429d 100644
--- a/lld/test/ELF/i386-reloc8-reloc16-addend.s
+++ b/lld/test/ELF/i386-reloc8-reloc16-addend.s
@@ -5,8 +5,8 @@
# RUN: llvm-objdump -s -t %t.out | FileCheck %s
## 0x3 + addend(-1) = 0x02
## 0x3 + addend(-2) = 0x0100
-# CHECK: SYMBOL TABLE:
-# CHECK: 00000003 .und
+# CHECK: SYMBOL TABLE:
+# CHECK-NEXT: 00000003 l .und 00000000 und
# CHECK: Contents of section .text:
# CHECK-NEXT: 0000 020100
diff --git a/lld/test/ELF/linkerscript/absolute2.s b/lld/test/ELF/linkerscript/absolute2.s
index 5c5dfe9ebd57..33158545fe61 100644
--- a/lld/test/ELF/linkerscript/absolute2.s
+++ b/lld/test/ELF/linkerscript/absolute2.s
@@ -9,8 +9,8 @@
# RUN: ld.lld -o %t --script %t.script %t.o
# RUN: llvm-objdump -t %t | FileCheck %s
-# CHECK: 0000000000000001 .text 0000000000000000 _start
-# CHECK: 0000000000000002 .text 0000000000000000 foo
+# CHECK: 0000000000000001 g .text 0000000000000000 _start
+# CHECK: 0000000000000002 g .text 0000000000000000 foo
.global _start
nop
diff --git a/lld/test/ELF/linkerscript/align4.test b/lld/test/ELF/linkerscript/align4.test
index 70ec4b2483cc..670280bb748b 100644
--- a/lld/test/ELF/linkerscript/align4.test
+++ b/lld/test/ELF/linkerscript/align4.test
@@ -4,11 +4,11 @@
# RUN: llvm-objdump -t %t | FileCheck %s
# CHECK-LABEL: SYMBOL TABLE:
-# CHECK-NEXT: 0000000000014008 .text 0000000000000000 _start
-# CHECK-NEXT: 0000000000010000 *ABS* 0000000000000000 __code_base__
-# CHECK-NEXT: 0000000000001000 *ABS* 0000000000000000 VAR
-# CHECK-NEXT: 0000000000011000 .bbb 0000000000000000 __start_bbb
-# CHECK-NEXT: 0000000000012000 .bbb 0000000000000000 __end_bbb
+# CHECK-NEXT: 0000000000014008 g .text 0000000000000000 _start
+# CHECK-NEXT: 0000000000010000 g *ABS* 0000000000000000 __code_base__
+# CHECK-NEXT: 0000000000001000 g *ABS* 0000000000000000 VAR
+# CHECK-NEXT: 0000000000011000 g .bbb 0000000000000000 __start_bbb
+# CHECK-NEXT: 0000000000012000 g .bbb 0000000000000000 __end_bbb
VAR = 0x1000;
__code_base__ = 0x10000;
diff --git a/lld/test/ELF/linkerscript/align5.test b/lld/test/ELF/linkerscript/align5.test
index 3c687e018238..4daa4d86eaf2 100644
--- a/lld/test/ELF/linkerscript/align5.test
+++ b/lld/test/ELF/linkerscript/align5.test
@@ -17,7 +17,7 @@ SECTIONS {
.text : { *(.text); }
}
-# CHECK: 0000000000001000 .aaa 0000000000000000 foo
-# CHECK: 0000000000001000 .aaa 0000000000000000 bar
-# CHECK: 0000000000001001 .aaa 0000000000000000 zed1
-# CHECK: 0000000000000fff .aaa 0000000000000000 zed2
+# CHECK: 0000000000001000 g .aaa 0000000000000000 foo
+# CHECK: 0000000000001000 g .aaa 0000000000000000 bar
+# CHECK: 0000000000001001 g .aaa 0000000000000000 zed1
+# CHECK: 0000000000000fff g .aaa 0000000000000000 zed2
diff --git a/lld/test/ELF/linkerscript/data-commands-gc.s b/lld/test/ELF/linkerscript/data-commands-gc.s
index 2f54b887f07f..0add6ba27e94 100644
--- a/lld/test/ELF/linkerscript/data-commands-gc.s
+++ b/lld/test/ELF/linkerscript/data-commands-gc.s
@@ -4,7 +4,7 @@
# RUN: ld.lld --gc-sections -o %t %t.o --script %t.script
# RUN: llvm-objdump -t %t | FileCheck %s
-# CHECK: 0000000000000008 .rodata 0000000000000000 bar
+# CHECK: 0000000000000008 g .rodata 0000000000000000 bar
.section .rodata.bar
.quad 0x1122334455667788
diff --git a/lld/test/ELF/linkerscript/loadaddr.s b/lld/test/ELF/linkerscript/loadaddr.s
index 77d22fd20f6e..055b7422baeb 100644
--- a/lld/test/ELF/linkerscript/loadaddr.s
+++ b/lld/test/ELF/linkerscript/loadaddr.s
@@ -18,11 +18,11 @@
# RUN: echo "SECTIONS { v = LOADADDR(.zzz); }" > %t.script
# RUN: not ld.lld %t --script %t.script -o /dev/null 2>&1 | FileCheck --check-prefix=ERROR %s
-# CHECK: 0000000000002000 *ABS* 0000000000000000 aaa_lma
-# CHECK-NEXT: 0000000000002008 *ABS* 0000000000000000 bbb_lma
-# CHECK-NEXT: 0000000000003000 *ABS* 0000000000000000 ccc_lma
-# CHECK-NEXT: 0000000000004000 *ABS* 0000000000000000 ddd_lma
-# CHECK-NEXT: 0000000000004008 *ABS* 0000000000000000 txt_lma
+# CHECK: 0000000000002000 g *ABS* 0000000000000000 aaa_lma
+# CHECK-NEXT: 0000000000002008 g *ABS* 0000000000000000 bbb_lma
+# CHECK-NEXT: 0000000000003000 g *ABS* 0000000000000000 ccc_lma
+# CHECK-NEXT: 0000000000004000 g *ABS* 0000000000000000 ddd_lma
+# CHECK-NEXT: 0000000000004008 g *ABS* 0000000000000000 txt_lma
# ERROR: {{.*}}.script:1: undefined section .zzz
.global _start
diff --git a/lld/test/ELF/linkerscript/symbol-only.test b/lld/test/ELF/linkerscript/symbol-only.test
index 61452483df5b..b8101d851ca7 100644
--- a/lld/test/ELF/linkerscript/symbol-only.test
+++ b/lld/test/ELF/linkerscript/symbol-only.test
@@ -18,4 +18,4 @@ SECTIONS {
# CHECK: bar 00000000 0000000000001000
# CHECK: SYMBOL TABLE:
-# CHECK: [[ADDR]] abc 0000000000000000 foo
+# CHECK: [[ADDR]] g abc 0000000000000000 foo
diff --git a/lld/test/ELF/linkerscript/symbol-reserved.s b/lld/test/ELF/linkerscript/symbol-reserved.s
index 52cd4e0c654e..740213457d97 100644
--- a/lld/test/ELF/linkerscript/symbol-reserved.s
+++ b/lld/test/ELF/linkerscript/symbol-reserved.s
@@ -7,46 +7,46 @@
# RUN: ld.lld -o %t1 %t.script %t
# RUN: llvm-objdump -t %t1 | FileCheck %s
-# CHECK: 0000000000200005 .text 0000000000000000 .hidden newsym
+# CHECK: 0000000000200005 l .text 0000000000000000 .hidden newsym
# RUN: ld.lld -o %t1.so %t.script %t -shared
# RUN: llvm-objdump -t %t1.so | FileCheck --check-prefix=SHARED %s
-# SHARED: 0000000000000005 .dynsym 0000000000000000 .hidden newsym
+# SHARED: 0000000000000005 l .dynsym 0000000000000000 .hidden newsym
# RUN: echo "PROVIDE_HIDDEN(newsym = ALIGN(__ehdr_start, CONSTANT(MAXPAGESIZE)) + 5);" > %t.script
# RUN: ld.lld -o %t1 %t.script %t
# RUN: llvm-objdump -t %t1 | FileCheck --check-prefix=ALIGNED %s
-# ALIGNED: 0000000000200005 .text 0000000000000000 .hidden newsym
+# ALIGNED: 0000000000200005 l .text 0000000000000000 .hidden newsym
# RUN: echo "PROVIDE_HIDDEN(newsym = ALIGN(3, 8) + 10);" > %t.script
# RUN: ld.lld -o %t1 %t.script %t
# RUN: llvm-objdump -t %t1 | FileCheck --check-prefix=ALIGN-ADD %s
-# ALIGN-ADD: 0000000000000012 *ABS* 0000000000000000 .hidden newsym
+# ALIGN-ADD: 0000000000000012 l *ABS* 0000000000000000 .hidden newsym
# RUN: echo "PROVIDE_HIDDEN(newsym = ALIGN(11, 8) - 10);" > %t.script
# RUN: ld.lld -o %t1 %t.script %t
# RUN: llvm-objdump -t %t1 | FileCheck --check-prefix=ALIGN-SUB %s
-# ALIGN-SUB: 0000000000000006 *ABS* 0000000000000000 .hidden newsym
+# ALIGN-SUB: 0000000000000006 l *ABS* 0000000000000000 .hidden newsym
# RUN: echo "PROVIDE_HIDDEN(newsym = ALIGN(_end, CONSTANT(MAXPAGESIZE)) + 5);" > %t.script
# RUN: ld.lld -o %t1 %t %t.script
# RUN: llvm-objdump -t %t1 | FileCheck --check-prefix=RELATIVE %s
-# RELATIVE: 0000000000202005 .text 0000000000000000 .hidden newsym
-# RELATIVE: 0000000000201127 .text 0000000000000000 _end
+# RELATIVE: 0000000000202005 l .text 0000000000000000 .hidden newsym
+# RELATIVE: 0000000000201127 g .text 0000000000000000 _end
# RUN: echo "PROVIDE_HIDDEN(newsym = ALIGN(_end, CONSTANT(MAXPAGESIZE)) + 5);" > %t.script
# RUN: ld.lld -o %t1 --script %p/Inputs/symbol-reserved.script %t %t.script
# RUN: llvm-objdump -t %t1 | FileCheck --check-prefix=RELATIVE-ADD %s
-# RELATIVE-ADD: 0000000000001005 .text 0000000000000000 .hidden newsym
-# RELATIVE-ADD: 0000000000000007 .text 0000000000000000 .hidden _end
+# RELATIVE-ADD: 0000000000001005 l .text 0000000000000000 .hidden newsym
+# RELATIVE-ADD: 0000000000000007 l .text 0000000000000000 .hidden _end
# RUN: echo "PROVIDE_HIDDEN(newsym = ALIGN(_end, CONSTANT(MAXPAGESIZE)) - 5);" > %t.script
# RUN: ld.lld -o %t1 --script %p/Inputs/symbol-reserved.script %t %t.script
# RUN: llvm-objdump -t %t1 | FileCheck --check-prefix=RELATIVE-SUB %s
-# RELATIVE-SUB: 0000000000000ffb .text 0000000000000000 .hidden newsym
-# RELATIVE-SUB: 0000000000000007 .text 0000000000000000 .hidden _end
+# RELATIVE-SUB: 0000000000000ffb l .text 0000000000000000 .hidden newsym
+# RELATIVE-SUB: 0000000000000007 l .text 0000000000000000 .hidden _end
.global _start
_start:
diff --git a/lld/test/ELF/linkerscript/symbolreferenced.s b/lld/test/ELF/linkerscript/symbolreferenced.s
index 7b6c5d099188..ac8a88855d91 100644
--- a/lld/test/ELF/linkerscript/symbolreferenced.s
+++ b/lld/test/ELF/linkerscript/symbolreferenced.s
@@ -5,13 +5,13 @@
# RUN: echo "SECTIONS { PROVIDE(newsym = 1);}" > %t.script
# RUN: ld.lld -o %t1 --script %t.script %t
# RUN: llvm-objdump -t %t1 | FileCheck --check-prefix=PROVIDE1 %s
-# PROVIDE1: 0000000000000001 *ABS* 0000000000000000 newsym
+# PROVIDE1: 0000000000000001 g *ABS* 0000000000000000 newsym
# Provide new symbol (hidden). The value should be 1
# RUN: echo "SECTIONS { PROVIDE_HIDDEN(newsym = 1);}" > %t.script
# RUN: ld.lld -o %t1 --script %t.script %t
# RUN: llvm-objdump -t %t1 | FileCheck --check-prefix=HIDDEN1 %s
-# HIDDEN1: 0000000000000001 *ABS* 0000000000000000 .hidden newsym
+# HIDDEN1: 0000000000000001 l *ABS* 0000000000000000 .hidden newsym
.global _start
_start:
diff --git a/lld/test/ELF/linkerscript/symbols-non-alloc.test b/lld/test/ELF/linkerscript/symbols-non-alloc.test
index 2ef378010fe3..19cc605530a3 100644
--- a/lld/test/ELF/linkerscript/symbols-non-alloc.test
+++ b/lld/test/ELF/linkerscript/symbols-non-alloc.test
@@ -8,7 +8,7 @@
# CHECK: .nonalloc 00000008 0000000000000000
# CHECK: SYMBOL TABLE:
-# CHECK: 0000000000000008 .nonalloc 0000000000000000 Sym
+# CHECK: 0000000000000008 g .nonalloc 0000000000000000 Sym
SECTIONS {
. = SIZEOF_HEADERS;
diff --git a/lld/test/ELF/linkerscript/symbols.s b/lld/test/ELF/linkerscript/symbols.s
index 71a5f648c67d..5f0ca603d884 100644
--- a/lld/test/ELF/linkerscript/symbols.s
+++ b/lld/test/ELF/linkerscript/symbols.s
@@ -25,20 +25,20 @@
# RUN: echo "SECTIONS { PROVIDE(somesym = 1);}" > %t.script
# RUN: ld.lld -o %t1 --script %t.script %t
# RUN: llvm-objdump -t %t1 | FileCheck --check-prefix=PROVIDE2 %s
-# PROVIDE2: 0000000000000000 *ABS* 0000000000000000 somesym
+# PROVIDE2: 0000000000000000 g *ABS* 0000000000000000 somesym
# Provide existing symbol. The value should be 0, even though we
# have value of 1 in PROVIDE_HIDDEN(). Visibility should not change
# RUN: echo "SECTIONS { PROVIDE_HIDDEN(somesym = 1);}" > %t.script
# RUN: ld.lld -o %t1 --script %t.script %t
# RUN: llvm-objdump -t %t1 | FileCheck --check-prefix=HIDDEN2 %s
-# HIDDEN2: 0000000000000000 *ABS* 0000000000000000 somesym
+# HIDDEN2: 0000000000000000 g *ABS* 0000000000000000 somesym
# Hidden symbol assignment.
# RUN: echo "SECTIONS { HIDDEN(newsym = 1);}" > %t.script
# RUN: ld.lld -o %t1 --script %t.script %t
# RUN: llvm-objdump -t %t1 | FileCheck --check-prefix=HIDDEN3 %s
-# HIDDEN3: 0000000000000001 *ABS* 0000000000000000 .hidden newsym
+# HIDDEN3: 0000000000000001 l *ABS* 0000000000000000 .hidden newsym
# The symbol is not referenced. Don't provide it.
# RUN: echo "PROVIDE(newsym = 1);" > %t.script
@@ -55,23 +55,23 @@
# RUN: echo "PROVIDE(somesym = 1);" > %t.script
# RUN: ld.lld -o %t1 --script %t.script %t
# RUN: llvm-objdump -t %t1 | FileCheck --check-prefix=PROVIDE5 %s
-# PROVIDE5: 0000000000000000 *ABS* 0000000000000000 somesym
+# PROVIDE5: 0000000000000000 g *ABS* 0000000000000000 somesym
# Provide existing symbol. The value should be 0, even though we
# have value of 1 in PROVIDE_HIDDEN(). Visibility should not change
# RUN: echo "PROVIDE_HIDDEN(somesym = 1);" > %t.script
# RUN: ld.lld -o %t1 --script %t.script %t
# RUN: llvm-objdump -t %t1 | FileCheck --check-prefix=HIDDEN5 %s
-# HIDDEN5: 0000000000000000 *ABS* 0000000000000000 somesym
+# HIDDEN5: 0000000000000000 g *ABS* 0000000000000000 somesym
# Simple symbol assignment. All three symbols should have the
# same value.
# RUN: echo "foo = 0x100; SECTIONS { bar = foo; } baz = bar;" > %t.script
# RUN: ld.lld -o %t1 --script %t.script %t
# RUN: llvm-objdump -t %t1 | FileCheck --check-prefix=SIMPLE2 %s
-# SIMPLE2: 0000000000000100 *ABS* 0000000000000000 foo
-# SIMPLE2: 0000000000000100 *ABS* 0000000000000000 bar
-# SIMPLE2: 0000000000000100 *ABS* 0000000000000000 baz
+# SIMPLE2: 0000000000000100 g *ABS* 0000000000000000 foo
+# SIMPLE2: 0000000000000100 g *ABS* 0000000000000000 bar
+# SIMPLE2: 0000000000000100 g *ABS* 0000000000000000 baz
.global _start
_start:
diff --git a/lld/test/ELF/linkerscript/synthetic-symbols1.test b/lld/test/ELF/linkerscript/synthetic-symbols1.test
index cd9f078a8bcf..36b526534da1 100644
--- a/lld/test/ELF/linkerscript/synthetic-symbols1.test
+++ b/lld/test/ELF/linkerscript/synthetic-symbols1.test
@@ -38,19 +38,19 @@ SECTIONS {
.eh_frame : {}
}
-# CHECK: 0000000000000128 .foo 0000000000000000 .hidden _end_sec
-# CHECK-NEXT: 0000000000000120 .foo 0000000000000000 _begin_sec
-# CHECK-NEXT: 0000000000000128 *ABS* 0000000000000000 _end_sec_abs
-# CHECK-NEXT: 000000000000104c .text 0000000000000000 _start
-# CHECK-NEXT: 0000000000000120 .foo 0000000000000000 begin_foo
-# CHECK-NEXT: 0000000000000128 .foo 0000000000000000 end_foo
-# CHECK-NEXT: 0000000000000008 *ABS* 0000000000000000 size_foo_1
-# CHECK-NEXT: 0000000000000008 *ABS* 0000000000000000 size_foo_1_abs
-# CHECK-NEXT: 0000000000001000 .foo 0000000000000000 begin_bar
-# CHECK-NEXT: 0000000000001004 .foo 0000000000000000 end_bar
-# CHECK-NEXT: 0000000000000ee4 *ABS* 0000000000000000 size_foo_2
-# CHECK-NEXT: 0000000000000ee4 *ABS* 0000000000000000 size_foo_3
-# CHECK-NEXT: 0000000000001004 .eh_frame_hdr 0000000000000000 __eh_frame_hdr_start
-# CHECK-NEXT: 0000000000001010 *ABS* 0000000000000000 __eh_frame_hdr_start2
-# CHECK-NEXT: 0000000000001018 .eh_frame_hdr 0000000000000000 __eh_frame_hdr_end
-# CHECK-NEXT: 0000000000001020 *ABS* 0000000000000000 __eh_frame_hdr_end2
+# CHECK: 0000000000000128 l .foo 0000000000000000 .hidden _end_sec
+# CHECK-NEXT: 0000000000000120 g .foo 0000000000000000 _begin_sec
+# CHECK-NEXT: 0000000000000128 g *ABS* 0000000000000000 _end_sec_abs
+# CHECK-NEXT: 000000000000104c g .text 0000000000000000 _start
+# CHECK-NEXT: 0000000000000120 g .foo 0000000000000000 begin_foo
+# CHECK-NEXT: 0000000000000128 g .foo 0000000000000000 end_foo
+# CHECK-NEXT: 0000000000000008 g *ABS* 0000000000000000 size_foo_1
+# CHECK-NEXT: 0000000000000008 g *ABS* 0000000000000000 size_foo_1_abs
+# CHECK-NEXT: 0000000000001000 g .foo 0000000000000000 begin_bar
+# CHECK-NEXT: 0000000000001004 g .foo 0000000000000000 end_bar
+# CHECK-NEXT: 0000000000000ee4 g *ABS* 0000000000000000 size_foo_2
+# CHECK-NEXT: 0000000000000ee4 g *ABS* 0000000000000000 size_foo_3
+# CHECK-NEXT: 0000000000001004 g .eh_frame_hdr 0000000000000000 __eh_frame_hdr_start
+# CHECK-NEXT: 0000000000001010 g *ABS* 0000000000000000 __eh_frame_hdr_start2
+# CHECK-NEXT: 0000000000001018 g .eh_frame_hdr 0000000000000000 __eh_frame_hdr_end
+# CHECK-NEXT: 0000000000001020 g *ABS* 0000000000000000 __eh_frame_hdr_end2
diff --git a/lld/test/ELF/linkerscript/synthetic-symbols3.test b/lld/test/ELF/linkerscript/synthetic-symbols3.test
index 4835c4a36e37..281e1a26c4d0 100644
--- a/lld/test/ELF/linkerscript/synthetic-symbols3.test
+++ b/lld/test/ELF/linkerscript/synthetic-symbols3.test
@@ -7,5 +7,5 @@
PROVIDE_HIDDEN(_begin_sec = _start);
PROVIDE_HIDDEN(_end_sec = ADDR(.text) + SIZEOF(.text));
-# CHECK: 00000000002011ac .text 0000000000000000 .hidden _begin_sec
-# CHECK-NEXT: 00000000002011ad .text 0000000000000000 .hidden _end_sec
+# CHECK: 00000000002011ac l .text 0000000000000000 .hidden _begin_sec
+# CHECK-NEXT: 00000000002011ad l .text 0000000000000000 .hidden _end_sec
diff --git a/lld/test/ELF/linkerscript/synthetic-symbols4.test b/lld/test/ELF/linkerscript/synthetic-symbols4.test
index db1a96fa52ce..fa43e3cfcf03 100644
--- a/lld/test/ELF/linkerscript/synthetic-symbols4.test
+++ b/lld/test/ELF/linkerscript/synthetic-symbols4.test
@@ -10,5 +10,5 @@ SECTIONS {
PROVIDE_HIDDEN(_end_sec = ADDR(.text) + SIZEOF(.text));
}
-# CHECK: 0000000000201054 .text 0000000000000000 .hidden _begin_sec
-# CHECK-NEXT: 0000000000201055 .text 0000000000000000 .hidden _end_sec
+# CHECK: 0000000000201054 l .text 0000000000000000 .hidden _begin_sec
+# CHECK-NEXT: 0000000000201055 l .text 0000000000000000 .hidden _end_sec
diff --git a/lld/test/ELF/mips-32.s b/lld/test/ELF/mips-32.s
index c856e9dbdd7b..af9db0108dad 100644
--- a/lld/test/ELF/mips-32.s
+++ b/lld/test/ELF/mips-32.s
@@ -25,7 +25,7 @@ v2:
.word v1 # R_MIPS_32 target v1 addend 0
# SYM: SYMBOL TABLE:
-# SYM: 00011000 .data 00000000 v1
+# SYM: 00011000 l .data 00000000 v1
# BE: Contents of section .data:
# BE-NEXT: {{.*}} 00000004 00011000
diff --git a/lld/test/ELF/mips-64-got.s b/lld/test/ELF/mips-64-got.s
index 33011be0ccf5..f7bd38743bdf 100644
--- a/lld/test/ELF/mips-64-got.s
+++ b/lld/test/ELF/mips-64-got.s
@@ -10,7 +10,7 @@
# RUN: llvm-objdump -d -t --no-show-raw-insn %t.exe | FileCheck %s
# RUN: llvm-readelf -r -s -A %t.exe | FileCheck -check-prefix=GOT %s
-# CHECK: {{[0-9a-f]+}}1c8 .text 0000000000000000 foo
+# CHECK: {{[0-9a-f]+}}1c8 l .text 0000000000000000 foo
# CHECK: __start:
# CHECK-NEXT: {{.*}} ld $2, -32736($gp)
diff --git a/lld/test/ELF/mips-64-rels.s b/lld/test/ELF/mips-64-rels.s
index fa7b87c69b4d..bd4fd1bfed76 100644
--- a/lld/test/ELF/mips-64-rels.s
+++ b/lld/test/ELF/mips-64-rels.s
@@ -11,7 +11,7 @@
# RUN: llvm-objdump -d -s -t --print-imm-hex --no-show-raw-insn %t.exe | FileCheck %s
# RUN: llvm-readobj -r %t.exe | FileCheck -check-prefix=REL %s
-# CHECK: 0000000000037ff0 .got 0000000000000000 .hidden _gp
+# CHECK: 0000000000037ff0 l .got 0000000000000000 .hidden _gp
# CHECK: Contents of section .rodata:
# CHECK-NEXT: {{[0-9a-f]+}} ffffffff fffe9014
diff --git a/lld/test/ELF/mips-64.s b/lld/test/ELF/mips-64.s
index 4db845857bbc..45a88ea968d9 100644
--- a/lld/test/ELF/mips-64.s
+++ b/lld/test/ELF/mips-64.s
@@ -14,7 +14,7 @@ v2:
.quad v1 # R_MIPS_64 target v1 addend 0
# SYM: SYMBOL TABLE:
-# SYM: 00000000[[V1:[0-9a-f]+]] .data 0000000000000000 v1
+# SYM: 00000000[[V1:[0-9a-f]+]] l .data 0000000000000000 v1
# SYM: Contents of section .data:
# SYM-NEXT: {{.*}} 00000000 00000008 00000000 [[V1]]
diff --git a/lld/test/ELF/mips-got16-relocatable.s b/lld/test/ELF/mips-got16-relocatable.s
index e07a6264827e..b48d91aee28e 100644
--- a/lld/test/ELF/mips-got16-relocatable.s
+++ b/lld/test/ELF/mips-got16-relocatable.s
@@ -22,8 +22,8 @@
# OBJ-NEXT: 00000014: R_MIPS_LO16 .data
# SO: SYMBOL TABLE
-# SO: {{0*}}[[D1:[0-9a-f]{1,4}]] .data {{0+}} data
-# SO: {{0*}}[[D2:[0-9a-f]{1,4}]] .data {{0+}} data
+# SO: {{0*}}[[D1:[0-9a-f]{1,4}]] l .data {{0+}} data
+# SO: {{0*}}[[D2:[0-9a-f]{1,4}]] l .data {{0+}} data
# SO: Disassembly of section .text:
# SO-EMPTY:
diff --git a/lld/test/ELF/mips-got16.s b/lld/test/ELF/mips-got16.s
index c2405fcd9376..de7aaaceec58 100644
--- a/lld/test/ELF/mips-got16.s
+++ b/lld/test/ELF/mips-got16.s
@@ -11,7 +11,7 @@
# RUN: llvm-readelf -r -A %t.so | FileCheck -check-prefix=GOT %s
# CHECK: SYMBOL TABLE:
-# CHECK: 00024008 .data 00000000 .hidden bar
+# CHECK: 00024008 l .data 00000000 .hidden bar
# CHECK: 00000000 *UND* 00000000 foo
# CHECK: __start:
diff --git a/lld/test/ELF/mips-gp-disp.s b/lld/test/ELF/mips-gp-disp.s
index 30f3a59eef32..deda9c6aeed5 100644
--- a/lld/test/ELF/mips-gp-disp.s
+++ b/lld/test/ELF/mips-gp-disp.s
@@ -17,8 +17,8 @@
# INT-SO: 00000000 0 NOTYPE LOCAL HIDDEN ABS _gp_disp
# EXT-SO: 00020000 0 NOTYPE GLOBAL DEFAULT 9 _gp_disp
-# DIS: 00037ff0 .got 00000000 .hidden _gp
-# DIS: 00002000 .text 00000000 __start
+# DIS: 00037ff0 l .got 00000000 .hidden _gp
+# DIS: 00002000 g .text 00000000 __start
# DIS: Disassembly of section .text:
# DIS-EMPTY:
# DIS-NEXT: __start:
diff --git a/lld/test/ELF/mips-gp-ext.s b/lld/test/ELF/mips-gp-ext.s
index 14fcbf818b20..c9b66be25659 100644
--- a/lld/test/ELF/mips-gp-ext.s
+++ b/lld/test/ELF/mips-gp-ext.s
@@ -25,9 +25,9 @@
# RUN: ld.lld -shared -o %t.abs.so --script %t.abs.script %t.o
# RUN: llvm-objdump -s -t %t.abs.so | FileCheck --check-prefix=ABS %s
-# REL: 000000e0 .text 00000000 foo
-# REL: 00000000 *ABS* 00000000 .hidden _gp_disp
-# REL: 000001ec *ABS* 00000000 .hidden _gp
+# REL: 000000e0 l .text 00000000 foo
+# REL: 00000000 l *ABS* 00000000 .hidden _gp_disp
+# REL: 000001ec l *ABS* 00000000 .hidden _gp
# REL: Contents of section .reginfo:
# REL-NEXT: 0018 10000104 00000000 00000000 00000000
@@ -46,9 +46,9 @@
# ^-- 0x30-0x1ec
# foo - GP
-# ABS: 000000e0 .text 00000000 foo
-# ABS: 00000000 *ABS* 00000000 .hidden _gp_disp
-# ABS: 00000200 *ABS* 00000000 .hidden _gp
+# ABS: 000000e0 l .text 00000000 foo
+# ABS: 00000000 l *ABS* 00000000 .hidden _gp_disp
+# ABS: 00000200 l *ABS* 00000000 .hidden _gp
# ABS: Contents of section .reginfo:
# ABS-NEXT: 0018 10000104 00000000 00000000 00000000
diff --git a/lld/test/ELF/mips-gp-local.s b/lld/test/ELF/mips-gp-local.s
index 00a66f203527..0ff7440e5e39 100644
--- a/lld/test/ELF/mips-gp-local.s
+++ b/lld/test/ELF/mips-gp-local.s
@@ -9,8 +9,8 @@
# RUN: ld.lld --script %t.script -o %t.exe %t.o
# RUN: llvm-objdump -d -t --no-show-raw-insn %t.exe | FileCheck %s
-# CHECK: 00037ff0 .got 00000000 .hidden _gp
-# CHECK: 00011000 .text 00000000 __start
+# CHECK: 00037ff0 l .got 00000000 .hidden _gp
+# CHECK: 00011000 g .text 00000000 __start
# CHECK: __start:
# CHECK-NEXT: lui $8, 3
diff --git a/lld/test/ELF/mips-gprel32-relocs-gp0.s b/lld/test/ELF/mips-gprel32-relocs-gp0.s
index 1532f14304a5..f26237e905cd 100644
--- a/lld/test/ELF/mips-gprel32-relocs-gp0.s
+++ b/lld/test/ELF/mips-gprel32-relocs-gp0.s
@@ -15,9 +15,9 @@
# REL: GP: 0x0
# DUMP: SYMBOL TABLE:
-# DUMP: 00020008 .text 00000000 bar
-# DUMP: 00020004 .text 00000000 foo
-# DUMP: 00028000 .got 00000000 .hidden _gp
+# DUMP: 00020008 l .text 00000000 bar
+# DUMP: 00020004 l .text 00000000 foo
+# DUMP: 00028000 l .got 00000000 .hidden _gp
# DUMP: Contents of section .rodata:
# DUMP: 1000 fffffff4 fffffff8
diff --git a/lld/test/ELF/mips-gprel32-relocs.s b/lld/test/ELF/mips-gprel32-relocs.s
index 070e683a437d..4087d306dde8 100644
--- a/lld/test/ELF/mips-gprel32-relocs.s
+++ b/lld/test/ELF/mips-gprel32-relocs.s
@@ -24,9 +24,9 @@ v1:
.gpword bar
# CHECK: SYMBOL TABLE:
-# CHECK: 00020008 .text 00000000 bar
-# CHECK: 00020004 .text 00000000 foo
-# CHECK: 00028000 .got 00000000 .hidden _gp
+# CHECK: 00020008 l .text 00000000 bar
+# CHECK: 00020004 l .text 00000000 foo
+# CHECK: 00028000 l .got 00000000 .hidden _gp
# CHECK: Contents of section .rodata:
# CHECK: 1000 ffff8004 ffff8008
diff --git a/lld/test/ELF/mips-hilo-gp-disp.s b/lld/test/ELF/mips-hilo-gp-disp.s
index f4bce0403a6f..9e3b26ad1d83 100644
--- a/lld/test/ELF/mips-hilo-gp-disp.s
+++ b/lld/test/ELF/mips-hilo-gp-disp.s
@@ -24,9 +24,9 @@ bar:
addi $t0,$t0,%lo(_gp_disp)
# CHECK: SYMBOL TABLE:
-# CHECK: 0001100c .text 00000000 bar
-# CHECK: 00037ff0 .got 00000000 .hidden _gp
-# CHECK: 00011000 .text 00000000 __start
+# CHECK: 0001100c l .text 00000000 bar
+# CHECK: 00037ff0 l .got 00000000 .hidden _gp
+# CHECK: 00011000 g .text 00000000 __start
# CHECK: Disassembly of section .text:
# CHECK-EMPTY:
diff --git a/lld/test/ELF/mips-hilo-hi-only.s b/lld/test/ELF/mips-hilo-hi-only.s
index 0a82ee8e5320..f9fca07d5a34 100644
--- a/lld/test/ELF/mips-hilo-hi-only.s
+++ b/lld/test/ELF/mips-hilo-hi-only.s
@@ -16,8 +16,8 @@ _label:
# WARN: can't find matching R_MIPS_LO16 relocation for R_MIPS_HI16
# CHECK: SYMBOL TABLE:
-# CHECK: 00020{{0*}}[[VAL:[0-9a-f]+]] .text 00000000 _label
-# CHECK: 00020{{.*}} .text 00000000 __start
+# CHECK: 00020{{0*}}[[VAL:[0-9a-f]+]] l .text 00000000 _label
+# CHECK: 00020{{.*}} g .text 00000000 __start
# CHECK: __start:
# CHECK-NEXT: lui $8, 0x3
diff --git a/lld/test/ELF/mips-hilo.s b/lld/test/ELF/mips-hilo.s
index e0e46b733c91..d25e2682b4a4 100644
--- a/lld/test/ELF/mips-hilo.s
+++ b/lld/test/ELF/mips-hilo.s
@@ -32,7 +32,7 @@ g1:
# CHECK: SYMBOL TABLE:
# CHECK: 0021020 l O .data 00000004 l1
-# CHECK: 0021000 .text 00000000 __start
+# CHECK: 0021000 g .text 00000000 __start
# CHECK: 0021024 g O .data 00000004 g1
# CHECK: __start:
diff --git a/lld/test/ELF/mips-mgot.s b/lld/test/ELF/mips-mgot.s
index 696301d91a22..597517cca2a3 100644
--- a/lld/test/ELF/mips-mgot.s
+++ b/lld/test/ELF/mips-mgot.s
@@ -16,10 +16,10 @@
# CHECK: SYMBOL TABLE:
# CHECK: 00000000 l O .tdata 00000000 loc0
-# CHECK: [[FOO0:[0-9a-f]+]] .text 00000000 foo0
+# CHECK: [[FOO0:[0-9a-f]+]] g .text 00000000 foo0
# CHECK: 00000000 g O .tdata 00000000 tls0
# CHECK: 00000004 g O .tdata 00000000 tls1
-# CHECK: [[FOO2:[0-9a-f]+]] .text 00000000 foo2
+# CHECK: [[FOO2:[0-9a-f]+]] g .text 00000000 foo2
# CHECK: Contents of section .got:
# CHECK-NEXT: 70000 00000000 80000000 [[FOO0]] [[FOO2]]
diff --git a/lld/test/ELF/mips-micro-cross-calls.s b/lld/test/ELF/mips-micro-cross-calls.s
index 52fa87da2510..973292d08ef7 100644
--- a/lld/test/ELF/mips-micro-cross-calls.s
+++ b/lld/test/ELF/mips-micro-cross-calls.s
@@ -16,7 +16,7 @@
# REG: {{0*}}[[FOOT:[0-9a-f]+]] l F .text 0000000e 0x80 __microLA25Thunk_foo
# REG: {{0*}}[[BAR:[0-9a-f]+]] g F .text 00000000 bar
-# REG: {{0*}}[[MIC:[0-9a-f]+]] .text 00000000 0x80 micro
+# REG: {{0*}}[[MIC:[0-9a-f]+]] g .text 00000000 0x80 micro
# REG: __start:
# REG-NEXT: jalx 0x[[MIC]] <micro>
@@ -28,7 +28,7 @@
# REG-NEXT: j 0x[[BAR]] <bar>
# MICRO: {{0*}}[[BART:[0-9a-f]+]] l F .text 00000010 __LA25Thunk_bar
-# MICRO: {{0*}}[[START:[0-9a-f]+]] .text 00000000 __start
+# MICRO: {{0*}}[[START:[0-9a-f]+]] g .text 00000000 __start
# MICRO: {{0*}}[[FOO:[0-9a-f]+]] g F .text 00000000 0x80 foo
# MICRO: micro:
diff --git a/lld/test/ELF/mips-micro-relocs.s b/lld/test/ELF/mips-micro-relocs.s
index 3eb1c1ac7852..785d0227a620 100644
--- a/lld/test/ELF/mips-micro-relocs.s
+++ b/lld/test/ELF/mips-micro-relocs.s
@@ -25,9 +25,9 @@
# RUN: | FileCheck --check-prefixes=ASM,EL %s
# RUN: llvm-readelf -h %tel.exe | FileCheck --check-prefix=ELF %s
-# ASM: 00038000 .got 00000000 .hidden _gp
+# ASM: 00038000 l .got 00000000 .hidden _gp
# ASM: 00020100 g F .text 00000000 0x80 foo
-# ASM: 00020110 .text 00000000 0x80 __start
+# ASM: 00020110 g .text 00000000 0x80 __start
# EB: Contents of section .data:
# EB-NEXT: 30000 fffe8111
diff --git a/lld/test/ELF/mips-micror6-relocs.s b/lld/test/ELF/mips-micror6-relocs.s
index 29081971be32..29b75b8976d7 100644
--- a/lld/test/ELF/mips-micror6-relocs.s
+++ b/lld/test/ELF/mips-micror6-relocs.s
@@ -21,7 +21,7 @@
# RUN: | FileCheck %s
# CHECK: 00020100 g F .text 00000000 0x80 foo
-# CHECK: 00020110 .text 00000000 0x80 __start
+# CHECK: 00020110 g .text 00000000 0x80 __start
# CHECK: __start:
# CHECK-NEXT: 20110: lapc $2, -12
diff --git a/lld/test/ELF/mips-n32-rels.s b/lld/test/ELF/mips-n32-rels.s
index 5d5d620ccf4b..ac4b041617a0 100644
--- a/lld/test/ELF/mips-n32-rels.s
+++ b/lld/test/ELF/mips-n32-rels.s
@@ -26,8 +26,8 @@ loc:
.section .rodata,"a", at progbits
.gpword(loc) # R_MIPS_GPREL32
-# CHECK: 00020104 .text 00000000 loc
-# CHECK: 00028100 .got 00000000 .hidden _gp
+# CHECK: 00020104 l .text 00000000 loc
+# CHECK: 00028100 l .got 00000000 .hidden _gp
# CHECK: 00020100 g F .text 00000000 __start
# CHECK: Contents of section .rodata:
diff --git a/lld/test/ELF/mips-nonalloc.s b/lld/test/ELF/mips-nonalloc.s
index b1fa4991d4d2..7a450dc6295d 100644
--- a/lld/test/ELF/mips-nonalloc.s
+++ b/lld/test/ELF/mips-nonalloc.s
@@ -7,7 +7,7 @@
# RUN: ld.lld %t1.o %t2.o -o %t.exe
# RUN: llvm-objdump -t -s %t.exe | FileCheck %s
-# CHECK: [[SYM:[0-9a-f]+]] .text 00000000 __start
+# CHECK: [[SYM:[0-9a-f]+]] g .text 00000000 __start
# CHECK: Contents of section .debug_info:
# CHECK-NEXT: 0000 ffffffff [[SYM]] [[SYM]]
diff --git a/lld/test/ELF/mips-pc-relocs.s b/lld/test/ELF/mips-pc-relocs.s
index 6b8d93408b40..1feb9b885e5a 100644
--- a/lld/test/ELF/mips-pc-relocs.s
+++ b/lld/test/ELF/mips-pc-relocs.s
@@ -26,8 +26,8 @@ __start:
.data
.word _foo+8-. # R_MIPS_PC32
-# CHECK: 00020000 .text 00000000 __start
-# CHECK: 00020020 .text 00000000 _foo
+# CHECK: 00020000 g .text 00000000 __start
+# CHECK: 00020020 g .text 00000000 _foo
# CHECK: Contents of section .data:
# CHECK-NEXT: 30000 ffff0028 00000000 00000000 00000000
diff --git a/lld/test/ELF/mips-tls-64.s b/lld/test/ELF/mips-tls-64.s
index 4780b695065d..58cbd56f2492 100644
--- a/lld/test/ELF/mips-tls-64.s
+++ b/lld/test/ELF/mips-tls-64.s
@@ -23,7 +23,7 @@
# DIS: 0000000000000000 l O .tdata 0000000000000000 loc
# DIS: 0000000000000004 g O .tdata 0000000000000000 bar
-# DIS: 0000000000000000 g O *UND* 0000000000000000 foo
+# DIS: 0000000000000000 O *UND* 0000000000000000 foo
# DIS: Contents of section .got:
# DIS-NEXT: 30000 00000000 00000000 80000000 00000000
diff --git a/lld/test/ELF/mips-tls-static-64.s b/lld/test/ELF/mips-tls-static-64.s
index f75464bb9646..1e8b14db2329 100644
--- a/lld/test/ELF/mips-tls-static-64.s
+++ b/lld/test/ELF/mips-tls-static-64.s
@@ -7,7 +7,7 @@
# RUN: llvm-objdump -s -t %t.exe | FileCheck %s
# CHECK: SYMBOL TABLE:
-# CHECK: [[TGA:[0-9a-f]{8}]] .text 0000000000000000 __tls_get_addr
+# CHECK: [[TGA:[0-9a-f]{8}]] g .text 0000000000000000 __tls_get_addr
# CHECK: 0000000000000000 g O .tdata 0000000000000000 tls1
#
# CHECK: Contents of section .data:
diff --git a/lld/test/ELF/mips-tls-static.s b/lld/test/ELF/mips-tls-static.s
index 28b02c82c796..7801a90bb7c0 100644
--- a/lld/test/ELF/mips-tls-static.s
+++ b/lld/test/ELF/mips-tls-static.s
@@ -7,7 +7,7 @@
# RUN: llvm-objdump -s -t %t.exe | FileCheck %s
# CHECK: SYMBOL TABLE:
-# CHECK: [[TGA:[0-9a-f]+]] .text 00000000 __tls_get_addr
+# CHECK: [[TGA:[0-9a-f]+]] g .text 00000000 __tls_get_addr
# CHECK: 00000000 g O .tdata 00000000 tls1
#
# CHECK: Contents of section .data:
diff --git a/lld/test/ELF/mips-tls.s b/lld/test/ELF/mips-tls.s
index 7a8a4d5f3296..cf6a6eaba4e2 100644
--- a/lld/test/ELF/mips-tls.s
+++ b/lld/test/ELF/mips-tls.s
@@ -23,7 +23,7 @@
# DIS: 00000000 l O .tdata 00000000 loc
# DIS: 00000004 g O .tdata 00000000 bar
-# DIS: 00000000 g O *UND* 00000000 foo
+# DIS: 00000000 O *UND* 00000000 foo
# DIS: Contents of section .got:
# DIS-NEXT: 30000 00000000 80000000 00000000 ffff9004
diff --git a/lld/test/ELF/wrap-no-real.s b/lld/test/ELF/wrap-no-real.s
index 4f2f2b6dbfaf..20c68b5181d5 100644
--- a/lld/test/ELF/wrap-no-real.s
+++ b/lld/test/ELF/wrap-no-real.s
@@ -18,11 +18,11 @@
// RUN: llvm-objdump -t %t | FileCheck -check-prefix=SYM %s
-// SYM: {{.*}} .dynamic 0000000000000000 .hidden _DYNAMIC
-// SYM-NEXT: 0000000000011000 *ABS* 0000000000000000 __real_foo
-// SYM-NEXT: 0000000000011010 *ABS* 0000000000000000 __wrap_foo
-// SYM-NEXT: {{.*}} .text 0000000000000000 _start
-// SYM-NEXT: 0000000000011000 *ABS* 0000000000000000 foo
+// SYM: {{.*}} l .dynamic 0000000000000000 .hidden _DYNAMIC
+// SYM-NEXT: 0000000000011000 g *ABS* 0000000000000000 __real_foo
+// SYM-NEXT: 0000000000011010 g *ABS* 0000000000000000 __wrap_foo
+// SYM-NEXT: {{.*}} g .text 0000000000000000 _start
+// SYM-NEXT: 0000000000011000 g *ABS* 0000000000000000 foo
.global _start
_start:
diff --git a/llvm/test/MC/AArch64/inst-directive.s b/llvm/test/MC/AArch64/inst-directive.s
index 9911c39421b2..03359956f80a 100644
--- a/llvm/test/MC/AArch64/inst-directive.s
+++ b/llvm/test/MC/AArch64/inst-directive.s
@@ -30,6 +30,6 @@ aarch64_inst:
// 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
index 66574cd767da..ceb05dc13f90 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 .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
index d4197a664364..714d34bfba35 100644
--- 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
index b1379d28a364..9c594fcf9054 100644
--- 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
index 7e62b10f5b09..d0774693fa27 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 .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
index 3bed14c4520a..736ab0b8e2e2 100644
--- 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
index 06981f540466..97df7c42d364 100644
--- 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
index 2b92bf763e34..1babad142557 100644
--- 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
index b079634814d0..5cd60daff06e 100644
--- 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
index b67b0a366b1b..d1ff79311cca 100644
--- a/llvm/test/tools/llvm-objdump/WebAssembly/symbol-table.test
+++ b/llvm/test/tools/llvm-objdump/WebAssembly/symbol-table.test
@@ -3,7 +3,7 @@ RUN: llvm-objdump -t %p/../Inputs/trivial.obj.wasm | FileCheck %s
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
index 1b84cda1fa40..bbe9b69b7e76 100644
--- 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
index d79a05550f04..ddb09d4bfc92 100644
--- 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
index 3ffea44f5320..5e4c48e3e9d7 100644
--- 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
index c9dec65d1555..4675bd529c16 100644
--- a/llvm/tools/llvm-objdump/llvm-objdump.cpp
+++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp
@@ -1898,7 +1898,7 @@ void printSymbolTable(const ObjectFile *O, StringRef ArchiveName,
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' : ' ';
More information about the llvm-commits
mailing list