[lld] 962b29d - ELFObjectWriter: Don't sort non-local symbols
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Sat Feb 13 10:32:34 PST 2021
Author: Fangrui Song
Date: 2021-02-13T10:32:27-08:00
New Revision: 962b29d7162c8b470ea70540c48d11c2f35d7561
URL: https://github.com/llvm/llvm-project/commit/962b29d7162c8b470ea70540c48d11c2f35d7561
DIFF: https://github.com/llvm/llvm-project/commit/962b29d7162c8b470ea70540c48d11c2f35d7561.diff
LOG: ELFObjectWriter: Don't sort non-local symbols
As we don't sort local symbols, don't sort non-local symbols. This makes
non-local symbols appear in their register order, which matches GNU as. The
register order is nice in that you can write tests with interleaved CHECK
prefixes, e.g.
```
// CHECK: something about foo
.globl foo
foo:
// CHECK: something about bar
.globl bar
bar:
```
With the lexicographical order, the user needs to place lexicographical smallest
symbol first or keep CHECK prefixes in one place.
Added:
Modified:
lld/test/ELF/aarch64-gnu-ifunc.s
lld/test/ELF/aarch64-nopic-plt.s
lld/test/ELF/amdgpu-relocs.s
lld/test/ELF/arm-gnu-ifunc.s
lld/test/ELF/arm-static-defines.s
lld/test/ELF/assignment-archive.s
lld/test/ELF/cgprofile-icf.s
lld/test/ELF/cgprofile-obj.s
lld/test/ELF/cgprofile-txt.s
lld/test/ELF/copy-rel-abs.s
lld/test/ELF/copy-rel.s
lld/test/ELF/cref.s
lld/test/ELF/dynamic-list-preempt.s
lld/test/ELF/export-symbols.s
lld/test/ELF/gnu-ifunc-dso.s
lld/test/ELF/gnu-ifunc-empty.s
lld/test/ELF/gnu-ifunc-i386.s
lld/test/ELF/gnu-ifunc-noplt-i386.s
lld/test/ELF/gnu-ifunc-noplt.s
lld/test/ELF/gnu-ifunc.s
lld/test/ELF/icf-symbol-type.s
lld/test/ELF/interconnected-lazy.s
lld/test/ELF/just-symbols-cref.s
lld/test/ELF/just-symbols.s
lld/test/ELF/linkerscript/common-filespec.test
lld/test/ELF/linkerscript/map-file2.test
lld/test/ELF/linkerscript/symbol-alias-relocation.s
lld/test/ELF/linkerscript/symbol-assignexpr.s
lld/test/ELF/linkerscript/synthetic-symbols1.test
lld/test/ELF/linkerscript/version-linker-symbol.s
lld/test/ELF/many-alloc-sections.s
lld/test/ELF/mips-got-extsym.s
lld/test/ELF/mips-micro-cross-calls.s
lld/test/ELF/mips-tls-64.s
lld/test/ELF/mips-tls-static.s
lld/test/ELF/mips-tls.s
lld/test/ELF/output-section.s
lld/test/ELF/partition-notes.s
lld/test/ELF/partition-synthetic-sections.s
lld/test/ELF/partitions.s
lld/test/ELF/ppc64-local-entry.s
lld/test/ELF/ppc64-pcrel-call-to-extern.s
lld/test/ELF/ppc64-tls-ie.s
lld/test/ELF/ppc64-tls-pcrel-gd.s
lld/test/ELF/pre_init_fini_array.s
lld/test/ELF/relocatable-gc.s
lld/test/ELF/relocatable-rel-iplt.s
lld/test/ELF/relocatable-symbols.s
lld/test/ELF/resolution.s
lld/test/ELF/retain-symbols-file.s
lld/test/ELF/start-lib.s
lld/test/ELF/startstop.s
lld/test/ELF/symbol-ordering-file-warnings.s
lld/test/ELF/symbols.s
lld/test/ELF/undef-with-plt-addr.s
lld/test/ELF/verdef-defaultver.s
lld/test/ELF/version-script-complex-wildcards.s
lld/test/ELF/version-script-extern-exact.s
lld/test/ELF/version-script-extern-wildcards-anon.s
lld/test/ELF/version-script-extern-wildcards.s
lld/test/ELF/version-script-extern.s
lld/test/ELF/version-script-glob.s
lld/test/ELF/version-script-locals.s
lld/test/ELF/version-script-symver2.s
lld/test/ELF/version-script.s
lld/test/ELF/vs-diagnostics-duplicate.s
lld/test/ELF/wrap-no-real.s
lld/test/ELF/x86-64-gotpc-relax-und-dso.s
lld/test/ELF/x86-64-tls-ie.s
llvm/lib/MC/ELFObjectWriter.cpp
llvm/test/CodeGen/AMDGPU/lds-relocs.ll
llvm/test/LTO/Resolution/X86/not-prevailing-alias.ll
llvm/test/LTO/Resolution/X86/not-prevailing.ll
llvm/test/MC/AArch64/size-directive.s
llvm/test/MC/AMDGPU/elf-lds.s
llvm/test/MC/ARM/arm-elf-symver.s
llvm/test/MC/ARM/elf-thumbfunc.s
llvm/test/MC/ELF/ARM/clang-section.s
llvm/test/MC/ELF/cgprofile.s
llvm/test/MC/ELF/file.s
llvm/test/MC/ELF/pr9292.s
llvm/test/MC/ELF/relocation-alias.s
llvm/test/MC/ELF/strtab-suffix-opt.s
llvm/test/MC/ELF/symver-visibility.s
llvm/test/MC/ELF/symver.s
llvm/test/MC/ELF/type.s
llvm/test/MC/ELF/undef.s
llvm/test/MC/ELF/weak.s
llvm/test/MC/ELF/weakref.s
llvm/test/MC/Mips/elf_st_other.s
llvm/test/MC/Mips/insn-directive.s
llvm/test/MC/PowerPC/ppc64-localentry-symbols.s
Removed:
################################################################################
diff --git a/lld/test/ELF/aarch64-gnu-ifunc.s b/lld/test/ELF/aarch64-gnu-ifunc.s
index e0a51aa1c3c6..a7f9806e5513 100644
--- a/lld/test/ELF/aarch64-gnu-ifunc.s
+++ b/lld/test/ELF/aarch64-gnu-ifunc.s
@@ -47,8 +47,8 @@
// CHECK-NEXT: Section: .text
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
-// CHECK-NEXT: Name: __rela_iplt_end
-// CHECK-NEXT: Value: 0x200188
+// CHECK-NEXT: Name: __rela_iplt_start
+// CHECK-NEXT: Value: 0x200158
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Local
// CHECK-NEXT: Type: None
@@ -58,8 +58,8 @@
// CHECK-NEXT: Section: .rela.dyn
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
-// CHECK-NEXT: Name: __rela_iplt_start
-// CHECK-NEXT: Value: 0x200158
+// CHECK-NEXT: Name: __rela_iplt_end
+// CHECK-NEXT: Value: 0x200188
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Local
// CHECK-NEXT: Type: None
@@ -69,11 +69,11 @@
// CHECK-NEXT: Section: .rela.dyn
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
-// CHECK-NEXT: Name: _start
-// CHECK-NEXT: Value: 0x210190
+// CHECK-NEXT: Name: foo
+// CHECK-NEXT: Value: 0x210188
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Global
-// CHECK-NEXT: Type: None
+// CHECK-NEXT: Type: GNU_IFunc
// CHECK-NEXT: Other: 0
// CHECK-NEXT: Section: .text
// CHECK-NEXT: }
@@ -87,11 +87,11 @@
// CHECK-NEXT: Section: .text
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
-// CHECK-NEXT: Name: foo
-// CHECK-NEXT: Value: 0x210188
+// CHECK-NEXT: Name: _start
+// CHECK-NEXT: Value: 0x210190
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Global
-// CHECK-NEXT: Type: GNU_IFunc
+// CHECK-NEXT: Type: None
// CHECK-NEXT: Other: 0
// CHECK-NEXT: Section: .text
// CHECK-NEXT: }
diff --git a/lld/test/ELF/aarch64-nopic-plt.s b/lld/test/ELF/aarch64-nopic-plt.s
index 2ab220a28aee..91d150d44b75 100644
--- a/lld/test/ELF/aarch64-nopic-plt.s
+++ b/lld/test/ELF/aarch64-nopic-plt.s
@@ -10,18 +10,18 @@ _start:
adrp x8, foo
bl bar
-// CHECK: Name: bar
-// CHECK-NEXT: Value: 0x0
+// CHECK: Name: foo
+// CHECK-NEXT: Value: 0x2102F0
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Global
-// CHECK-NEXT: Type: None
+// CHECK-NEXT: Type: Function
// CHECK-NEXT: Other: 0
// CHECK-NEXT: Section: Undefined
-// CHECK: Name: foo
-// CHECK-NEXT: Value: 0x2102F0
+// CHECK: Name: bar
+// CHECK-NEXT: Value: 0x0
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Global
-// CHECK-NEXT: Type: Function
+// CHECK-NEXT: Type: None
// CHECK-NEXT: Other: 0
// CHECK-NEXT: Section: Undefined
diff --git a/lld/test/ELF/amdgpu-relocs.s b/lld/test/ELF/amdgpu-relocs.s
index caee617cf85e..2de7d9ae306f 100644
--- a/lld/test/ELF/amdgpu-relocs.s
+++ b/lld/test/ELF/amdgpu-relocs.s
@@ -98,19 +98,19 @@ foo:
# CHECK-NEXT: R_AMDGPU_ABS64 common_var0 0x0
# CHECK-NEXT: R_AMDGPU_ABS64 common_var1 0x0
# CHECK-NEXT: R_AMDGPU_ABS64 common_var2 0x0
-# CHECK-NEXT: R_AMDGPU_ABS64 extern_var0 0x0
-# CHECK-NEXT: R_AMDGPU_ABS64 extern_var1 0x0
-# CHECK-NEXT: R_AMDGPU_ABS64 extern_var2 0x0
# CHECK-NEXT: R_AMDGPU_ABS64 global_var0 0x0
# CHECK-NEXT: R_AMDGPU_ABS64 global_var1 0x0
# CHECK-NEXT: R_AMDGPU_ABS64 global_var2 0x0
-# CHECK-NEXT: R_AMDGPU_ABS64 temp 0x0
+# CHECK-NEXT: R_AMDGPU_ABS64 extern_var0 0x0
+# CHECK-NEXT: R_AMDGPU_ABS64 extern_var1 0x0
+# CHECK-NEXT: R_AMDGPU_ABS64 extern_var2 0x0
# CHECK-NEXT: R_AMDGPU_ABS64 weak_var0 0x0
# CHECK-NEXT: R_AMDGPU_ABS64 weak_var1 0x0
# CHECK-NEXT: R_AMDGPU_ABS64 weak_var2 0x0
# CHECK-NEXT: R_AMDGPU_ABS64 weakref_alias_var0 0x0
# CHECK-NEXT: R_AMDGPU_ABS64 weakref_alias_var1 0x0
# CHECK-NEXT: R_AMDGPU_ABS64 weakref_alias_var2 0x0
+# CHECK-NEXT: R_AMDGPU_ABS64 temp 0x0
# CHECK-NEXT: }
# CHECK-NEXT: ]
diff --git a/lld/test/ELF/arm-gnu-ifunc.s b/lld/test/ELF/arm-gnu-ifunc.s
index 51027e40578c..de7a196ea5da 100644
--- a/lld/test/ELF/arm-gnu-ifunc.s
+++ b/lld/test/ELF/arm-gnu-ifunc.s
@@ -62,9 +62,8 @@ _start:
// CHECK-NEXT: 0x30154 R_ARM_IRELATIVE
// CHECK-NEXT: }
// CHECK-NEXT: ]
-// CHECK: Symbol {
-// CHECK: Name: __rel_iplt_end
-// CHECK-NEXT: Value: 0x10104
+// CHECK: Name: __rel_iplt_start
+// CHECK-NEXT: Value: 0x100F4
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Local
// CHECK-NEXT: Type: None
@@ -74,8 +73,8 @@ _start:
// CHECK-NEXT: Section: .rel.dyn
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
-// CHECK-NEXT: Name: __rel_iplt_start
-// CHECK-NEXT: Value: 0x100F4
+// CHECK-NEXT: Name: __rel_iplt_end
+// CHECK-NEXT: Value: 0x10104
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Local
// CHECK-NEXT: Type: None
@@ -85,15 +84,6 @@ _start:
// CHECK-NEXT: Section: .rel.dyn
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
-// CHECK-NEXT: Name: _start
-// CHECK-NEXT: Value: 0x2010C
-// CHECK-NEXT: Size: 0
-// CHECK-NEXT: Binding: Global
-// CHECK-NEXT: Type: None
-// CHECK-NEXT: Other:
-// CHECK-NEXT: Section: .text
-// CHECK-NEXT: }
-// CHECK-NEXT: Symbol {
// CHECK-NEXT: Name: bar
// CHECK-NEXT: Value: 0x20108
// CHECK-NEXT: Size: 0
@@ -111,6 +101,15 @@ _start:
// CHECK-NEXT: Other: 0
// CHECK-NEXT: Section: .text
// CHECK-NEXT: }
+// CHECK-NEXT: Symbol {
+// CHECK-NEXT: Name: _start
+// CHECK-NEXT: Value: 0x2010C
+// CHECK-NEXT: Size: 0
+// CHECK-NEXT: Binding: Global
+// CHECK-NEXT: Type: None
+// CHECK-NEXT: Other:
+// CHECK-NEXT: Section: .text
+// CHECK-NEXT: }
// DISASM: Disassembly of section .text:
// DISASM-EMPTY:
diff --git a/lld/test/ELF/arm-static-defines.s b/lld/test/ELF/arm-static-defines.s
index 5a5988589aac..d367e952c898 100644
--- a/lld/test/ELF/arm-static-defines.s
+++ b/lld/test/ELF/arm-static-defines.s
@@ -22,23 +22,22 @@ _start:
.cantunwind
.fnend
-// CHECK: Name: __exidx_end
-// CHECK-NEXT: Value: 0x100E4
+// CHECK: Name: __exidx_start
+// CHECK-NEXT: Value: 0x100D4
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Local
// CHECK-NEXT: Type: None
// CHECK-NEXT: Other [
// CHECK-NEXT: STV_HIDDEN
// CHECK-NEXT: ]
-// CHECK-NEXT: Section: .ARM.exidx
-// CHECK: Name: __exidx_start
-// CHECK-NEXT: Value: 0x100D4
+// CHECK: Name: __exidx_end
+// CHECK-NEXT: Value: 0x100E4
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Local
// CHECK-NEXT: Type: None
// CHECK-NEXT: Other [
// CHECK-NEXT: STV_HIDDEN
// CHECK-NEXT: ]
-// CHECK-NEXT: Section: .ARM.exidx
+// CHECK-NEXT: Section: .ARM.exidx
// CHECK: Symbol {
// CHECK-NEXT: Name: __tls_get_addr
diff --git a/lld/test/ELF/assignment-archive.s b/lld/test/ELF/assignment-archive.s
index f71c331f1743..784685e469ee 100644
--- a/lld/test/ELF/assignment-archive.s
+++ b/lld/test/ELF/assignment-archive.s
@@ -15,8 +15,8 @@
# RUN: echo "SECTIONS { zed = foo; }" > %t2.script
# RUN: ld.lld -o %t2.exe --script %t2.script %tar.a %t.o
# RUN: llvm-readobj --symbols %t2.exe | FileCheck %s --check-prefix=SYMS
-# SYMS: bar
# SYMS: foo
+# SYMS: bar
.text
.globl foo
diff --git a/lld/test/ELF/cgprofile-icf.s b/lld/test/ELF/cgprofile-icf.s
index c27a7b2566db..a9de5613917c 100644
--- a/lld/test/ELF/cgprofile-icf.s
+++ b/lld/test/ELF/cgprofile-icf.s
@@ -34,20 +34,20 @@ A:
mov $42, %rax
retq
-# CHECK: Name: A
-# CHECK-NEXT: Value: 0x201120
-# CHECK: Name: B
-# CHECK-NEXT: Value: 0x201130
-# CHECK: Name: C
-# CHECK-NEXT: Value: 0x201128
# CHECK: Name: D
# CHECK-NEXT: Value: 0x201128
+# CHECK: Name: C
+# CHECK-NEXT: Value: 0x201128
+# CHECK: Name: B
+# CHECK-NEXT: Value: 0x201130
+# CHECK: Name: A
+# CHECK-NEXT: Value: 0x201120
-# NOICF: Name: A
-# NOICF-NEXT: Value: 0x201120
-# NOICF: Name: B
-# NOICF-NEXT: Value: 0x201128
-# NOICF: Name: C
-# NOICF-NEXT: Value: 0x201130
# NOICF: Name: D
# NOICF-NEXT: Value: 0x201138
+# NOICF: Name: C
+# NOICF-NEXT: Value: 0x201130
+# NOICF: Name: B
+# NOICF-NEXT: Value: 0x201128
+# NOICF: Name: A
+# NOICF-NEXT: Value: 0x201120
diff --git a/lld/test/ELF/cgprofile-obj.s b/lld/test/ELF/cgprofile-obj.s
index 57a4967ed7d5..f56f3bcbf0c3 100644
--- a/lld/test/ELF/cgprofile-obj.s
+++ b/lld/test/ELF/cgprofile-obj.s
@@ -34,11 +34,11 @@ Aa:
.cg_profile C, D, 90
# CHECK: 0000000000201123 t D
-# CHECK: 0000000000201120 T A
-# CHECK: 0000000000201121 T B
# CHECK: 0000000000201122 T C
+# CHECK: 0000000000201121 T B
+# CHECK: 0000000000201120 T A
# NO-CG: 0000000000201120 t D
-# NO-CG: 0000000000201123 T A
-# NO-CG: 0000000000201122 T B
# NO-CG: 0000000000201121 T C
+# NO-CG: 0000000000201122 T B
+# NO-CG: 0000000000201123 T A
diff --git a/lld/test/ELF/cgprofile-txt.s b/lld/test/ELF/cgprofile-txt.s
index 2bc18376caeb..99cbfa574532 100644
--- a/lld/test/ELF/cgprofile-txt.s
+++ b/lld/test/ELF/cgprofile-txt.s
@@ -140,20 +140,20 @@ TooManyPreds10:
# CHECK-NEXT: Value: 0x201124
# CHECK: Name: TooManyPreds10
# CHECK-NEXT: Value: 0x201138
-# CHECK: Name: A
-# CHECK-NEXT: Value: 0x201120
-# CHECK: Name: B
-# CHECK-NEXT: Value: 0x201121
# CHECK: Name: C
# CHECK-NEXT: Value: 0x201122
-# CHECK: Name: GB
-# CHECK-NEXT: Value: 0x20113F
+# CHECK: Name: B
+# CHECK-NEXT: Value: 0x201121
+# CHECK: Name: A
+# CHECK-NEXT: Value: 0x201120
+# CHECK: Name: TS
+# CHECK-NEXT: Value: 0x20113D
# CHECK: Name: PP
# CHECK-NEXT: Value: 0x20113C
# CHECK: Name: QC
# CHECK-NEXT: Value: 0x20113E
-# CHECK: Name: TS
-# CHECK-NEXT: Value: 0x20113D
+# CHECK: Name: GB
+# CHECK-NEXT: Value: 0x20113F
# CHECK: Name: _init
# CHECK-NEXT: Value: 0x201140
# CHECK: Name: _init2
@@ -165,20 +165,20 @@ TooManyPreds10:
# NOSORT-NEXT: Value: 0x201124
# NOSORT: Name: TooManyPreds10
# NOSORT-NEXT: Value: 0x201138
-# NOSORT: Name: A
-# NOSORT-NEXT: Value: 0x201123
-# NOSORT: Name: B
-# NOSORT-NEXT: Value: 0x201122
# NOSORT: Name: C
# NOSORT-NEXT: Value: 0x201121
-# NOSORT: Name: GB
-# NOSORT-NEXT: Value: 0x20113C
+# NOSORT: Name: B
+# NOSORT-NEXT: Value: 0x201122
+# NOSORT: Name: A
+# NOSORT-NEXT: Value: 0x201123
+# NOSORT: Name: TS
+# NOSORT-NEXT: Value: 0x201139
# NOSORT: Name: PP
# NOSORT-NEXT: Value: 0x20113A
# NOSORT: Name: QC
# NOSORT-NEXT: Value: 0x20113B
-# NOSORT: Name: TS
-# NOSORT-NEXT: Value: 0x201139
+# NOSORT: Name: GB
+# NOSORT-NEXT: Value: 0x20113C
# NOSORT: Name: _init
# NOSORT-NEXT: Value: 0x20113D
# NOSORT: Name: _init2
diff --git a/lld/test/ELF/copy-rel-abs.s b/lld/test/ELF/copy-rel-abs.s
index de6fbc48a897..284388281621 100644
--- a/lld/test/ELF/copy-rel-abs.s
+++ b/lld/test/ELF/copy-rel-abs.s
@@ -6,8 +6,8 @@
# RUN: ld.lld -shared %t1.o -o %t1.so
# RUN: llvm-readelf --dyn-syms %t1.so | FileCheck --check-prefix=SYMS %s
-# SYMS: [[ADDR:[0-9a-f]+]] {{.*}} 5 bar
-# SYMS: [[ADDR]] {{.*}} 5 foo
+# SYMS: [[ADDR:[0-9a-f]+]] {{.*}} 5 foo
+# SYMS: [[ADDR]] {{.*}} 5 bar
# SYMS: [[ADDR]] {{.*}} ABS zed
# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t2.o
diff --git a/lld/test/ELF/copy-rel.s b/lld/test/ELF/copy-rel.s
index c93e5b04ca3d..7a957d2c290c 100644
--- a/lld/test/ELF/copy-rel.s
+++ b/lld/test/ELF/copy-rel.s
@@ -14,8 +14,8 @@
# CHECK: Relocations [
# CHECK-NEXT: .rela.dyn {
-# CHECK-NEXT: R_X86_64_COPY bar 0x0
# CHECK-NEXT: R_X86_64_COPY foo 0x0
+# CHECK-NEXT: R_X86_64_COPY bar 0x0
# CHECK-NEXT: }
# CHECK-NEXT: ]
diff --git a/lld/test/ELF/cref.s b/lld/test/ELF/cref.s
index 2a82f4252e84..a5ad74898333 100644
--- a/lld/test/ELF/cref.s
+++ b/lld/test/ELF/cref.s
@@ -10,11 +10,11 @@
// RUN: ld.lld -o /dev/null %t1.so %t2.o %t3.o %t.a -gc-sections -cref | FileCheck -strict-whitespace %s
// CHECK: Symbol File
-// CHECK-NEXT: bar {{.*}}2.o
-// CHECK-NEXT: {{.*}}3.o
// CHECK-NEXT: foo {{.*}}1.so
// CHECK-NEXT: {{.*}}2.o
// CHECK-NEXT: {{.*}}3.o
+// CHECK-NEXT: bar {{.*}}2.o
+// CHECK-NEXT: {{.*}}3.o
// CHECK-NEXT: _start {{.*}}3.o
// CHECK-NEXT: baz {{.*}}3.o
// CHECK-NEXT: zed {{.*}}.a({{.*}}a.o)
diff --git a/lld/test/ELF/dynamic-list-preempt.s b/lld/test/ELF/dynamic-list-preempt.s
index 024f9302a008..a4c072e5a91c 100644
--- a/lld/test/ELF/dynamic-list-preempt.s
+++ b/lld/test/ELF/dynamic-list-preempt.s
@@ -30,7 +30,7 @@
# DYNSYMS-NEXT: Section: Undefined
# DYNSYMS-NEXT: }
# DYNSYMS-NEXT: Symbol {
-# DYNSYMS-NEXT: Name: bar
+# DYNSYMS-NEXT: Name: foo
# DYNSYMS-NEXT: Value:
# DYNSYMS-NEXT: Size:
# DYNSYMS-NEXT: Binding: Global
@@ -39,7 +39,7 @@
# DYNSYMS-NEXT: Section:
# DYNSYMS-NEXT: }
# DYNSYMS-NEXT: Symbol {
-# DYNSYMS-NEXT: Name: ext
+# DYNSYMS-NEXT: Name: bar
# DYNSYMS-NEXT: Value:
# DYNSYMS-NEXT: Size:
# DYNSYMS-NEXT: Binding: Global
@@ -48,7 +48,7 @@
# DYNSYMS-NEXT: Section:
# DYNSYMS-NEXT: }
# DYNSYMS-NEXT: Symbol {
-# DYNSYMS-NEXT: Name: foo
+# DYNSYMS-NEXT: Name: ext
# DYNSYMS-NEXT: Value:
# DYNSYMS-NEXT: Size:
# DYNSYMS-NEXT: Binding: Global
diff --git a/lld/test/ELF/export-symbols.s b/lld/test/ELF/export-symbols.s
index 13612390fb67..5b59ac513472 100644
--- a/lld/test/ELF/export-symbols.s
+++ b/lld/test/ELF/export-symbols.s
@@ -26,10 +26,10 @@
# EXPORT: Symbol table '.dynsym' contains 8 entries:
# EXPORT: GLOBAL DEFAULT {{.*}} shared
# EXPORT-NEXT: WEAK DEFAULT {{.*}} undef_weak
-# EXPORT-NEXT: GLOBAL PROTECTED {{.*}} _start
-# EXPORT-NEXT: GLOBAL DEFAULT ABS abs
-# EXPORT-NEXT: GLOBAL DEFAULT {{.*}} common
# EXPORT-NEXT: WEAK DEFAULT {{.*}} weak_default
+# EXPORT-NEXT: GLOBAL DEFAULT {{.*}} common
+# EXPORT-NEXT: GLOBAL DEFAULT ABS abs
+# EXPORT-NEXT: GLOBAL PROTECTED {{.*}} _start
# EXPORT-NEXT: GLOBAL DEFAULT {{.*}} defsym
.weak undef_weak
diff --git a/lld/test/ELF/gnu-ifunc-dso.s b/lld/test/ELF/gnu-ifunc-dso.s
index c448c1f05785..dee5246494ab 100644
--- a/lld/test/ELF/gnu-ifunc-dso.s
+++ b/lld/test/ELF/gnu-ifunc-dso.s
@@ -12,8 +12,8 @@
# RUN: llvm-readobj --dyn-relocations %t.so | FileCheck %s
# CHECK: Dynamic Relocations {
-# CHECK-NEXT: R_X86_64_64 bar 0x0
# CHECK-NEXT: R_X86_64_GLOB_DAT foo 0x0
+# CHECK-NEXT: R_X86_64_64 bar 0x0
# CHECK-NEXT: }
.data
diff --git a/lld/test/ELF/gnu-ifunc-empty.s b/lld/test/ELF/gnu-ifunc-empty.s
index b3efabd64e53..90097d917dfe 100644
--- a/lld/test/ELF/gnu-ifunc-empty.s
+++ b/lld/test/ELF/gnu-ifunc-empty.s
@@ -10,8 +10,8 @@
// CHECK: Name Type Address Off
// CHECK: .text PROGBITS 0000000000201120 000120
// CHECK: Value Size Type Bind Vis Ndx Name
-// CHECK: 0000000000200000 0 NOTYPE LOCAL HIDDEN 1 __rela_iplt_end
// CHECK: 0000000000200000 0 NOTYPE LOCAL HIDDEN 1 __rela_iplt_start
+// CHECK: 0000000000200000 0 NOTYPE LOCAL HIDDEN 1 __rela_iplt_end
.globl _start
_start:
diff --git a/lld/test/ELF/gnu-ifunc-i386.s b/lld/test/ELF/gnu-ifunc-i386.s
index 41fcd79b5c42..f19f40b8c641 100644
--- a/lld/test/ELF/gnu-ifunc-i386.s
+++ b/lld/test/ELF/gnu-ifunc-i386.s
@@ -39,8 +39,8 @@
// CHECK-NEXT: Section: Undefined
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
-// CHECK-NEXT: Name: __rel_iplt_end
-// CHECK-NEXT: Value: 0x4000E4
+// CHECK-NEXT: Name: __rel_iplt_start
+// CHECK-NEXT: Value: [[RELA]]
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Local
// CHECK-NEXT: Type: None
@@ -50,8 +50,8 @@
// CHECK-NEXT: Section: .rel.dyn
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
-// CHECK-NEXT: Name: __rel_iplt_start
-// CHECK-NEXT: Value: [[RELA]]
+// CHECK-NEXT: Name: __rel_iplt_end
+// CHECK-NEXT: Value: 0x4000E4
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Local
// CHECK-NEXT: Type: None
@@ -61,15 +61,6 @@
// CHECK-NEXT: Section: .rel.dyn
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
-// CHECK-NEXT: Name: _start
-// CHECK-NEXT: Value: 0x4010E6
-// CHECK-NEXT: Size: 0
-// CHECK-NEXT: Binding: Global
-// CHECK-NEXT: Type: None
-// CHECK-NEXT: Other: 0
-// CHECK-NEXT: Section: .text
-// CHECK-NEXT: }
-// CHECK-NEXT: Symbol {
// CHECK-NEXT: Name: bar
// CHECK-NEXT: Value: 0x401110
// CHECK-NEXT: Size: 0
@@ -80,7 +71,7 @@
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
// CHECK-NEXT: Name: bar_resolver
-// CHECK-NEXT: Value: 0x4010E5
+// CHECK-NEXT: Value: 0x4010E4
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Global
// CHECK-NEXT: Type: Function
@@ -98,20 +89,29 @@
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
// CHECK-NEXT: Name: foo_resolver
-// CHECK-NEXT: Value: 0x4010E4
+// CHECK-NEXT: Value: 0x4010E5
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Global
// CHECK-NEXT: Type: Function
// CHECK-NEXT: Other: 0
// CHECK-NEXT: Section: .text
// CHECK-NEXT: }
+// CHECK-NEXT: Symbol {
+// CHECK-NEXT: Name: _start
+// CHECK-NEXT: Value: 0x4010E6
+// CHECK-NEXT: Size: 0
+// CHECK-NEXT: Binding: Global
+// CHECK-NEXT: Type: None
+// CHECK-NEXT: Other: 0
+// CHECK-NEXT: Section: .text
+// CHECK-NEXT: }
// CHECK-NEXT:]
// DISASM: Disassembly of section .text:
// DISASM-EMPTY:
-// DISASM-NEXT: <foo_resolver>:
+// DISASM-NEXT: <bar_resolver>:
// DISASM-NEXT: 4010e4: retl
-// DISASM: <bar_resolver>:
+// DISASM: <foo_resolver>:
// DISASM-NEXT: 4010e5: retl
// DISASM: <_start>:
// DISASM-NEXT: 4010e6: calll 0x401100 <foo>
@@ -130,6 +130,14 @@
// DISASM-NEXT: pushl $8
// DISASM-NEXT: jmp 0x0
+.type bar STT_GNU_IFUNC
+.globl bar
+bar:
+.type bar_resolver STT_FUNC
+.globl bar_resolver
+bar_resolver:
+ ret
+
.text
.type foo STT_GNU_IFUNC
.globl foo
@@ -139,14 +147,6 @@ foo:
foo_resolver:
ret
-.type bar STT_GNU_IFUNC
-.globl bar
-bar:
-.type bar_resolver STT_FUNC
-.globl bar_resolver
-bar_resolver:
- ret
-
.globl _start
_start:
call foo
diff --git a/lld/test/ELF/gnu-ifunc-noplt-i386.s b/lld/test/ELF/gnu-ifunc-noplt-i386.s
index 324ef95fd891..d058e4053bdb 100644
--- a/lld/test/ELF/gnu-ifunc-noplt-i386.s
+++ b/lld/test/ELF/gnu-ifunc-noplt-i386.s
@@ -9,8 +9,8 @@
// Check that we emitted relocations for the ifunc calls
// CHECK: Relocations [
// CHECK-NEXT: Section (4) .rel.dyn {
-// CHECK-NEXT: 0x4011F4 R_386_PLT32 bar
// CHECK-NEXT: 0x4011EF R_386_PLT32 foo
+// CHECK-NEXT: 0x4011F4 R_386_PLT32 bar
// CHECK-NEXT: }
// CHECK-NEXT: Section (5) .rel.plt {
// CHECK-NEXT: 0x4032D4 R_386_JUMP_SLOT bar2
diff --git a/lld/test/ELF/gnu-ifunc-noplt.s b/lld/test/ELF/gnu-ifunc-noplt.s
index 80fcbce44a04..510749eb1f8a 100644
--- a/lld/test/ELF/gnu-ifunc-noplt.s
+++ b/lld/test/ELF/gnu-ifunc-noplt.s
@@ -18,8 +18,8 @@
// Check that we emitted relocations for the ifunc calls
// CHECK: Relocations [
// CHECK-NEXT: Section (4) .rela.dyn {
-// CHECK-NEXT: 0x201328 R_X86_64_PLT32 bar 0xFFFFFFFFFFFFFFFC
// CHECK-NEXT: 0x201323 R_X86_64_PLT32 foo 0xFFFFFFFFFFFFFFFC
+// CHECK-NEXT: 0x201328 R_X86_64_PLT32 bar 0xFFFFFFFFFFFFFFFC
// CHECK-NEXT: }
// CHECK-NEXT: Section (5) .rela.plt {
// CHECK-NEXT: 0x203498 R_X86_64_JUMP_SLOT bar2 0x0
diff --git a/lld/test/ELF/gnu-ifunc.s b/lld/test/ELF/gnu-ifunc.s
index dc7a851a57ab..49ba69a88be2 100644
--- a/lld/test/ELF/gnu-ifunc.s
+++ b/lld/test/ELF/gnu-ifunc.s
@@ -40,8 +40,8 @@
// CHECK-NEXT: Section: Undefined
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
-// CHECK-NEXT: Name: __rela_iplt_end
-// CHECK-NEXT: Value: 0x200188
+// CHECK-NEXT: Name: __rela_iplt_start
+// CHECK-NEXT: Value: [[RELA]]
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Local
// CHECK-NEXT: Type: None
@@ -51,8 +51,8 @@
// CHECK-NEXT: Section: .rela.dyn
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
-// CHECK-NEXT: Name: __rela_iplt_start
-// CHECK-NEXT: Value: [[RELA]]
+// CHECK-NEXT: Name: __rela_iplt_end
+// CHECK-NEXT: Value: 0x200188
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Local
// CHECK-NEXT: Type: None
@@ -62,11 +62,11 @@
// CHECK-NEXT: Section: .rela.dyn
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
-// CHECK-NEXT: Name: _start
-// CHECK-NEXT: Value: 0x20118A
+// CHECK-NEXT: Name: foo
+// CHECK-NEXT: Value: 0x201188
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Global
-// CHECK-NEXT: Type: None
+// CHECK-NEXT: Type: GNU_IFunc
// CHECK-NEXT: Other: 0
// CHECK-NEXT: Section: .text
// CHECK-NEXT: }
@@ -80,11 +80,11 @@
// CHECK-NEXT: Section: .text
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
-// CHECK-NEXT: Name: foo
-// CHECK-NEXT: Value: 0x201188
+// CHECK-NEXT: Name: _start
+// CHECK-NEXT: Value: 0x20118A
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Global
-// CHECK-NEXT: Type: GNU_IFunc
+// CHECK-NEXT: Type: None
// CHECK-NEXT: Other: 0
// CHECK-NEXT: Section: .text
// CHECK-NEXT: }
diff --git a/lld/test/ELF/icf-symbol-type.s b/lld/test/ELF/icf-symbol-type.s
index 5a5b97d2a0f6..904cb7ce2308 100644
--- a/lld/test/ELF/icf-symbol-type.s
+++ b/lld/test/ELF/icf-symbol-type.s
@@ -7,8 +7,8 @@
# We used to mark bar as absolute.
# CHECK: [ 5] .text
-# CHECK: [[ADDR:[0-9a-f]+]] 0 NOTYPE GLOBAL DEFAULT 5 bar
-# CHECK: [[ADDR]] 0 NOTYPE GLOBAL DEFAULT 5 foo
+# CHECK: [[ADDR:[0-9a-f]+]] 0 NOTYPE GLOBAL DEFAULT 5 foo
+# CHECK: [[ADDR]] 0 NOTYPE GLOBAL DEFAULT 5 bar
# The nop makes the test more interesting by making the offset of
# text.f non zero.
diff --git a/lld/test/ELF/interconnected-lazy.s b/lld/test/ELF/interconnected-lazy.s
index 1a8d35a6bec6..0d67318b3fa0 100644
--- a/lld/test/ELF/interconnected-lazy.s
+++ b/lld/test/ELF/interconnected-lazy.s
@@ -9,11 +9,11 @@
## Test we resolve both to the same file.
# RUN: ld.lld -y a -y foo -y __foo %t/main.o --start-lib %t/a.o %t/b.o --end-lib -o /dev/null | FileCheck %s
-# CHECK: a.o: lazy definition of __foo
-# CHECK-NEXT: a.o: lazy definition of a
+# CHECK: a.o: lazy definition of a
# CHECK-NEXT: a.o: lazy definition of foo
-# CHECK-NEXT: b.o: definition of __foo
+# CHECK-NEXT: a.o: lazy definition of __foo
# CHECK-NEXT: b.o: definition of foo
+# CHECK-NEXT: b.o: definition of __foo
# CHECK-NEXT: b.o: reference to a
# CHECK-NEXT: a.o: definition of a
diff --git a/lld/test/ELF/just-symbols-cref.s b/lld/test/ELF/just-symbols-cref.s
index 8581c53eb5df..4aad58ccf36f 100644
--- a/lld/test/ELF/just-symbols-cref.s
+++ b/lld/test/ELF/just-symbols-cref.s
@@ -6,8 +6,8 @@
# RUN: ld.lld -just-symbols=%t1.exe -o %t2.exe -cref | FileCheck %s
# CHECK: Symbol File
-# CHECK-NEXT: bar {{.*exe}}
# CHECK-NEXT: foo {{.*exe}}
+# CHECK-NEXT: bar {{.*exe}}
.globl foo, bar
foo:
diff --git a/lld/test/ELF/just-symbols.s b/lld/test/ELF/just-symbols.s
index cbceb2a1b2fd..612243de29c0 100644
--- a/lld/test/ELF/just-symbols.s
+++ b/lld/test/ELF/just-symbols.s
@@ -6,8 +6,8 @@
# RUN: ld.lld -just-symbols=%t1.exe -o %t2.exe
# RUN: llvm-readelf -symbols %t2.exe | FileCheck %s
-# CHECK: 0000000000011001 40 OBJECT GLOBAL DEFAULT ABS bar
# CHECK: 0000000000010000 0 NOTYPE GLOBAL DEFAULT ABS foo
+# CHECK: 0000000000011001 40 OBJECT GLOBAL DEFAULT ABS bar
.globl foo, bar
foo:
diff --git a/lld/test/ELF/linkerscript/common-filespec.test b/lld/test/ELF/linkerscript/common-filespec.test
index 99462dee9e08..a3b04edb29ea 100644
--- a/lld/test/ELF/linkerscript/common-filespec.test
+++ b/lld/test/ELF/linkerscript/common-filespec.test
@@ -67,22 +67,22 @@ SECTIONS {
# For a common with multiple definitions, the largest one wins and it must be
# assigned to the section from the file which provided the winning def
# CHECK: Symbol {
-# CHECK: Name: common_multiple
-# CHECK-NEXT: Value: 0x10
-# CHECK-NEXT: Size: 32
+# CHECK: Name: common_uniq_0
+# CHECK-NEXT: Value: 0x4
+# CHECK-NEXT: Size: 4
# CHECK-NEXT: Binding: Global
# CHECK-NEXT: Type: Object
# CHECK-NEXT: Other: 0
-# CHECK-NEXT: Section: .common_2
+# CHECK-NEXT: Section: .common_0
# CHECK-NEXT: }
# CHECK: Symbol {
-# CHECK: Name: common_uniq_0
-# CHECK-NEXT: Value: 0x4
-# CHECK-NEXT: Size: 4
+# CHECK: Name: common_multiple
+# CHECK-NEXT: Value: 0x10
+# CHECK-NEXT: Size: 32
# CHECK-NEXT: Binding: Global
# CHECK-NEXT: Type: Object
# CHECK-NEXT: Other: 0
-# CHECK-NEXT: Section: .common_0
+# CHECK-NEXT: Section: .common_2
# CHECK-NEXT: }
# CHECK: Symbol {
# CHECK: Name: common_uniq_1
diff --git a/lld/test/ELF/linkerscript/map-file2.test b/lld/test/ELF/linkerscript/map-file2.test
index 535043282249..8efb5d6cd3d3 100644
--- a/lld/test/ELF/linkerscript/map-file2.test
+++ b/lld/test/ELF/linkerscript/map-file2.test
@@ -34,8 +34,8 @@ SECTIONS {
# CHECK-NEXT: 1228 3218 30 1 {{.*}}{{/|\\}}map-file2.test.tmp.o:(.eh_frame+0x0)
# CHECK-NEXT: 125c 324c 1 4 .text
# CHECK-NEXT: 125c 324c 1 4 {{.*}}{{/|\\}}map-file2.test.tmp.o:(.text)
-# CHECK-NEXT: 125c 324c 0 1 f(int)
# CHECK-NEXT: 125c 324c 0 1 _start
+# CHECK-NEXT: 125c 324c 0 1 f(int)
# CHECK-NEXT: 0 0 8 1 .comment
# CHECK-NEXT: 0 0 8 1 <internal>:(.comment)
# CHECK-NEXT: 0 0 48 8 .symtab
diff --git a/lld/test/ELF/linkerscript/symbol-alias-relocation.s b/lld/test/ELF/linkerscript/symbol-alias-relocation.s
index b46482812648..28ee9c795b8a 100644
--- a/lld/test/ELF/linkerscript/symbol-alias-relocation.s
+++ b/lld/test/ELF/linkerscript/symbol-alias-relocation.s
@@ -8,7 +8,7 @@
## (It should belong to the section .text and point to it's start).
# CHECK: Symbol {
-# CHECK: Name: __text
+# CHECK: Name: aliasto__text
# CHECK-NEXT: Value: 0x1000
# CHECK-NEXT: Size: 0
# CHECK-NEXT: Binding: Global
@@ -18,7 +18,7 @@
# CHECK-NEXT: }
# CHECK: Symbol {
-# CHECK: Name: aliasto__text
+# CHECK: Name: __text
# CHECK-NEXT: Value: 0x1000
# CHECK-NEXT: Size: 0
# CHECK-NEXT: Binding: Global
diff --git a/lld/test/ELF/linkerscript/symbol-assignexpr.s b/lld/test/ELF/linkerscript/symbol-assignexpr.s
index 3bab4db7ab48..8bd8a9c1c44d 100644
--- a/lld/test/ELF/linkerscript/symbol-assignexpr.s
+++ b/lld/test/ELF/linkerscript/symbol-assignexpr.s
@@ -25,9 +25,9 @@
# RUN: llvm-nm -p %t | FileCheck %s
# CHECK: 0000000000000000 T _start
+# CHECK-NEXT: 0000000000000001 T foo
# CHECK-NEXT: 0000000000005678 A bar
# CHECK-NEXT: 0000000000009abc A baz
-# CHECK-NEXT: 0000000000000001 T foo
# CHECK-NEXT: 0000000000001000 A symbol
# CHECK-NEXT: 0000000000002234 A symbol2
# CHECK-NEXT: 0000000000002234 A symbol3
diff --git a/lld/test/ELF/linkerscript/synthetic-symbols1.test b/lld/test/ELF/linkerscript/synthetic-symbols1.test
index f32248b40592..86c5dd8a5dcb 100644
--- a/lld/test/ELF/linkerscript/synthetic-symbols1.test
+++ b/lld/test/ELF/linkerscript/synthetic-symbols1.test
@@ -39,9 +39,9 @@ SECTIONS {
}
# CHECK: 0000000000000160 l .foo 0000000000000000 .hidden _end_sec
+# CHECK-NEXT: 000000000000104c g .text 0000000000000000 _start
# CHECK-NEXT: 0000000000000158 g .foo 0000000000000000 _begin_sec
# CHECK-NEXT: 0000000000000160 g *ABS* 0000000000000000 _end_sec_abs
-# CHECK-NEXT: 000000000000104c g .text 0000000000000000 _start
# CHECK-NEXT: 0000000000000158 g .foo 0000000000000000 begin_foo
# CHECK-NEXT: 0000000000000160 g .foo 0000000000000000 end_foo
# CHECK-NEXT: 0000000000000008 g *ABS* 0000000000000000 size_foo_1
diff --git a/lld/test/ELF/linkerscript/version-linker-symbol.s b/lld/test/ELF/linkerscript/version-linker-symbol.s
index a92580ecd12b..be6c4fcf2f80 100644
--- a/lld/test/ELF/linkerscript/version-linker-symbol.s
+++ b/lld/test/ELF/linkerscript/version-linker-symbol.s
@@ -5,21 +5,21 @@
# RUN: ld.lld --version-script %t.script -shared %t.o -o %t.so
# RUN: llvm-readobj --dyn-syms %t.so | FileCheck %s
-# CHECK: Name: _end@@VER1
+# CHECK: Name: foo@@VER1
# CHECK-NEXT: Value: 0
# CHECK-NEXT: Size: 0
# CHECK-NEXT: Binding: Global
# CHECK-NEXT: Type: None
# CHECK-NEXT: Other: 0
-# CHECK-NEXT: Section: .data
+# CHECK-NEXT: Section: .text
-# CHECK: Name: foo@@VER1
+# CHECK: Name: _end@@VER1
# CHECK-NEXT: Value: 0
# CHECK-NEXT: Size: 0
# CHECK-NEXT: Binding: Global
# CHECK-NEXT: Type: None
# CHECK-NEXT: Other: 0
-# CHECK-NEXT: Section: .text
+# CHECK-NEXT: Section: .data
.global foo
foo:
diff --git a/lld/test/ELF/many-alloc-sections.s b/lld/test/ELF/many-alloc-sections.s
index 233f11475989..1009b7a086e1 100644
--- a/lld/test/ELF/many-alloc-sections.s
+++ b/lld/test/ELF/many-alloc-sections.s
@@ -49,11 +49,11 @@
// GC: Symbol {
// GC-NEXT: Name: sdn
// GC: Symbol {
-// GC-NEXT: Name: _start
-// GC: Symbol {
// GC-NEXT: Name: abs
// GC: Symbol {
// GC-NEXT: Name: common
+// GC: Symbol {
+// GC-NEXT: Name: _start
// GC-NOT: Symbol {
.macro gen_sections4 x
diff --git a/lld/test/ELF/mips-got-extsym.s b/lld/test/ELF/mips-got-extsym.s
index b4ee5fc49fb7..7dd2841bee79 100644
--- a/lld/test/ELF/mips-got-extsym.s
+++ b/lld/test/ELF/mips-got-extsym.s
@@ -15,8 +15,8 @@
# CHECK-NOT: bar
# CHECK: Symbol table '.symtab'
-# CHECK: {{.*}}: 00000000 {{.*}} _foo
# CHECK: {{.*}}: [[BAR:[0-9a-f]+]] {{.*}} bar
+# CHECK: {{.*}}: 00000000 {{.*}} _foo
# CHECK: Primary GOT:
# CHECK: Local entries:
diff --git a/lld/test/ELF/mips-micro-cross-calls.s b/lld/test/ELF/mips-micro-cross-calls.s
index c58d7bcc2010..3e8823588753 100644
--- a/lld/test/ELF/mips-micro-cross-calls.s
+++ b/lld/test/ELF/mips-micro-cross-calls.s
@@ -15,8 +15,8 @@
# RUN: | FileCheck --check-prefix=MICRO %s
# 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]+]] g .text 00000000 0x80 micro
+# REG: {{0*}}[[BAR:[0-9a-f]+]] g F .text 00000000 bar
# REG: <__start>:
# REG-NEXT: jalx 0x[[MIC]] <micro>
diff --git a/lld/test/ELF/mips-tls-64.s b/lld/test/ELF/mips-tls-64.s
index f5ea5bdd861f..2ae906f84400 100644
--- a/lld/test/ELF/mips-tls-64.s
+++ b/lld/test/ELF/mips-tls-64.s
@@ -22,8 +22,8 @@
# RUN: llvm-readobj -r -A %t-out.so | FileCheck -check-prefix=SO %s
# DIS: 0000000000000000 l O .tdata 0000000000000000 loc
-# DIS: 0000000000000004 g O .tdata 0000000000000000 bar
# DIS: 0000000000000000 O *UND* 0000000000000000 foo
+# DIS: 0000000000000004 g O .tdata 0000000000000000 bar
# DIS: Contents of section .got:
# DIS-NEXT: 30000 00000000 00000000 80000000 00000000
@@ -74,12 +74,12 @@
# SO: Relocations [
# SO-NEXT: Section (7) .rel.dyn {
# SO-NEXT: 0x30030 R_MIPS_TLS_DTPMOD64/R_MIPS_NONE/R_MIPS_NONE -
-# SO-NEXT: 0x30018 R_MIPS_TLS_TPREL64/R_MIPS_NONE/R_MIPS_NONE bar
-# SO-NEXT: 0x30040 R_MIPS_TLS_DTPMOD64/R_MIPS_NONE/R_MIPS_NONE bar
-# SO-NEXT: 0x30048 R_MIPS_TLS_DTPREL64/R_MIPS_NONE/R_MIPS_NONE bar
# SO-NEXT: 0x30010 R_MIPS_TLS_TPREL64/R_MIPS_NONE/R_MIPS_NONE foo
# SO-NEXT: 0x30020 R_MIPS_TLS_DTPMOD64/R_MIPS_NONE/R_MIPS_NONE foo
# SO-NEXT: 0x30028 R_MIPS_TLS_DTPREL64/R_MIPS_NONE/R_MIPS_NONE foo
+# SO-NEXT: 0x30018 R_MIPS_TLS_TPREL64/R_MIPS_NONE/R_MIPS_NONE bar
+# SO-NEXT: 0x30040 R_MIPS_TLS_DTPMOD64/R_MIPS_NONE/R_MIPS_NONE bar
+# SO-NEXT: 0x30048 R_MIPS_TLS_DTPREL64/R_MIPS_NONE/R_MIPS_NONE bar
# SO-NEXT: }
# SO-NEXT: ]
# SO: Primary GOT {
diff --git a/lld/test/ELF/mips-tls-static.s b/lld/test/ELF/mips-tls-static.s
index 7801a90bb7c0..d489200ea7fc 100644
--- a/lld/test/ELF/mips-tls-static.s
+++ b/lld/test/ELF/mips-tls-static.s
@@ -7,8 +7,8 @@
# RUN: llvm-objdump -s -t %t.exe | FileCheck %s
# CHECK: SYMBOL TABLE:
-# CHECK: [[TGA:[0-9a-f]+]] g .text 00000000 __tls_get_addr
# CHECK: 00000000 g O .tdata 00000000 tls1
+# CHECK: [[TGA:[0-9a-f]+]] g .text 00000000 __tls_get_addr
#
# CHECK: Contents of section .data:
# CHECK-NEXT: {{.*}} [[TGA]] ffff8004 ffff9004
diff --git a/lld/test/ELF/mips-tls.s b/lld/test/ELF/mips-tls.s
index 703488feb6a0..e7882687dfc8 100644
--- a/lld/test/ELF/mips-tls.s
+++ b/lld/test/ELF/mips-tls.s
@@ -22,8 +22,8 @@
# RUN: llvm-readobj -r -A %t-out.so | FileCheck -check-prefix=SO %s
# DIS: 00000000 l O .tdata 00000000 loc
-# DIS: 00000004 g O .tdata 00000000 bar
# DIS: 00000000 O *UND* 00000000 foo
+# DIS: 00000004 g O .tdata 00000000 bar
# DIS: Contents of section .got:
# DIS-NEXT: 30000 00000000 80000000 00000000 ffff9004
@@ -70,12 +70,12 @@
# SO: Relocations [
# SO-NEXT: Section (7) .rel.dyn {
# SO-NEXT: 0x30018 R_MIPS_TLS_DTPMOD32 -
-# SO-NEXT: 0x3000C R_MIPS_TLS_TPREL32 bar
-# SO-NEXT: 0x30020 R_MIPS_TLS_DTPMOD32 bar
-# SO-NEXT: 0x30024 R_MIPS_TLS_DTPREL32 bar
# SO-NEXT: 0x30008 R_MIPS_TLS_TPREL32 foo
# SO-NEXT: 0x30010 R_MIPS_TLS_DTPMOD32 foo
# SO-NEXT: 0x30014 R_MIPS_TLS_DTPREL32 foo
+# SO-NEXT: 0x3000C R_MIPS_TLS_TPREL32 bar
+# SO-NEXT: 0x30020 R_MIPS_TLS_DTPMOD32 bar
+# SO-NEXT: 0x30024 R_MIPS_TLS_DTPREL32 bar
# SO-NEXT: }
# SO-NEXT: ]
# SO: Primary GOT {
diff --git a/lld/test/ELF/output-section.s b/lld/test/ELF/output-section.s
index d4f893bb775a..e47904a41d1c 100644
--- a/lld/test/ELF/output-section.s
+++ b/lld/test/ELF/output-section.s
@@ -3,23 +3,22 @@
// RUN: ld.lld %t -o %t2
// RUN: llvm-readobj --symbols %t2 | FileCheck %s
-// CHECK: Symbol {
-// CHECK: Name: bar_sym
+// CHECK: Name: foo_sym
// CHECK-NEXT: Value:
// CHECK-NEXT: Size:
// CHECK-NEXT: Binding:
// CHECK-NEXT: Type:
// CHECK-NEXT: Other:
-// CHECK-NEXT: Section: bar
+// CHECK-NEXT: Section: foo
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
-// CHECK-NEXT: Name: foo_sym
+// CHECK-NEXT: Name: bar_sym
// CHECK-NEXT: Value:
// CHECK-NEXT: Size:
// CHECK-NEXT: Binding:
// CHECK-NEXT: Type:
// CHECK-NEXT: Other:
-// CHECK-NEXT: Section: foo
+// CHECK-NEXT: Section: bar
// CHECK-NEXT: }
.section foo
diff --git a/lld/test/ELF/partition-notes.s b/lld/test/ELF/partition-notes.s
index ef99df49bb53..b02e490fff21 100644
--- a/lld/test/ELF/partition-notes.s
+++ b/lld/test/ELF/partition-notes.s
@@ -37,7 +37,7 @@
// CHECK-NEXT: Owner: GNU
// CHECK-NEXT: Data size:
// CHECK-NEXT: Type: NT_GNU_BUILD_ID (unique build ID bitstring)
-// CHECK-NEXT: Build ID: 08b93eab87177a2356d1b0d1148339463f98dac2
+// CHECK-NEXT: Build ID: bb5542bd74252653e286044980d602874d237ae0
// CHECK-NEXT: }
// CHECK-NEXT: }
// CHECK-NEXT: ]
diff --git a/lld/test/ELF/partition-synthetic-sections.s b/lld/test/ELF/partition-synthetic-sections.s
index 2a9bfc5243c7..e959d96583f7 100644
--- a/lld/test/ELF/partition-synthetic-sections.s
+++ b/lld/test/ELF/partition-synthetic-sections.s
@@ -143,7 +143,7 @@
// PART0: 0000000000000498 0 NOTYPE LOCAL HIDDEN {{.*}} __part_index_end
// PART-INDEX: Contents of section .dynstr:
-// PART-INDEX-NEXT: 03a8 00663100 66320070 30007061 72743100 .f1.f2.p0.part1.
+// PART-INDEX-NEXT: 03a8 00703000 66310066 32007061 72743100 .p0.f1.f2.part1.
// PART-INDEX: Contents of section .rodata:
// 0x48c + 0xffffff26 = 0x3b2
// 0x490 + 0x3b70 = 0x4000
diff --git a/lld/test/ELF/partitions.s b/lld/test/ELF/partitions.s
index 712f027a912e..f875a9cb4906 100644
--- a/lld/test/ELF/partitions.s
+++ b/lld/test/ELF/partitions.s
@@ -22,9 +22,9 @@
// CHECK: [[P1]] f4
// CHECK: [[MAIN]] f5
// CHECK: [[P2]] f6
-// CHECK: [[MAIN]] _start
// CHECK: [[P1]] f1
// CHECK: [[P2]] f2
+// CHECK: [[MAIN]] _start
.section .llvm_sympart.f1,"", at llvm_sympart
.asciz "part1"
diff --git a/lld/test/ELF/ppc64-local-entry.s b/lld/test/ELF/ppc64-local-entry.s
index 62a71b68555f..00940b7b27f7 100644
--- a/lld/test/ELF/ppc64-local-entry.s
+++ b/lld/test/ELF/ppc64-local-entry.s
@@ -44,4 +44,4 @@ _start:
// st_other's PPC64 specific flags, thus we check the
// result of the hexdump of .symtab section.
-// CHECK: 0070 00000000 00000000 00000009 12600001
+// CHECK: 0060 00000003 12600001 00000000 00000000
diff --git a/lld/test/ELF/ppc64-pcrel-call-to-extern.s b/lld/test/ELF/ppc64-pcrel-call-to-extern.s
index a1d9a7df3b44..fa476b8884bd 100644
--- a/lld/test/ELF/ppc64-pcrel-call-to-extern.s
+++ b/lld/test/ELF/ppc64-pcrel-call-to-extern.s
@@ -27,9 +27,9 @@
## external function, a r12 setup stub is inserted.
# SYMBOL: Symbol table '.dynsym' contains 4 entries:
-# SYMBOL: 1: 0000000000000000 0 NOTYPE GLOBAL DEFAULT [<other: 0x60>] UND callee_global_TOC
-# SYMBOL-NEXT: 2: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND callee_global_stother0
-# SYMBOL-NEXT: 3: 0000000000000000 0 NOTYPE GLOBAL DEFAULT [<other: 0x20>] UND callee_global_stother1
+# SYMBOL: 1: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND callee_global_stother0
+# SYMBOL-NEXT: 2: 0000000000000000 0 NOTYPE GLOBAL DEFAULT [<other: 0x20>] UND callee_global_stother1
+# SYMBOL-NEXT: 3: 0000000000000000 0 NOTYPE GLOBAL DEFAULT [<other: 0x60>] UND callee_global_TOC
# SYMBOL: Symbol table '.symtab' contains 12 entries:
# SYMBOL: 2: 0000000010010000 0 NOTYPE LOCAL DEFAULT [<other: 0x20>] 6 caller1
@@ -38,9 +38,9 @@
# SYMBOL: 6: 0000000010010010 16 FUNC LOCAL DEFAULT 6 __plt_pcrel_callee_global_stother0
# SYMBOL-NEXT: 7: 0000000010020010 16 FUNC LOCAL DEFAULT 7 __plt_pcrel_callee_global_stother1
# SYMBOL-NEXT: 8: 0000000010030010 16 FUNC LOCAL DEFAULT 8 __plt_pcrel_callee_global_TOC
-# SYMBOL-NEXT: 9: 0000000000000000 0 NOTYPE GLOBAL DEFAULT [<other: 0x60>] UND callee_global_TOC
-# SYMBOL-NEXT: 10: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND callee_global_stother0
-# SYMBOL-NEXT: 11: 0000000000000000 0 NOTYPE GLOBAL DEFAULT [<other: 0x20>] UND callee_global_stother1
+# SYMBOL-NEXT: 9: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND callee_global_stother0
+# SYMBOL-NEXT: 10: 0000000000000000 0 NOTYPE GLOBAL DEFAULT [<other: 0x20>] UND callee_global_stother1
+# SYMBOL-NEXT: 11: 0000000000000000 0 NOTYPE GLOBAL DEFAULT [<other: 0x60>] UND callee_global_TOC
## DT_PLTGOT points to .plt
# SEC: .plt NOBITS 0000000010030148 040148 000028 00 WA 0 0 8
diff --git a/lld/test/ELF/ppc64-tls-ie.s b/lld/test/ELF/ppc64-tls-ie.s
index 8430ab3a4fd0..bb82fdf1cfc5 100644
--- a/lld/test/ELF/ppc64-tls-ie.s
+++ b/lld/test/ELF/ppc64-tls-ie.s
@@ -24,9 +24,9 @@
# IE-REL: .rela.dyn {
# IE-REL-NEXT: 0x204A0 R_PPC64_TPREL64 c 0x0
+# IE-REL-NEXT: 0x204A8 R_PPC64_TPREL64 s 0x0
# IE-REL-NEXT: 0x204B0 R_PPC64_TPREL64 i 0x0
# IE-REL-NEXT: 0x204B8 R_PPC64_TPREL64 l 0x0
-# IE-REL-NEXT: 0x204A8 R_PPC64_TPREL64 s 0x0
# IE-REL-NEXT: }
# INPUT-REL: R_PPC64_GOT_TPREL16_HA c 0x0
diff --git a/lld/test/ELF/ppc64-tls-pcrel-gd.s b/lld/test/ELF/ppc64-tls-pcrel-gd.s
index 6dc8b80396e4..565f29ce0093 100644
--- a/lld/test/ELF/ppc64-tls-pcrel-gd.s
+++ b/lld/test/ELF/ppc64-tls-pcrel-gd.s
@@ -42,30 +42,30 @@ y:
#--- asm
# GD-RELOC: Relocation section '.rela.dyn' at offset 0x100b8 contains 4 entries:
-# GD-RELOC: 0000000001001160 0000000200000044 R_PPC64_DTPMOD64 0000000000000000 x + 0
-# GD-RELOC: 0000000001001168 000000020000004e R_PPC64_DTPREL64 0000000000000000 x + 0
+# GD-RELOC: 0000000001001160 0000000100000044 R_PPC64_DTPMOD64 0000000000000000 x + 0
+# GD-RELOC: 0000000001001168 000000010000004e R_PPC64_DTPREL64 0000000000000000 x + 0
# GD-RELOC: 0000000001001170 0000000300000044 R_PPC64_DTPMOD64 0000000000000000 y + 0
# GD-RELOC: 0000000001001178 000000030000004e R_PPC64_DTPREL64 0000000000000000 y + 0
# GD-SYM: Symbol table '.dynsym' contains 4 entries:
-# GD-SYM: 2: 0000000000000000 0 TLS GLOBAL DEFAULT UND x
-# GD-SYM: 3: 0000000000000000 0 TLS GLOBAL DEFAULT UND y
+# GD-SYM: 0000000000000000 0 TLS GLOBAL DEFAULT UND x
+# GD-SYM: 0000000000000000 0 TLS GLOBAL DEFAULT UND y
# GDTOIE-RELOC: Relocation section '.rela.dyn' at offset 0x{{.*}} contains 2 entries:
-# GDTOIE-RELOC: 00000000010010e0 0000000200000049 R_PPC64_TPREL64 0000000000000000 x + 0
+# GDTOIE-RELOC: 00000000010010e0 0000000100000049 R_PPC64_TPREL64 0000000000000000 x + 0
# GDTOIE-RELOC: 00000000010010e8 0000000300000049 R_PPC64_TPREL64 0000000000000000 y + 0
# GDTOIE-SYM: Symbol table '.dynsym' contains 4 entries:
-# GDTOIE-SYM: 2: 0000000000000000 0 TLS GLOBAL DEFAULT UND x
-# GDTOIE-SYM: 3: 0000000000000000 0 TLS GLOBAL DEFAULT UND y
+# GDTOIE-SYM: 0000000000000000 0 TLS GLOBAL DEFAULT UND x
+# GDTOIE-SYM: 0000000000000000 0 TLS GLOBAL DEFAULT UND y
# GDTOLE-RELOC: There are no relocations in this file.
# GDTOLE-SYM: Symbol table '.symtab' contains 5 entries:
-# GDTOLE-SYM: 3: 0000000000000000 0 TLS GLOBAL DEFAULT 3 x
-# GDTOLE-SYM: 4: 0000000000000004 0 TLS GLOBAL DEFAULT 3 y
+# GDTOLE-SYM: 0000000000000000 0 TLS GLOBAL DEFAULT 3 x
+# GDTOLE-SYM: 0000000000000004 0 TLS GLOBAL DEFAULT 3 y
# GD-LABEL: <GDTwoVal>:
# GD-NEXT: paddi 3, 0, 352, 1
diff --git a/lld/test/ELF/pre_init_fini_array.s b/lld/test/ELF/pre_init_fini_array.s
index d72001edb812..40dce8301447 100644
--- a/lld/test/ELF/pre_init_fini_array.s
+++ b/lld/test/ELF/pre_init_fini_array.s
@@ -45,12 +45,12 @@ _start:
// CHECK-LABEL: Symbol table '.symtab'
// CHECK: Value Size Type Bind Vis Ndx Name
-// CHECK: [[# FINI_ADDR + FINI_SIZE]] 0 NOTYPE LOCAL HIDDEN [[#]] __fini_array_end
-// CHECK-NEXT: [[# FINI_ADDR]] 0 NOTYPE LOCAL HIDDEN [[#]] __fini_array_start
-// CHECK-NEXT: [[# INIT_ADDR + INIT_SIZE]] 0 NOTYPE LOCAL HIDDEN [[#]] __init_array_end
-// CHECK-NEXT: [[# INIT_ADDR]] 0 NOTYPE LOCAL HIDDEN [[#]] __init_array_start
+// CHECK: [[# PREINIT_ADDR]] 0 NOTYPE LOCAL HIDDEN [[#]] __preinit_array_start
// CHECK-NEXT: [[# PREINIT_ADDR + PREINIT_SIZE]] 0 NOTYPE LOCAL HIDDEN [[#]] __preinit_array_end
-// CHECK-NEXT: [[# PREINIT_ADDR]] 0 NOTYPE LOCAL HIDDEN [[#]] __preinit_array_start
+// CHECK-NEXT: [[# INIT_ADDR]] 0 NOTYPE LOCAL HIDDEN [[#]] __init_array_start
+// CHECK-NEXT: [[# INIT_ADDR + INIT_SIZE]] 0 NOTYPE LOCAL HIDDEN [[#]] __init_array_end
+// CHECK-NEXT: [[# FINI_ADDR]] 0 NOTYPE LOCAL HIDDEN [[#]] __fini_array_start
+// CHECK-NEXT: [[# FINI_ADDR + FINI_SIZE]] 0 NOTYPE LOCAL HIDDEN [[#]] __fini_array_end
// DISASM: SYMBOL TABLE:
// DISASM-DAG: {{0*}}[[# %x, PREINIT_ARRAY_START:]] l .preinit_array {{0+}} .hidden __preinit_array_start
diff --git a/lld/test/ELF/relocatable-gc.s b/lld/test/ELF/relocatable-gc.s
index caa23314f37a..a59aa10b4cd6 100644
--- a/lld/test/ELF/relocatable-gc.s
+++ b/lld/test/ELF/relocatable-gc.s
@@ -55,9 +55,9 @@
# KEEP_START: Symbol table '.symtab' contains 10 entries:
# KEEP_START: 5: {{.*}} SECTION
-# KEEP_START-NEXT: 6: {{.*}} UND __start_qux
-# KEEP_START-NEXT: 7: {{.*}} 1 _start
-# KEEP_START-NEXT: 8: {{.*}} 5 fred
+# KEEP_START-NEXT: 6: {{.*}} 1 _start
+# KEEP_START-NEXT: 7: {{.*}} 5 fred
+# KEEP_START-NEXT: 8: {{.*}} UND __start_qux
# KEEP_START-NEXT: 9: {{.*}} UND fred_und
.section qux,"a", at progbits
diff --git a/lld/test/ELF/relocatable-rel-iplt.s b/lld/test/ELF/relocatable-rel-iplt.s
index 6fc50da1b86c..3867ba1fedc1 100644
--- a/lld/test/ELF/relocatable-rel-iplt.s
+++ b/lld/test/ELF/relocatable-rel-iplt.s
@@ -23,7 +23,7 @@
// CHECK-NEXT: Section: .text (0x1)
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
-// CHECK-NEXT: Name: __rel_iplt_end (1)
+// CHECK-NEXT: Name: __rel_iplt_start (1)
// CHECK-NEXT: Value: 0x0
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Weak (0x2)
@@ -34,7 +34,7 @@
// CHECK-NEXT: Section: Undefined (0x0)
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
-// CHECK-NEXT: Name: __rel_iplt_start (16)
+// CHECK-NEXT: Name: __rel_iplt_end (18)
// CHECK-NEXT: Value: 0x0
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Weak (0x2)
diff --git a/lld/test/ELF/relocatable-symbols.s b/lld/test/ELF/relocatable-symbols.s
index fd49f7d06a5e..d21140e44b4e 100644
--- a/lld/test/ELF/relocatable-symbols.s
+++ b/lld/test/ELF/relocatable-symbols.s
@@ -66,8 +66,8 @@
# SYMBOL-NEXT: 0x38 R_X86_64_PC32 __fini_array_end 0xFFFFFFFFFFFFFFFC
# SYMBOL-NEXT: }
# SYMBOL-NEXT: ]
-# SYMBOL: Symbol {
-# SYMBOL: Name: __fini_array_end
+
+# SYMBOL: Name: __start_foo
# SYMBOL-NEXT: Value: 0x0
# SYMBOL-NEXT: Size: 0
# SYMBOL-NEXT: Binding: Global
@@ -76,7 +76,7 @@
# SYMBOL-NEXT: Section: Undefined
# SYMBOL-NEXT: }
# SYMBOL-NEXT: Symbol {
-# SYMBOL-NEXT: Name: __fini_array_start
+# SYMBOL-NEXT: Name: __stop_foo
# SYMBOL-NEXT: Value: 0x0
# SYMBOL-NEXT: Size: 0
# SYMBOL-NEXT: Binding: Global
@@ -85,7 +85,7 @@
# SYMBOL-NEXT: Section: Undefined
# SYMBOL-NEXT: }
# SYMBOL-NEXT: Symbol {
-# SYMBOL-NEXT: Name: __init_array_end
+# SYMBOL-NEXT: Name: __start_bar
# SYMBOL-NEXT: Value: 0x0
# SYMBOL-NEXT: Size: 0
# SYMBOL-NEXT: Binding: Global
@@ -94,7 +94,7 @@
# SYMBOL-NEXT: Section: Undefined
# SYMBOL-NEXT: }
# SYMBOL-NEXT: Symbol {
-# SYMBOL-NEXT: Name: __init_array_start
+# SYMBOL-NEXT: Name: __stop_bar
# SYMBOL-NEXT: Value: 0x0
# SYMBOL-NEXT: Size: 0
# SYMBOL-NEXT: Binding: Global
@@ -103,7 +103,7 @@
# SYMBOL-NEXT: Section: Undefined
# SYMBOL-NEXT: }
# SYMBOL-NEXT: Symbol {
-# SYMBOL-NEXT: Name: __preinit_array_end
+# SYMBOL-NEXT: Name: __start_doo
# SYMBOL-NEXT: Value: 0x0
# SYMBOL-NEXT: Size: 0
# SYMBOL-NEXT: Binding: Global
@@ -112,7 +112,7 @@
# SYMBOL-NEXT: Section: Undefined
# SYMBOL-NEXT: }
# SYMBOL-NEXT: Symbol {
-# SYMBOL-NEXT: Name: __preinit_array_start
+# SYMBOL-NEXT: Name: __stop_doo
# SYMBOL-NEXT: Value: 0x0
# SYMBOL-NEXT: Size: 0
# SYMBOL-NEXT: Binding: Global
@@ -121,7 +121,7 @@
# SYMBOL-NEXT: Section: Undefined
# SYMBOL-NEXT: }
# SYMBOL-NEXT: Symbol {
-# SYMBOL-NEXT: Name: __start_bar
+# SYMBOL-NEXT: Name: __preinit_array_start
# SYMBOL-NEXT: Value: 0x0
# SYMBOL-NEXT: Size: 0
# SYMBOL-NEXT: Binding: Global
@@ -130,7 +130,7 @@
# SYMBOL-NEXT: Section: Undefined
# SYMBOL-NEXT: }
# SYMBOL-NEXT: Symbol {
-# SYMBOL-NEXT: Name: __start_doo
+# SYMBOL-NEXT: Name: __preinit_array_end
# SYMBOL-NEXT: Value: 0x0
# SYMBOL-NEXT: Size: 0
# SYMBOL-NEXT: Binding: Global
@@ -139,7 +139,7 @@
# SYMBOL-NEXT: Section: Undefined
# SYMBOL-NEXT: }
# SYMBOL-NEXT: Symbol {
-# SYMBOL-NEXT: Name: __start_foo
+# SYMBOL-NEXT: Name: __init_array_start
# SYMBOL-NEXT: Value: 0x0
# SYMBOL-NEXT: Size: 0
# SYMBOL-NEXT: Binding: Global
@@ -148,7 +148,7 @@
# SYMBOL-NEXT: Section: Undefined
# SYMBOL-NEXT: }
# SYMBOL-NEXT: Symbol {
-# SYMBOL-NEXT: Name: __stop_bar
+# SYMBOL-NEXT: Name: __init_array_end
# SYMBOL-NEXT: Value: 0x0
# SYMBOL-NEXT: Size: 0
# SYMBOL-NEXT: Binding: Global
@@ -156,8 +156,8 @@
# SYMBOL-NEXT: Other: 0
# SYMBOL-NEXT: Section: Undefined
# SYMBOL-NEXT: }
-# SYMBOL-NEXT: Symbol {
-# SYMBOL-NEXT: Name: __stop_doo
+# SYMBOL: Symbol {
+# SYMBOL-NEXT: Name: __fini_array_start
# SYMBOL-NEXT: Value: 0x0
# SYMBOL-NEXT: Size: 0
# SYMBOL-NEXT: Binding: Global
@@ -166,7 +166,7 @@
# SYMBOL-NEXT: Section: Undefined
# SYMBOL-NEXT: }
# SYMBOL-NEXT: Symbol {
-# SYMBOL-NEXT: Name: __stop_foo
+# SYMBOL-NEXT: Name: __fini_array_end
# SYMBOL-NEXT: Value: 0x0
# SYMBOL-NEXT: Size: 0
# SYMBOL-NEXT: Binding: Global
diff --git a/lld/test/ELF/resolution.s b/lld/test/ELF/resolution.s
index d570e51972d6..b2b2171d6975 100644
--- a/lld/test/ELF/resolution.s
+++ b/lld/test/ELF/resolution.s
@@ -11,39 +11,39 @@
// CHECK: Symbol table '.symtab' contains 34 entries:
// CHECK-NEXT: Num: Value Size Type Bind Vis Ndx Name
// CHECK-NEXT: 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
-// CHECK-NEXT: 1: 00000000002021ec 63 OBJECT GLOBAL DEFAULT 2 CommonStrong_with_CommonStrong
-// CHECK-NEXT: 2: 000000000020222c 30 OBJECT GLOBAL DEFAULT 2 CommonStrong_with_CommonWeak
-// CHECK-NEXT: 3: 00000000002011cc 55 NOTYPE GLOBAL DEFAULT 1 CommonStrong_with_RegularStrong
-// CHECK-NEXT: 4: 000000000020224c 22 OBJECT GLOBAL DEFAULT 2 CommonStrong_with_RegularWeak
-// CHECK-NEXT: 5: 0000000000202264 27 OBJECT GLOBAL DEFAULT 2 CommonStrong_with_UndefStrong
-// CHECK-NEXT: 6: 0000000000202280 26 OBJECT GLOBAL DEFAULT 2 CommonStrong_with_UndefWeak
-// CHECK-NEXT: 7: 000000000020229c 61 OBJECT GLOBAL DEFAULT 2 CommonWeak_with_CommonStrong
-// CHECK-NEXT: 8: 00000000002022dc 28 OBJECT WEAK DEFAULT 2 CommonWeak_with_CommonWeak
-// CHECK-NEXT: 9: 00000000002011cc 53 NOTYPE GLOBAL DEFAULT 1 CommonWeak_with_RegularStrong
-// CHECK-NEXT: 10: 00000000002022f8 20 OBJECT WEAK DEFAULT 2 CommonWeak_with_RegularWeak
-// CHECK-NEXT: 11: 000000000020230c 25 OBJECT WEAK DEFAULT 2 CommonWeak_with_UndefStrong
-// CHECK-NEXT: 12: 0000000000202328 24 OBJECT WEAK DEFAULT 2 CommonWeak_with_UndefWeak
-// CHECK-NEXT: 13: 0000000000201159 10 NOTYPE GLOBAL DEFAULT 1 RegularStrong_with_CommonStrong
-// CHECK-NEXT: 14: 0000000000201159 9 NOTYPE GLOBAL DEFAULT 1 RegularStrong_with_CommonWeak
-// CHECK-NEXT: 15: 0000000000201159 2 NOTYPE GLOBAL DEFAULT 1 RegularStrong_with_RegularWeak
-// CHECK-NEXT: 16: 0000000000201159 6 NOTYPE GLOBAL DEFAULT 1 RegularStrong_with_UndefStrong
-// CHECK-NEXT: 17: 0000000000201159 5 NOTYPE GLOBAL DEFAULT 1 RegularStrong_with_UndefWeak
-// CHECK-NEXT: 18: 0000000000202340 40 OBJECT GLOBAL DEFAULT 2 RegularWeak_with_CommonStrong
-// CHECK-NEXT: 19: 0000000000201159 7 NOTYPE WEAK DEFAULT 1 RegularWeak_with_CommonWeak
-// CHECK-NEXT: 20: 00000000002011a4 33 NOTYPE GLOBAL DEFAULT 1 RegularWeak_with_RegularStrong
-// CHECK-NEXT: 21: 0000000000201159 0 NOTYPE WEAK DEFAULT 1 RegularWeak_with_RegularWeak
-// CHECK-NEXT: 22: 0000000000201159 4 NOTYPE WEAK DEFAULT 1 RegularWeak_with_UndefStrong
-// CHECK-NEXT: 23: 0000000000201159 3 NOTYPE WEAK DEFAULT 1 RegularWeak_with_UndefWeak
-// CHECK-NEXT: 24: 0000000000202368 51 OBJECT GLOBAL DEFAULT 2 UndefStrong_with_CommonStrong
-// CHECK-NEXT: 25: 000000000020239c 50 OBJECT WEAK DEFAULT 2 UndefStrong_with_CommonWeak
-// CHECK-NEXT: 26: 00000000002011c4 46 NOTYPE GLOBAL DEFAULT 1 UndefStrong_with_RegularStrong
-// CHECK-NEXT: 27: 00000000002011c4 45 NOTYPE WEAK DEFAULT 1 UndefStrong_with_RegularWeak
-// CHECK-NEXT: 28: 00000000002023d0 49 OBJECT GLOBAL DEFAULT 2 UndefWeak_with_CommonStrong
-// CHECK-NEXT: 29: 0000000000202404 48 OBJECT WEAK DEFAULT 2 UndefWeak_with_CommonWeak
-// CHECK-NEXT: 30: 00000000002011c4 44 NOTYPE GLOBAL DEFAULT 1 UndefWeak_with_RegularStrong
-// CHECK-NEXT: 31: 00000000002011c4 43 NOTYPE WEAK DEFAULT 1 UndefWeak_with_RegularWeak
-// CHECK-NEXT: 32: 0000000000000000 0 NOTYPE WEAK DEFAULT UND UndefWeak_with_UndefWeak
-// CHECK-NEXT: 33: 0000000000201158 0 NOTYPE GLOBAL DEFAULT 1 _start
+// CHECK-NEXT: 1: 0000000000201158 0 NOTYPE GLOBAL DEFAULT 1 _start
+// CHECK-NEXT: 2: 0000000000201159 0 NOTYPE WEAK DEFAULT 1 RegularWeak_with_RegularWeak
+// CHECK-NEXT: 3: 00000000002011a4 33 NOTYPE GLOBAL DEFAULT 1 RegularWeak_with_RegularStrong
+// CHECK-NEXT: 4: 0000000000201159 2 NOTYPE GLOBAL DEFAULT 1 RegularStrong_with_RegularWeak
+// CHECK-NEXT: 5: 0000000000201159 3 NOTYPE WEAK DEFAULT 1 RegularWeak_with_UndefWeak
+// CHECK-NEXT: 6: 0000000000201159 4 NOTYPE WEAK DEFAULT 1 RegularWeak_with_UndefStrong
+// CHECK-NEXT: 7: 0000000000201159 5 NOTYPE GLOBAL DEFAULT 1 RegularStrong_with_UndefWeak
+// CHECK-NEXT: 8: 0000000000201159 6 NOTYPE GLOBAL DEFAULT 1 RegularStrong_with_UndefStrong
+// CHECK-NEXT: 9: 0000000000201159 7 NOTYPE WEAK DEFAULT 1 RegularWeak_with_CommonWeak
+// CHECK-NEXT: 10: 00000000002021ec 40 OBJECT GLOBAL DEFAULT 2 RegularWeak_with_CommonStrong
+// CHECK-NEXT: 11: 0000000000201159 9 NOTYPE GLOBAL DEFAULT 1 RegularStrong_with_CommonWeak
+// CHECK-NEXT: 12: 0000000000201159 10 NOTYPE GLOBAL DEFAULT 1 RegularStrong_with_CommonStrong
+// CHECK-NEXT: 13: 00000000002011c4 43 NOTYPE WEAK DEFAULT 1 UndefWeak_with_RegularWeak
+// CHECK-NEXT: 14: 00000000002011c4 44 NOTYPE GLOBAL DEFAULT 1 UndefWeak_with_RegularStrong
+// CHECK-NEXT: 15: 00000000002011c4 45 NOTYPE WEAK DEFAULT 1 UndefStrong_with_RegularWeak
+// CHECK-NEXT: 16: 00000000002011c4 46 NOTYPE GLOBAL DEFAULT 1 UndefStrong_with_RegularStrong
+// CHECK-NEXT: 17: 0000000000000000 0 NOTYPE WEAK DEFAULT UND UndefWeak_with_UndefWeak
+// CHECK-NEXT: 18: 0000000000202214 48 OBJECT WEAK DEFAULT 2 UndefWeak_with_CommonWeak
+// CHECK-NEXT: 19: 0000000000202244 49 OBJECT GLOBAL DEFAULT 2 UndefWeak_with_CommonStrong
+// CHECK-NEXT: 20: 0000000000202278 50 OBJECT WEAK DEFAULT 2 UndefStrong_with_CommonWeak
+// CHECK-NEXT: 21: 00000000002022ac 51 OBJECT GLOBAL DEFAULT 2 UndefStrong_with_CommonStrong
+// CHECK-NEXT: 22: 00000000002022e0 20 OBJECT WEAK DEFAULT 2 CommonWeak_with_RegularWeak
+// CHECK-NEXT: 23: 00000000002011cc 53 NOTYPE GLOBAL DEFAULT 1 CommonWeak_with_RegularStrong
+// CHECK-NEXT: 24: 00000000002022f4 22 OBJECT GLOBAL DEFAULT 2 CommonStrong_with_RegularWeak
+// CHECK-NEXT: 25: 00000000002011cc 55 NOTYPE GLOBAL DEFAULT 1 CommonStrong_with_RegularStrong
+// CHECK-NEXT: 26: 000000000020230c 24 OBJECT WEAK DEFAULT 2 CommonWeak_with_UndefWeak
+// CHECK-NEXT: 27: 0000000000202324 25 OBJECT WEAK DEFAULT 2 CommonWeak_with_UndefStrong
+// CHECK-NEXT: 28: 0000000000202340 26 OBJECT GLOBAL DEFAULT 2 CommonStrong_with_UndefWeak
+// CHECK-NEXT: 29: 000000000020235c 27 OBJECT GLOBAL DEFAULT 2 CommonStrong_with_UndefStrong
+// CHECK-NEXT: 30: 0000000000202378 28 OBJECT WEAK DEFAULT 2 CommonWeak_with_CommonWeak
+// CHECK-NEXT: 31: 0000000000202394 61 OBJECT GLOBAL DEFAULT 2 CommonWeak_with_CommonStrong
+// CHECK-NEXT: 32: 00000000002023d4 30 OBJECT GLOBAL DEFAULT 2 CommonStrong_with_CommonWeak
+// CHECK-NEXT: 33: 00000000002023f4 63 OBJECT GLOBAL DEFAULT 2 CommonStrong_with_CommonStrong
.globl _start
_start:
diff --git a/lld/test/ELF/retain-symbols-file.s b/lld/test/ELF/retain-symbols-file.s
index 0ab19774b534..9cf9e6562fc6 100644
--- a/lld/test/ELF/retain-symbols-file.s
+++ b/lld/test/ELF/retain-symbols-file.s
@@ -20,13 +20,13 @@
# CHECK-NEXT: Section:
# CHECK-NEXT: }
# CHECK-NEXT: Symbol {
-# CHECK-NEXT: Name: bar
+# CHECK-NEXT: Name: und
# CHECK-NEXT: Value:
# CHECK-NEXT: Size:
# CHECK-NEXT: Binding: Global
# CHECK-NEXT: Type:
# CHECK-NEXT: Other:
-# CHECK-NEXT: Section: .text
+# CHECK-NEXT: Section: Undefined
# CHECK-NEXT: }
# CHECK-NEXT: Symbol {
# CHECK-NEXT: Name: foo
@@ -38,13 +38,13 @@
# CHECK-NEXT: Section: .text
# CHECK-NEXT: }
# CHECK-NEXT: Symbol {
-# CHECK-NEXT: Name: und
+# CHECK-NEXT: Name: bar
# CHECK-NEXT: Value:
# CHECK-NEXT: Size:
# CHECK-NEXT: Binding: Global
# CHECK-NEXT: Type:
# CHECK-NEXT: Other:
-# CHECK-NEXT: Section: Undefined
+# CHECK-NEXT: Section: .text
# CHECK-NEXT: }
# CHECK-NEXT: ]
diff --git a/lld/test/ELF/start-lib.s b/lld/test/ELF/start-lib.s
index b79d9efc325a..04ac5a6323d0 100644
--- a/lld/test/ELF/start-lib.s
+++ b/lld/test/ELF/start-lib.s
@@ -8,18 +8,18 @@
// RUN: ld.lld -o %t3 %t1.o %t2.o %t3.o
// RUN: llvm-readobj --symbols %t3 | FileCheck --check-prefix=TEST1 %s
-// TEST1: Name: bar
// TEST1: Name: foo
+// TEST1: Name: bar
// RUN: ld.lld -o %t3 %t1.o -u bar --start-lib %t2.o %t3.o
// RUN: llvm-readobj --symbols %t3 | FileCheck --check-prefix=TEST2 %s
-// TEST2: Name: bar
// TEST2-NOT: Name: foo
+// TEST2: Name: bar
// RUN: ld.lld -o %t3 %t1.o --start-lib %t2.o %t3.o
// RUN: llvm-readobj --symbols %t3 | FileCheck --check-prefix=TEST3 %s
-// TEST3-NOT: Name: bar
// TEST3-NOT: Name: foo
+// TEST3-NOT: Name: bar
// RUN: not ld.lld %t1.o --start-lib --start-lib 2>&1 | FileCheck -check-prefix=NESTED-LIB %s
// NESTED-LIB: nested --start-lib
diff --git a/lld/test/ELF/startstop.s b/lld/test/ELF/startstop.s
index 86f203b84ff1..7ec2c92cf331 100644
--- a/lld/test/ELF/startstop.s
+++ b/lld/test/ELF/startstop.s
@@ -30,13 +30,6 @@
// SYMBOL-NEXT: }
// SYMBOL-NEXT: ]
-// SYMBOL: Symbol {
-// SYMBOL: Name: __start_bar
-// SYMBOL: Value: 0x1342
-// SYMBOL: STV_HIDDEN
-// SYMBOL: Section: bar
-// SYMBOL: }
-// SYMBOL-NOT: Section: __stop_bar
// SYMBOL: Symbol {
// SYMBOL: Name: __start_foo
// SYMBOL: Value: 0x133F
@@ -49,19 +42,26 @@
// SYMBOL: STV_HIDDEN
// SYMBOL: Section: foo
// SYMBOL: }
-
// SYMBOL: Symbol {
-// SYMBOL: Name: __stop_zed1
-// SYMBOL: Value: 0x3408
-// SYMBOL: STV_PROTECTED
-// SYMBOL: Section: zed1
+// SYMBOL: Name: __start_bar
+// SYMBOL: Value: 0x1342
+// SYMBOL: STV_HIDDEN
+// SYMBOL: Section: bar
// SYMBOL: }
+// SYMBOL-NOT: Section: __stop_bar
+
// SYMBOL: Symbol {
// SYMBOL: Name: __stop_zed2
// SYMBOL: Value: 0x3418
// SYMBOL: STV_PROTECTED
// SYMBOL: Section: zed2
// SYMBOL: }
+// SYMBOL: Symbol {
+// SYMBOL: Name: __stop_zed1
+// SYMBOL: Value: 0x3408
+// SYMBOL: STV_PROTECTED
+// SYMBOL: Section: zed1
+// SYMBOL: }
.hidden __start_foo
.hidden __stop_foo
diff --git a/lld/test/ELF/symbol-ordering-file-warnings.s b/lld/test/ELF/symbol-ordering-file-warnings.s
index ec38edc62314..daf47bcdb31c 100644
--- a/lld/test/ELF/symbol-ordering-file-warnings.s
+++ b/lld/test/ELF/symbol-ordering-file-warnings.s
@@ -97,13 +97,13 @@
# WARN-NOT: warning:
# SAMESYM: warning: {{.*}}.txt: duplicate ordered symbol: _start
# WARN-NOT: warning:
-# SYNTHETIC: warning: <internal>: unable to order synthetic symbol: _GLOBAL_OFFSET_TABLE_
+# SHARED: warning: {{.*}}.so: unable to order shared symbol: shared
# WARN-NOT: warning:
# DISCARD: warning: {{.*}}1.o: unable to order discarded symbol: discard
# WARN-NOT: warning:
# GC: warning: {{.*}}1.o: unable to order discarded symbol: gc
# WARN-NOT: warning:
-# SHARED: warning: {{.*}}.so: unable to order shared symbol: shared
+# SYNTHETIC: warning: <internal>: unable to order synthetic symbol: _GLOBAL_OFFSET_TABLE_
# WARN-NOT: warning:
# UNDEFINED: warning: {{.*}}3.o: unable to order undefined symbol: undefined
# WARN-NOT: warning:
diff --git a/lld/test/ELF/symbols.s b/lld/test/ELF/symbols.s
index 56eec23f80e9..0b56c8ab548f 100644
--- a/lld/test/ELF/symbols.s
+++ b/lld/test/ELF/symbols.s
@@ -112,13 +112,13 @@ internal:
// CHECK-NEXT: Section: .text
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
-// CHECK-NEXT: Name: abs
-// CHECK-NEXT: Value: 0x123
+// CHECK-NEXT: Name: foo
+// CHECK-NEXT: Value: 0x201160
// CHECK-NEXT: Size: 0
-// CHECK-NEXT: Binding: Global
-// CHECK-NEXT: Type: None
+// CHECK-NEXT: Binding: Weak (0x2)
+// CHECK-NEXT: Type: Object
// CHECK-NEXT: Other: 0
-// CHECK-NEXT: Section: Absolute
+// CHECK-NEXT: Section: .text
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
// CHECK-NEXT: Name: bar
@@ -130,59 +130,59 @@ internal:
// CHECK-NEXT: Section: Undefined (0x0)
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
-// CHECK-NEXT: Name: common
-// CHECK-NEXT: Value: 0x202164
-// CHECK-NEXT: Size: 4
-// CHECK-NEXT: Binding: Global
-// CHECK-NEXT: Type: Object
+// CHECK-NEXT: Name: zed
+// CHECK-NEXT: Value: 0x200158
+// CHECK-NEXT: Size: 0
+// CHECK-NEXT: Binding: Global (0x1)
+// CHECK-NEXT: Type: None
// CHECK-NEXT: Other: 0
-// CHECK-NEXT: Section: .bss
+// CHECK-NEXT: Section: foobar
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
-// CHECK-NEXT: Name: foo
-// CHECK-NEXT: Value: 0x201160
+// CHECK-NEXT: Name: zed2
+// CHECK-NEXT: Value: 0x20015C
// CHECK-NEXT: Size: 0
-// CHECK-NEXT: Binding: Weak (0x2)
-// CHECK-NEXT: Type: Object
+// CHECK-NEXT: Binding: Global
+// CHECK-NEXT: Type: None
// CHECK-NEXT: Other: 0
-// CHECK-NEXT: Section: .text
+// CHECK-NEXT: Section: foobar
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
-// CHECK-NEXT: Name: protected
+// CHECK-NEXT: Name: zed3
// CHECK-NEXT: Value: 0x200160
-// CHECK-NEXT: Size: 0
+// CHECK-NEXT: Size: 4
// CHECK-NEXT: Binding: Global
// CHECK-NEXT: Type: None
-// CHECK-NEXT: Other [ (0x3)
-// CHECK-NEXT: STV_PROTECTED
-// CHECK-NEXT: ]
+// CHECK-NEXT: Other: 0
// CHECK-NEXT: Section: foobar
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
-// CHECK-NEXT: Name: zed
-// CHECK-NEXT: Value: 0x200158
+// CHECK-NEXT: Name: abs
+// CHECK-NEXT: Value: 0x123
// CHECK-NEXT: Size: 0
-// CHECK-NEXT: Binding: Global (0x1)
+// CHECK-NEXT: Binding: Global
// CHECK-NEXT: Type: None
// CHECK-NEXT: Other: 0
-// CHECK-NEXT: Section: foobar
+// CHECK-NEXT: Section: Absolute
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
-// CHECK-NEXT: Name: zed2
-// CHECK-NEXT: Value: 0x20015C
-// CHECK-NEXT: Size: 0
+// CHECK-NEXT: Name: common
+// CHECK-NEXT: Value: 0x202164
+// CHECK-NEXT: Size: 4
// CHECK-NEXT: Binding: Global
-// CHECK-NEXT: Type: None
+// CHECK-NEXT: Type: Object
// CHECK-NEXT: Other: 0
-// CHECK-NEXT: Section: foobar
+// CHECK-NEXT: Section: .bss
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
-// CHECK-NEXT: Name: zed3
+// CHECK-NEXT: Name: protected
// CHECK-NEXT: Value: 0x200160
-// CHECK-NEXT: Size: 4
+// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Global
// CHECK-NEXT: Type: None
-// CHECK-NEXT: Other: 0
+// CHECK-NEXT: Other [ (0x3)
+// CHECK-NEXT: STV_PROTECTED
+// CHECK-NEXT: ]
// CHECK-NEXT: Section: foobar
// CHECK-NEXT: }
// CHECK-NEXT: ]
diff --git a/lld/test/ELF/undef-with-plt-addr.s b/lld/test/ELF/undef-with-plt-addr.s
index 447c620401ef..7f8e0afc770b 100644
--- a/lld/test/ELF/undef-with-plt-addr.s
+++ b/lld/test/ELF/undef-with-plt-addr.s
@@ -31,16 +31,16 @@ movabsq $set_data, %rax
// CHECK-NEXT: 0x203420 R_X86_64_JUMP_SLOT set_data 0x0
// CHECK-NEXT: }
-// CHECK: Name: foo
-// CHECK-NEXT: Value: 0x0
+// CHECK: Name: set_data
+// CHECK-NEXT: Value: 0x2012F0
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Global
// CHECK-NEXT: Type: Function
// CHECK-NEXT: Other: 0
// CHECK-NEXT: Section: Undefined
-// CHECK: Name: set_data
-// CHECK-NEXT: Value: 0x2012F0
+// CHECK: Name: foo
+// CHECK-NEXT: Value: 0x0
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Global
// CHECK-NEXT: Type: Function
diff --git a/lld/test/ELF/verdef-defaultver.s b/lld/test/ELF/verdef-defaultver.s
index 7d2a0d27fa11..05bf7333df8a 100644
--- a/lld/test/ELF/verdef-defaultver.s
+++ b/lld/test/ELF/verdef-defaultver.s
@@ -17,8 +17,8 @@
# DSO-NEXT: Section: Undefined
# DSO-NEXT: }
# DSO-NEXT: Symbol {
-# DSO-NEXT: Name: a@@V1
-# DSO-NEXT: Value: 0x12E8
+# DSO-NEXT: Name: b at V1
+# DSO-NEXT: Value: 0x12E9
# DSO-NEXT: Size: 0
# DSO-NEXT: Binding: Global
# DSO-NEXT: Type: Function
@@ -35,8 +35,8 @@
# DSO-NEXT: Section: .text
# DSO-NEXT: }
# DSO-NEXT: Symbol {
-# DSO-NEXT: Name: b at V1
-# DSO-NEXT: Value: 0x12E9
+# DSO-NEXT: Name: a@@V1
+# DSO-NEXT: Value: 0x12E8
# DSO-NEXT: Size: 0
# DSO-NEXT: Binding: Global
# DSO-NEXT: Type: Function
@@ -60,7 +60,7 @@
# DSO-NEXT: }
# DSO-NEXT: Symbol {
# DSO-NEXT: Version: 2
-# DSO-NEXT: Name: a@@V1
+# DSO-NEXT: Name: b at V1
# DSO-NEXT: }
# DSO-NEXT: Symbol {
# DSO-NEXT: Version: 3
@@ -68,7 +68,7 @@
# DSO-NEXT: }
# DSO-NEXT: Symbol {
# DSO-NEXT: Version: 2
-# DSO-NEXT: Name: b at V1
+# DSO-NEXT: Name: a@@V1
# DSO-NEXT: }
# DSO-NEXT: Symbol {
# DSO-NEXT: Version: 3
diff --git a/lld/test/ELF/version-script-complex-wildcards.s b/lld/test/ELF/version-script-complex-wildcards.s
index 1ba34787646d..233c4b1fdd90 100644
--- a/lld/test/ELF/version-script-complex-wildcards.s
+++ b/lld/test/ELF/version-script-complex-wildcards.s
@@ -51,12 +51,12 @@
# ERROR: invalid glob pattern: a[
.text
-.globl _Z3abci
-.type _Z3abci, at function
-_Z3abci:
-retq
-
.globl _Z3abbi
.type _Z3abbi, at function
_Z3abbi:
retq
+
+.globl _Z3abci
+.type _Z3abci, at function
+_Z3abci:
+retq
diff --git a/lld/test/ELF/version-script-extern-exact.s b/lld/test/ELF/version-script-extern-exact.s
index b092cffde449..f00b3acc7738 100644
--- a/lld/test/ELF/version-script-extern-exact.s
+++ b/lld/test/ELF/version-script-extern-exact.s
@@ -6,16 +6,16 @@
# RUN: llvm-readobj --dyn-syms %t.so | FileCheck %s --check-prefix=NOMATCH
# NOMATCH: DynamicSymbols [
-# NOMATCH-NOT: _Z3aaaPf@@FOO
# NOMATCH-NOT: _Z3aaaPi@@FOO
+# NOMATCH-NOT: _Z3aaaPf@@FOO
# NOMATCH: ]
# RUN: echo "FOO { global: extern \"C++\" { \"aaa*\"; aaa*; }; };" > %t2.script
# RUN: ld.lld --version-script %t2.script -shared %t.o -o %t2.so
# RUN: llvm-readobj --dyn-syms %t2.so | FileCheck %s --check-prefix=MATCH
# MATCH: DynamicSymbols [
-# MATCH: _Z3aaaPf@@FOO
# MATCH: _Z3aaaPi@@FOO
+# MATCH: _Z3aaaPf@@FOO
# MATCH: ]
.text
diff --git a/lld/test/ELF/version-script-extern-wildcards-anon.s b/lld/test/ELF/version-script-extern-wildcards-anon.s
index 8f5164579706..1ff65eb2bbcd 100644
--- a/lld/test/ELF/version-script-extern-wildcards-anon.s
+++ b/lld/test/ELF/version-script-extern-wildcards-anon.s
@@ -62,13 +62,13 @@
# CHECK-NEXT: }
# CHECK-NEXT: ]
-.global _Z3fooi
-_Z3fooi:
.global _Z3bari
_Z3bari:
-.global _Z3zedi
-_Z3zedi:
.global _Z3bazi
_Z3bazi:
+.global _Z3fooi
+_Z3fooi:
+.global _Z3zedi
+_Z3zedi:
.global _ZSt3qux
_ZSt3qux:
diff --git a/lld/test/ELF/version-script-extern-wildcards.s b/lld/test/ELF/version-script-extern-wildcards.s
index 1b4a03bce1dd..18ce20bc605d 100644
--- a/lld/test/ELF/version-script-extern-wildcards.s
+++ b/lld/test/ELF/version-script-extern-wildcards.s
@@ -7,8 +7,8 @@
# RUN: llvm-readobj -V --dyn-syms %t.so | FileCheck %s
# CHECK: VersionSymbols [
-# CHECK: Name: _Z3bari
# CHECK: Name: _Z3fooi@@FOO
+# CHECK: Name: _Z3bari
# CHECK: Name: _Z3zedi@@BAR
.text
diff --git a/lld/test/ELF/version-script-extern.s b/lld/test/ELF/version-script-extern.s
index f636f2c01461..29059eac8e40 100644
--- a/lld/test/ELF/version-script-extern.s
+++ b/lld/test/ELF/version-script-extern.s
@@ -21,7 +21,7 @@
# DSO-NEXT: Section: Undefined
# DSO-NEXT: }
# DSO-NEXT: Symbol {
-# DSO-NEXT: Name: _Z3bari@@LIBSAMPLE_2.0
+# DSO-NEXT: Name: _Z3fooi@@LIBSAMPLE_1.0
# DSO-NEXT: Value:
# DSO-NEXT: Size: 0
# DSO-NEXT: Binding: Global
@@ -30,7 +30,7 @@
# DSO-NEXT: Section: .text
# DSO-NEXT: }
# DSO-NEXT: Symbol {
-# DSO-NEXT: Name: _Z3fooi@@LIBSAMPLE_1.0
+# DSO-NEXT: Name: _Z3bari@@LIBSAMPLE_2.0
# DSO-NEXT: Value:
# DSO-NEXT: Size: 0
# DSO-NEXT: Binding: Global
@@ -72,14 +72,14 @@
# DSO-NEXT: Name:
# DSO-NEXT: }
# DSO-NEXT: Symbol {
-# DSO-NEXT: Version: 3
-# DSO-NEXT: Name: _Z3bari@@LIBSAMPLE_2.0
-# DSO-NEXT: }
-# DSO-NEXT: Symbol {
# DSO-NEXT: Version: 2
# DSO-NEXT: Name: _Z3fooi@@LIBSAMPLE_1.0
# DSO-NEXT: }
# DSO-NEXT: Symbol {
+# DSO-NEXT: Version: 3
+# DSO-NEXT: Name: _Z3bari@@LIBSAMPLE_2.0
+# DSO-NEXT: }
+# DSO-NEXT: Symbol {
# DSO-NEXT: Version: 2
# DSO-NEXT: Name: _Z3zedi@@LIBSAMPLE_1.0
# DSO-NEXT: }
diff --git a/lld/test/ELF/version-script-glob.s b/lld/test/ELF/version-script-glob.s
index b3b9f255ddc2..0f2bd88875e2 100644
--- a/lld/test/ELF/version-script-glob.s
+++ b/lld/test/ELF/version-script-glob.s
@@ -11,8 +11,8 @@ bar1:
zed1:
local:
-# CHECK: bar1{{$}}
-# CHECK-NEXT: foo1{{$}}
+# CHECK: foo1{{$}}
+# CHECK-NEXT: bar1{{$}}
# CHECK-NOT: {{.}}
# RUN: echo "{ global : local; local: *; };" > %t1.script
diff --git a/lld/test/ELF/version-script-locals.s b/lld/test/ELF/version-script-locals.s
index 210adefad8c6..119d4cc7bdd2 100644
--- a/lld/test/ELF/version-script-locals.s
+++ b/lld/test/ELF/version-script-locals.s
@@ -5,28 +5,28 @@
# RUN: ld.lld --version-script %t.script -shared %t.o -o %t.so
# RUN: llvm-readobj --dyn-syms %t.so | FileCheck --check-prefix=EXACT %s
# EXACT: DynamicSymbols [
-# EXACT: _start
# EXACT-NOT: foo1
# EXACT: foo2
# EXACT: foo3
+# EXACT: _start
# RUN: echo "VERSION_1.0 { local: foo*; };" > %t.script
# RUN: ld.lld --version-script %t.script -shared %t.o -o %t.so
# RUN: llvm-readobj --dyn-syms %t.so | FileCheck --check-prefix=WC %s
# WC: DynamicSymbols [
-# WC: _start
# WC-NOT: foo1
# WC-NOT: foo2
# WC-NOT: foo3
+# WC: _start
# RUN: echo "VERSION_1.0 { global: *; local: foo*; };" > %t.script
# RUN: ld.lld --version-script %t.script -shared %t.o -o %t.so
# RUN: llvm-readobj --dyn-syms %t.so | FileCheck --check-prefix=MIX %s
# MIX: DynamicSymbols [
-# MIX: _start@@VERSION_1.0
# MIX-NOT: foo1
# MIX-NOT: foo2
# MIX-NOT: foo3
+# MIX: _start@@VERSION_1.0
.globl foo1
foo1:
diff --git a/lld/test/ELF/version-script-symver2.s b/lld/test/ELF/version-script-symver2.s
index 34b2efb632dc..ad67461cfb40 100644
--- a/lld/test/ELF/version-script-symver2.s
+++ b/lld/test/ELF/version-script-symver2.s
@@ -10,13 +10,13 @@
# CHECK-NEXT: Name:
# CHECK-NEXT: }
# CHECK-NEXT: Symbol {
-# CHECK-NEXT: Version: 3
-# CHECK-NEXT: Name: foo@@VER2
-# CHECK-NEXT: }
-# CHECK-NEXT: Symbol {
# CHECK-NEXT: Version: 2
# CHECK-NEXT: Name: foo at VER1
# CHECK-NEXT: }
+# CHECK-NEXT: Symbol {
+# CHECK-NEXT: Version: 3
+# CHECK-NEXT: Name: foo@@VER2
+# CHECK-NEXT: }
# CHECK-NEXT: ]
.global bar
diff --git a/lld/test/ELF/version-script.s b/lld/test/ELF/version-script.s
index a812900184c0..7fd3b3733625 100644
--- a/lld/test/ELF/version-script.s
+++ b/lld/test/ELF/version-script.s
@@ -64,11 +64,11 @@
# RUN: ld.lld --hash-style=sysv --version-script %t2.script -shared %t.o %t2.so -o %t.so
# RUN: llvm-readelf --dyn-syms %t.so | FileCheck --check-prefix=ALL %s
-# ALL: _start{{$}}
+# ALL: foo1{{$}}
# ALL-NEXT: bar{{$}}
-# ALL-NEXT: foo1{{$}}
# ALL-NEXT: foo2{{$}}
# ALL-NEXT: foo3{{$}}
+# ALL-NEXT: _start{{$}}
# ALL-NOT: {{.}}
# RUN: echo "VERSION_1.0 { global: foo1; foo1; local: *; };" > %t8.script
diff --git a/lld/test/ELF/vs-diagnostics-duplicate.s b/lld/test/ELF/vs-diagnostics-duplicate.s
index 740c0778cf9c..cf4637fded9d 100644
--- a/lld/test/ELF/vs-diagnostics-duplicate.s
+++ b/lld/test/ELF/vs-diagnostics-duplicate.s
@@ -4,7 +4,12 @@
// RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %S/Inputs/vs-diagnostics-duplicate3.s -o %t3.o
// RUN: not ld.lld --vs-diagnostics %t1.o %t2.o %t3.o -o /dev/null 2>&1 | FileCheck %s
-// Case 1. Both symbols have full source location.
+// Case 1. The source locations are unknown for both symbols.
+// CHECK: {{.*}}ld.lld{{.*}}: error: duplicate symbol: foo
+// CHECK-NEXT: >>> defined at {{.*}}1.o:(.text+0x{{.+}})
+// CHECK-NEXT: >>> defined at {{.*}}2.o:(.text+0x{{.+}})
+
+// Case 2. Both symbols have full source location.
// CHECK: duplicate.s(15): error: duplicate symbol: bar
// CHECK-NEXT: >>> defined at duplicate.s:15
// CHECK-NEXT: >>>{{.*}}1.o:(.text+0x{{.+}})
@@ -12,11 +17,6 @@
// CHECK-NEXT: >>> defined at duplicate2.s:20
// CHECK-NEXT: >>>{{.*}}2.o:(.text+0x{{.+}})
-// Case 2. The source locations are unknown for both symbols.
-// CHECK: {{.*}}ld.lld{{.*}}: error: duplicate symbol: foo
-// CHECK-NEXT: >>> defined at {{.*}}1.o:(.text+0x{{.+}})
-// CHECK-NEXT: >>> defined at {{.*}}2.o:(.text+0x{{.+}})
-
// Case 3. For the second definition of `baz` we know only the source file found in a STT_FILE symbol.
// CHECK: duplicate.s(30): error: duplicate symbol: baz
// CHECK-NEXT: >>> defined at duplicate.s:30
diff --git a/lld/test/ELF/wrap-no-real.s b/lld/test/ELF/wrap-no-real.s
index 0078611a79be..4bcde9cf24d5 100644
--- a/lld/test/ELF/wrap-no-real.s
+++ b/lld/test/ELF/wrap-no-real.s
@@ -13,8 +13,8 @@
// CHECK-NEXT: movq {{.*}}(%rip), %rbx # 2021a8
// CHECK-NEXT: movq {{.*}}(%rip), %rcx # 2021b0
-// READELF: 0000000000011010 0 NOTYPE GLOBAL DEFAULT ABS __wrap_foo
// READELF: 0000000000011000 0 NOTYPE GLOBAL DEFAULT ABS foo
+// READELF: 0000000000011010 0 NOTYPE GLOBAL DEFAULT ABS __wrap_foo
// READELF: Hex dump of section '.got':
// READELF-NEXT: 0x[[#%x,ADDR:]] 10100100 00000000 00100100 00000000
diff --git a/lld/test/ELF/x86-64-gotpc-relax-und-dso.s b/lld/test/ELF/x86-64-gotpc-relax-und-dso.s
index fbcbca1d1b68..ac7088d9f0c1 100644
--- a/lld/test/ELF/x86-64-gotpc-relax-und-dso.s
+++ b/lld/test/ELF/x86-64-gotpc-relax-und-dso.s
@@ -8,9 +8,9 @@
# RELOC: Relocations [
# RELOC-NEXT: Section ({{.*}}) .rela.dyn {
-# RELOC-NEXT: R_X86_64_GLOB_DAT dsofoo 0x0
# RELOC-NEXT: R_X86_64_GLOB_DAT foo 0x0
# RELOC-NEXT: R_X86_64_GLOB_DAT und 0x0
+# RELOC-NEXT: R_X86_64_GLOB_DAT dsofoo 0x0
# RELOC-NEXT: }
# RELOC-NEXT: ]
diff --git a/lld/test/ELF/x86-64-tls-ie.s b/lld/test/ELF/x86-64-tls-ie.s
index 37345ed6dc5b..9dd701045008 100644
--- a/lld/test/ELF/x86-64-tls-ie.s
+++ b/lld/test/ELF/x86-64-tls-ie.s
@@ -25,8 +25,8 @@
// CHECK: Relocations [
// CHECK-NEXT: Section (5) .rela.dyn {
-// CHECK-NEXT: 0x2023C8 R_X86_64_TPOFF64 tls0 0x0
// CHECK-NEXT: [[ADDR]] R_X86_64_TPOFF64 tls1 0x0
+// CHECK-NEXT: 0x2023C8 R_X86_64_TPOFF64 tls0 0x0
// CHECK-NEXT: }
// CHECK-NEXT: ]
diff --git a/llvm/lib/MC/ELFObjectWriter.cpp b/llvm/lib/MC/ELFObjectWriter.cpp
index 9257e3bff631..f7d88377e86b 100644
--- a/llvm/lib/MC/ELFObjectWriter.cpp
+++ b/llvm/lib/MC/ELFObjectWriter.cpp
@@ -724,9 +724,6 @@ void ELFWriter::computeSymbolTable(
StrTabBuilder.finalize();
- // Symbols are required to be in lexicographic order.
- array_pod_sort(ExternalSymbolData.begin(), ExternalSymbolData.end());
-
// Make the first STT_FILE precede previous local symbols.
unsigned Index = 1;
auto FileNameIt = FileNames.begin();
diff --git a/llvm/test/CodeGen/AMDGPU/lds-relocs.ll b/llvm/test/CodeGen/AMDGPU/lds-relocs.ll
index 0f8772eb3d5f..1426f8013730 100644
--- a/llvm/test/CodeGen/AMDGPU/lds-relocs.ll
+++ b/llvm/test/CodeGen/AMDGPU/lds-relocs.ll
@@ -12,9 +12,9 @@
; ELF-NEXT: ]
; ELF: Symbol {
-; ELF: Name: lds.defined
-; ELF-NEXT: Value: 0x8
-; ELF-NEXT: Size: 32
+; ELF: Name: lds.external
+; ELF-NEXT: Value: 0x4
+; ELF-NEXT: Size: 0
; ELF-NEXT: Binding: Global (0x1)
; ELF-NEXT: Type: Object (0x1)
; ELF-NEXT: Other: 0
@@ -22,9 +22,9 @@
; ELF-NEXT: }
; ELF: Symbol {
-; ELF: Name: lds.external
-; ELF-NEXT: Value: 0x4
-; ELF-NEXT: Size: 0
+; ELF: Name: lds.defined
+; ELF-NEXT: Value: 0x8
+; ELF-NEXT: Size: 32
; ELF-NEXT: Binding: Global (0x1)
; ELF-NEXT: Type: Object (0x1)
; ELF-NEXT: Other: 0
diff --git a/llvm/test/LTO/Resolution/X86/not-prevailing-alias.ll b/llvm/test/LTO/Resolution/X86/not-prevailing-alias.ll
index 2aa13c8a44be..d08253446250 100644
--- a/llvm/test/LTO/Resolution/X86/not-prevailing-alias.ll
+++ b/llvm/test/LTO/Resolution/X86/not-prevailing-alias.ll
@@ -21,9 +21,9 @@
; Check that 'barAlias' and 'varAlias' produced as undefined.
; RUN: llvm-readelf --symbols %t2.o.1 | FileCheck %s --check-prefix=SYMBOLS
+; SYMBOLS: FUNC GLOBAL DEFAULT 2 zed
; SYMBOLS: NOTYPE GLOBAL DEFAULT UND barAlias
; SYMBOLS: NOTYPE GLOBAL DEFAULT UND varAlias
-; SYMBOLS: FUNC GLOBAL DEFAULT 2 zed
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
diff --git a/llvm/test/LTO/Resolution/X86/not-prevailing.ll b/llvm/test/LTO/Resolution/X86/not-prevailing.ll
index 174d3401a61d..6c9037f878b9 100644
--- a/llvm/test/LTO/Resolution/X86/not-prevailing.ll
+++ b/llvm/test/LTO/Resolution/X86/not-prevailing.ll
@@ -17,9 +17,9 @@
; RUN: llvm-readelf --symbols %t3.o.1 | FileCheck %s --check-prefix=SYMBOLS
; Check that 'foo' and 'bar' produced as undefined.
-; SYMBOLS: NOTYPE GLOBAL DEFAULT UND bar
-; SYMBOLS: NOTYPE GLOBAL DEFAULT UND foo
; SYMBOLS: FUNC GLOBAL DEFAULT 2 zed
+; SYMBOLS: NOTYPE GLOBAL DEFAULT UND foo
+; SYMBOLS: NOTYPE GLOBAL DEFAULT UND bar
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
diff --git a/llvm/test/MC/AArch64/size-directive.s b/llvm/test/MC/AArch64/size-directive.s
index 831ae62b6ee8..0b19cda4eaa1 100644
--- a/llvm/test/MC/AArch64/size-directive.s
+++ b/llvm/test/MC/AArch64/size-directive.s
@@ -34,7 +34,7 @@ aarch64_size:
// SYMS: Type Bind Vis Ndx Name
// SYMS: NOTYPE LOCAL DEFAULT 3 $d.0
// SYMS-NEXT: FUNC GLOBAL DEFAULT 3 aarch64_size
-// SYMS-NEXT: NOTYPE GLOBAL DEFAULT UND also_double_word
-// SYMS-NEXT: NOTYPE GLOBAL DEFAULT UND double_word
-// SYMS-NEXT: NOTYPE GLOBAL DEFAULT UND full_word
// SYMS-NEXT: NOTYPE GLOBAL DEFAULT UND half_word
+// SYMS-NEXT: NOTYPE GLOBAL DEFAULT UND full_word
+// SYMS-NEXT: NOTYPE GLOBAL DEFAULT UND double_word
+// SYMS-NEXT: NOTYPE GLOBAL DEFAULT UND also_double_word
diff --git a/llvm/test/MC/AMDGPU/elf-lds.s b/llvm/test/MC/AMDGPU/elf-lds.s
index 59bd03eda283..deb6ba0aad0c 100644
--- a/llvm/test/MC/AMDGPU/elf-lds.s
+++ b/llvm/test/MC/AMDGPU/elf-lds.s
@@ -50,9 +50,9 @@ test_kernel:
// CHECK-NEXT: }
// CHECK: Symbol {
-// CHECK: Name: lds1 (49)
-// CHECK-NEXT: Value: 0x8
-// CHECK-NEXT: Size: 387
+// CHECK: Name: lds4 (39)
+// CHECK-NEXT: Value: 0x4
+// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Global (0x1)
// CHECK-NEXT: Type: Object (0x1)
// CHECK-NEXT: Other: 0
@@ -60,23 +60,23 @@ test_kernel:
// CHECK-NEXT: }
// CHECK: Symbol {
-// CHECK: Name: lds2 (44)
-// CHECK-NEXT: Value: 0x4
-// CHECK-NEXT: Size: 12
+// CHECK: Name: lds1 (49)
+// CHECK-NEXT: Value: 0x8
+// CHECK-NEXT: Size: 387
// CHECK-NEXT: Binding: Global (0x1)
// CHECK-NEXT: Type: Object (0x1)
// CHECK-NEXT: Other: 0
// CHECK-NEXT: Section: Processor Specific (0xFF00)
// CHECK-NEXT: }
-// CHECK-NOT: Name: lds3
-
// CHECK: Symbol {
-// CHECK: Name: lds4 (39)
+// CHECK: Name: lds2 (44)
// CHECK-NEXT: Value: 0x4
-// CHECK-NEXT: Size: 0
+// CHECK-NEXT: Size: 12
// CHECK-NEXT: Binding: Global (0x1)
// CHECK-NEXT: Type: Object (0x1)
// CHECK-NEXT: Other: 0
// CHECK-NEXT: Section: Processor Specific (0xFF00)
// CHECK-NEXT: }
+
+// CHECK-NOT: Name: lds3
diff --git a/llvm/test/MC/ARM/arm-elf-symver.s b/llvm/test/MC/ARM/arm-elf-symver.s
index e49a7d7de7a7..206a039df41c 100644
--- a/llvm/test/MC/ARM/arm-elf-symver.s
+++ b/llvm/test/MC/ARM/arm-elf-symver.s
@@ -88,16 +88,16 @@ global1:
@ CHECK-NEXT: Section: .text
@ CHECK-NEXT: }
@ CHECK-NEXT: Symbol {
-@ CHECK-NEXT: Name: bar2 at zed
-@ CHECK-NEXT: Value: 0x0
+@ CHECK-NEXT: Name: global1
+@ CHECK-NEXT: Value: 0x14
@ CHECK-NEXT: Size: 0
@ CHECK-NEXT: Binding: Global (0x1)
@ CHECK-NEXT: Type: None (0x0)
@ CHECK-NEXT: Other: 0
-@ CHECK-NEXT: Section: Undefined (0x0)
+@ CHECK-NEXT: Section: .text
@ CHECK-NEXT: }
@ CHECK-NEXT: Symbol {
-@ CHECK-NEXT: Name: bar6 at zed
+@ CHECK-NEXT: Name: bar2 at zed
@ CHECK-NEXT: Value: 0x0
@ CHECK-NEXT: Size: 0
@ CHECK-NEXT: Binding: Global (0x1)
@@ -106,16 +106,16 @@ global1:
@ CHECK-NEXT: Section: Undefined (0x0)
@ CHECK-NEXT: }
@ CHECK-NEXT: Symbol {
-@ CHECK-NEXT: Name: g1@@zed
-@ CHECK-NEXT: Value: 0x14
+@ CHECK-NEXT: Name: bar6 at zed
+@ CHECK-NEXT: Value: 0x0
@ CHECK-NEXT: Size: 0
@ CHECK-NEXT: Binding: Global (0x1)
@ CHECK-NEXT: Type: None (0x0)
@ CHECK-NEXT: Other: 0
-@ CHECK-NEXT: Section: .text
+@ CHECK-NEXT: Section: Undefined (0x0)
@ CHECK-NEXT: }
@ CHECK-NEXT: Symbol {
-@ CHECK-NEXT: Name: global1
+@ CHECK-NEXT: Name: g1@@zed
@ CHECK-NEXT: Value: 0x14
@ CHECK-NEXT: Size: 0
@ CHECK-NEXT: Binding: Global (0x1)
diff --git a/llvm/test/MC/ARM/elf-thumbfunc.s b/llvm/test/MC/ARM/elf-thumbfunc.s
index f12b5cb4503c..30362e785836 100644
--- a/llvm/test/MC/ARM/elf-thumbfunc.s
+++ b/llvm/test/MC/ARM/elf-thumbfunc.s
@@ -19,22 +19,22 @@ baz = foo + 2
@@ make sure foo and bar are thumb function: bit 0 = 1 (st_value)
@CHECK: Symbol {
- at CHECK: Name: bar
+ at CHECK: Name: foo
@CHECK-NEXT: Value: 0x1
@CHECK-NEXT: Size: 0
@CHECK-NEXT: Binding: Global
@CHECK-NEXT: Type: Function
@CHECK: Symbol {
- at CHECK: Name: baz
- at CHECK-NEXT: Value: 0x3
+ at CHECK: Name: bar
+ at CHECK-NEXT: Value: 0x1
@CHECK-NEXT: Size: 0
@CHECK-NEXT: Binding: Global
@CHECK-NEXT: Type: Function
@CHECK: Symbol {
- at CHECK: Name: foo
- at CHECK-NEXT: Value: 0x1
+ at CHECK: Name: baz
+ at CHECK-NEXT: Value: 0x3
@CHECK-NEXT: Size: 0
@CHECK-NEXT: Binding: Global
@CHECK-NEXT: Type: Function
diff --git a/llvm/test/MC/ELF/ARM/clang-section.s b/llvm/test/MC/ELF/ARM/clang-section.s
index d79aa225d71e..3f2fa604ffc5 100644
--- a/llvm/test/MC/ELF/ARM/clang-section.s
+++ b/llvm/test/MC/ELF/ARM/clang-section.s
@@ -326,14 +326,26 @@ p:
//CHECK: Section: my_bss.2 (0x12)
//CHECK: }
//CHECK: Symbol {
-//CHECK: Name: a
-//CHECK: Section: my_bss.1 (0xE)
+//CHECK: Name: foo
+//CHECK: Section: my_text.1 (0x4)
//CHECK: }
//CHECK: Symbol {
//CHECK: Name: b
//CHECK: Section: my_data.1 (0xF)
//CHECK: }
//CHECK: Symbol {
+//CHECK: Name: goo
+//CHECK: Section: my_text.2 (0x8)
+//CHECK: }
+//CHECK: Symbol {
+//CHECK: Name: hoo
+//CHECK: Section: .text (0x2)
+//CHECK: }
+//CHECK: Symbol {
+//CHECK: Name: a
+//CHECK: Section: my_bss.1 (0xE)
+//CHECK: }
+//CHECK: Symbol {
//CHECK: Name: c
//CHECK: Section: my_bss.1 (0xE)
//CHECK: }
@@ -350,22 +362,10 @@ p:
//CHECK: Section: my_rodata.1 (0x10)
//CHECK: }
//CHECK: Symbol {
-//CHECK: Name: foo
-//CHECK: Section: my_text.1 (0x4)
-//CHECK: }
-//CHECK: Symbol {
-//CHECK: Name: goo
-//CHECK: Section: my_text.2 (0x8)
-//CHECK: }
-//CHECK: Symbol {
//CHECK: Name: h
//CHECK: Section: .bss (0x11)
//CHECK: }
//CHECK: Symbol {
-//CHECK: Name: hoo
-//CHECK: Section: .text (0x2)
-//CHECK: }
-//CHECK: Symbol {
//CHECK: Name: i
//CHECK: Section: my_bss.2 (0x12)
//CHECK: }
diff --git a/llvm/test/MC/ELF/cgprofile.s b/llvm/test/MC/ELF/cgprofile.s
index bf31d002e4fa..7938c2db8ebb 100644
--- a/llvm/test/MC/ELF/cgprofile.s
+++ b/llvm/test/MC/ELF/cgprofile.s
@@ -28,8 +28,8 @@ late3:
# CHECK-NEXT: EntrySize: 16
# CHECK-NEXT: SectionData (
# CHECK-NEXT: 0000: 02000000 05000000 20000000 00000000
-# CHECK-NEXT: 0010: 06000000 02000000 0B000000 00000000
-# CHECK-NEXT: 0020: 07000000 03000000 14000000 00000000
+# CHECK-NEXT: 0010: 07000000 02000000 0B000000 00000000
+# CHECK-NEXT: 0020: 06000000 03000000 14000000 00000000
# CHECK-NEXT: 0030: 01000000 05000000 2A000000 00000000
# CHECK-NEXT: )
@@ -62,20 +62,20 @@ late3:
# CHECK-NEXT: Type:
# CHECK-NEXT: Other:
# CHECK-NEXT: Section: Undefined
-# CHECK: Name: freq
+# CHECK: Name: late
# CHECK-NEXT: Value:
# CHECK-NEXT: Size:
-# CHECK-NEXT: Binding: Weak
+# CHECK-NEXT: Binding: Global
# CHECK-NEXT: Type:
# CHECK-NEXT: Other:
-# CHECK-NEXT: Section: Undefined
-# CHECK: Name: late
+# CHECK-NEXT: Section: .test
+# CHECK: Name: freq
# CHECK-NEXT: Value:
# CHECK-NEXT: Size:
-# CHECK-NEXT: Binding: Global
+# CHECK-NEXT: Binding: Weak
# CHECK-NEXT: Type:
# CHECK-NEXT: Other:
-# CHECK-NEXT: Section: .test
+# CHECK-NEXT: Section: Undefined
# CHECK: CGProfile [
# CHECK-NEXT: CGProfileEntry {
# CHECK-NEXT: From: a
diff --git a/llvm/test/MC/ELF/file.s b/llvm/test/MC/ELF/file.s
index e750762c9970..4c96e8834d6d 100644
--- a/llvm/test/MC/ELF/file.s
+++ b/llvm/test/MC/ELF/file.s
@@ -11,8 +11,8 @@
# CHECK-NEXT: 8: 0000000000000000 0 SECTION LOCAL DEFAULT 8 bar1
# CHECK-NEXT: 9: 0000000000000000 0 NOTYPE LOCAL DEFAULT 8 local2
# CHECK-NEXT: 10: 0000000000000000 0 FILE LOCAL DEFAULT ABS bar.c
-# CHECK-NEXT: 11: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 6 bar.c
-# CHECK-NEXT: 12: 0000000000000008 0 NOTYPE GLOBAL DEFAULT 2 foo.c
+# CHECK-NEXT: 11: 0000000000000008 0 NOTYPE GLOBAL DEFAULT 2 foo.c
+# CHECK-NEXT: 12: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 6 bar.c
.quad .text
diff --git a/llvm/test/MC/ELF/pr9292.s b/llvm/test/MC/ELF/pr9292.s
index 9c346fbe94cb..f35776c54d96 100644
--- a/llvm/test/MC/ELF/pr9292.s
+++ b/llvm/test/MC/ELF/pr9292.s
@@ -8,7 +8,7 @@ mov %eax,bar
// CHECK: Symbol {
-// CHECK: Name: bar
+// CHECK: Name: foo
// CHECK-NEXT: Value: 0x0
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Global
@@ -17,7 +17,7 @@ mov %eax,bar
// CHECK-NEXT: Section: Undefined (0x0)
// CHECK-NEXT: }
// CHECK-NEXT: Symbol {
-// CHECK-NEXT: Name: foo
+// CHECK-NEXT: Name: bar
// CHECK-NEXT: Value: 0x0
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Global
diff --git a/llvm/test/MC/ELF/relocation-alias.s b/llvm/test/MC/ELF/relocation-alias.s
index d8392a9a4100..f6dc97e64ecb 100644
--- a/llvm/test/MC/ELF/relocation-alias.s
+++ b/llvm/test/MC/ELF/relocation-alias.s
@@ -50,6 +50,6 @@ call memcpy_plus_1 at PLT
# SYM-NEXT: NOTYPE LOCAL DEFAULT 4 data_alias_l
# SYM-NEXT: SECTION LOCAL DEFAULT 4 .data
# SYM-NEXT: NOTYPE GLOBAL DEFAULT UND __GI_memcpy
-# SYM-NEXT: NOTYPE GLOBAL DEFAULT 4 data
# SYM-NEXT: NOTYPE GLOBAL DEFAULT 4 data_alias
+# SYM-NEXT: NOTYPE GLOBAL DEFAULT 4 data
# SYM-NOT: {{.}}
diff --git a/llvm/test/MC/ELF/strtab-suffix-opt.s b/llvm/test/MC/ELF/strtab-suffix-opt.s
index 36fdd66489f1..8115fc14f8d8 100644
--- a/llvm/test/MC/ELF/strtab-suffix-opt.s
+++ b/llvm/test/MC/ELF/strtab-suffix-opt.s
@@ -16,6 +16,6 @@ foobar:
.Ltmp3:
.size foobar, .Ltmp3-foobar
-// CHECK: Name: bar (14)
-// CHECK: Name: foo (18)
// CHECK: Name: foobar (11)
+// CHECK: Name: foo (18)
+// CHECK: Name: bar (14)
diff --git a/llvm/test/MC/ELF/symver-visibility.s b/llvm/test/MC/ELF/symver-visibility.s
index 92d1da9cdef1..3de092d88a88 100644
--- a/llvm/test/MC/ELF/symver-visibility.s
+++ b/llvm/test/MC/ELF/symver-visibility.s
@@ -1,8 +1,8 @@
# RUN: llvm-mc -filetype=obj -triple=x86_64 %s -o %t
# RUN: llvm-readelf -s %t | FileCheck %s
-# CHECK: NOTYPE GLOBAL HIDDEN {{[1-9]}} def@@v1
-# CHECK-NEXT: NOTYPE GLOBAL PROTECTED UND undef at v1
+# CHECK: NOTYPE GLOBAL PROTECTED UND undef at v1
+# CHECK-NEXT: NOTYPE GLOBAL HIDDEN {{[1-9]}} def@@v1
.protected undef
.symver undef, undef@@@v1
diff --git a/llvm/test/MC/ELF/symver.s b/llvm/test/MC/ELF/symver.s
index fa0724adf6e7..e039259268e2 100644
--- a/llvm/test/MC/ELF/symver.s
+++ b/llvm/test/MC/ELF/symver.s
@@ -42,7 +42,7 @@ global1:
# SYM-NEXT: 4: 0000000000000000 0 NOTYPE LOCAL DEFAULT 2 bar1 at zed
# SYM-NEXT: 5: 0000000000000000 0 NOTYPE LOCAL DEFAULT 2 bar3@@zed
# SYM-NEXT: 6: 0000000000000000 0 NOTYPE LOCAL DEFAULT 2 bar5@@zed
-# SYM-NEXT: 7: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND bar2 at zed
-# SYM-NEXT: 8: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND bar6 at zed
-# SYM-NEXT: 9: 0000000000000014 0 NOTYPE GLOBAL DEFAULT 2 g1@@zed
-# SYM-NEXT: 10: 0000000000000014 0 NOTYPE GLOBAL DEFAULT 2 global1
+# SYM-NEXT: 7: 0000000000000014 0 NOTYPE GLOBAL DEFAULT 2 global1
+# SYM-NEXT: 8: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND bar2 at zed
+# SYM-NEXT: 9: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND bar6 at zed
+# SYM-NEXT: 10: 0000000000000014 0 NOTYPE GLOBAL DEFAULT 2 g1@@zed
diff --git a/llvm/test/MC/ELF/type.s b/llvm/test/MC/ELF/type.s
index 27e95f13f375..972a881150f6 100644
--- a/llvm/test/MC/ELF/type.s
+++ b/llvm/test/MC/ELF/type.s
@@ -2,40 +2,40 @@
# CHECK: Symbol table '.symtab' contains 34 entries:
# CHECK-NEXT: Num: Value Size Type Bind Vis Ndx Name
-# CHECK-NEXT: 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
-# CHECK-NEXT: 1: 0000000000000000 0 FUNC GLOBAL DEFAULT 2 alias1
-# CHECK-NEXT: 2: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 2 alias10
-# CHECK-NEXT: 3: 0000000000000000 0 IFUNC GLOBAL DEFAULT 2 alias11
-# CHECK-NEXT: 4: 0000000000000000 0 FUNC GLOBAL DEFAULT 2 alias12
-# CHECK-NEXT: 5: 0000000000000000 0 OBJECT GLOBAL DEFAULT 2 alias2
-# CHECK-NEXT: 6: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 2 alias3
-# CHECK-NEXT: 7: 0000000000000000 0 OBJECT GLOBAL DEFAULT 2 alias4
-# CHECK-NEXT: 8: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 2 alias5
-# CHECK-NEXT: 9: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 2 alias6
-# CHECK-NEXT: 10: 0000000000000000 0 TLS GLOBAL DEFAULT 2 alias7
-# CHECK-NEXT: 11: 0000000000000000 0 TLS GLOBAL DEFAULT 2 alias8
-# CHECK-NEXT: 12: 0000000000000000 0 OBJECT GLOBAL DEFAULT 2 alias9
-# CHECK-NEXT: 13: 0000000000000000 0 OBJECT GLOBAL DEFAULT 2 bar
-# CHECK-NEXT: 14: 0000000000000000 0 FUNC GLOBAL DEFAULT 2 foo
-# CHECK-NEXT: 15: 0000000000000000 0 FUNC GLOBAL DEFAULT 2 func
-# CHECK-NEXT: 16: 0000000000000000 0 IFUNC GLOBAL DEFAULT 2 ifunc
-# CHECK-NEXT: 17: 0000000000000000 0 OBJECT GLOBAL DEFAULT 2 obj
-# CHECK-NEXT: 18: 0000000000000000 0 IFUNC GLOBAL DEFAULT 2 sym1
-# CHECK-NEXT: 19: 0000000000000000 0 TLS GLOBAL DEFAULT 2 sym10
-# CHECK-NEXT: 20: 0000000000000000 0 TLS GLOBAL DEFAULT 2 sym11
-# CHECK-NEXT: 21: 0000000000000000 0 TLS GLOBAL DEFAULT 2 sym12
-# CHECK-NEXT: 22: 0000000000000000 0 IFUNC GLOBAL DEFAULT 2 sym2
-# CHECK-NEXT: 23: 0000000000000000 0 IFUNC GLOBAL DEFAULT 2 sym3
-# CHECK-NEXT: 24: 0000000000000000 0 FUNC GLOBAL DEFAULT 2 sym4
-# CHECK-NEXT: 25: 0000000000000000 0 FUNC GLOBAL DEFAULT 2 sym5
-# CHECK-NEXT: 26: 0000000000000000 0 OBJECT GLOBAL DEFAULT 2 sym6
-# CHECK-NEXT: 27: 0000000000000000 0 IFUNC GLOBAL DEFAULT 2 sym7
-# CHECK-NEXT: 28: 0000000000000000 0 FUNC GLOBAL DEFAULT 2 sym8
-# CHECK-NEXT: 29: 0000000000000000 0 TLS GLOBAL DEFAULT 2 sym9
-# CHECK-NEXT: 30: 0000000000000000 0 TLS GLOBAL DEFAULT 2 tls
-# CHECK-NEXT: 31: 0000000000000000 0 TLS GLOBAL DEFAULT 2 tls_quoted
-# CHECK-NEXT: 32: 0000000000000000 0 TLS GLOBAL DEFAULT 2 tls_upper_case
-# CHECK-NEXT: 33: 0000000000000000 0 OBJECT UNIQUE DEFAULT 2 zed
+# CHECK-NEXT: 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
+# CHECK-NEXT: 1: 0000000000000000 0 FUNC GLOBAL DEFAULT 2 foo
+# CHECK-NEXT: 2: 0000000000000000 0 OBJECT GLOBAL DEFAULT 2 bar
+# CHECK-NEXT: 3: 0000000000000000 0 OBJECT UNIQUE DEFAULT 2 zed
+# CHECK-NEXT: 4: 0000000000000000 0 OBJECT GLOBAL DEFAULT 2 obj
+# CHECK-NEXT: 5: 0000000000000000 0 FUNC GLOBAL DEFAULT 2 func
+# CHECK-NEXT: 6: 0000000000000000 0 IFUNC GLOBAL DEFAULT 2 ifunc
+# CHECK-NEXT: 7: 0000000000000000 0 TLS GLOBAL DEFAULT 2 tls
+# CHECK-NEXT: 8: 0000000000000000 0 TLS GLOBAL DEFAULT 2 tls_quoted
+# CHECK-NEXT: 9: 0000000000000000 0 TLS GLOBAL DEFAULT 2 tls_upper_case
+# CHECK-NEXT: 10: 0000000000000000 0 IFUNC GLOBAL DEFAULT 2 sym1
+# CHECK-NEXT: 11: 0000000000000000 0 FUNC GLOBAL DEFAULT 2 alias1
+# CHECK-NEXT: 12: 0000000000000000 0 IFUNC GLOBAL DEFAULT 2 sym2
+# CHECK-NEXT: 13: 0000000000000000 0 OBJECT GLOBAL DEFAULT 2 alias2
+# CHECK-NEXT: 14: 0000000000000000 0 IFUNC GLOBAL DEFAULT 2 sym3
+# CHECK-NEXT: 15: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 2 alias3
+# CHECK-NEXT: 16: 0000000000000000 0 FUNC GLOBAL DEFAULT 2 sym4
+# CHECK-NEXT: 17: 0000000000000000 0 OBJECT GLOBAL DEFAULT 2 alias4
+# CHECK-NEXT: 18: 0000000000000000 0 FUNC GLOBAL DEFAULT 2 sym5
+# CHECK-NEXT: 19: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 2 alias5
+# CHECK-NEXT: 20: 0000000000000000 0 OBJECT GLOBAL DEFAULT 2 sym6
+# CHECK-NEXT: 21: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 2 alias6
+# CHECK-NEXT: 22: 0000000000000000 0 IFUNC GLOBAL DEFAULT 2 sym7
+# CHECK-NEXT: 23: 0000000000000000 0 TLS GLOBAL DEFAULT 2 alias7
+# CHECK-NEXT: 24: 0000000000000000 0 FUNC GLOBAL DEFAULT 2 sym8
+# CHECK-NEXT: 25: 0000000000000000 0 TLS GLOBAL DEFAULT 2 alias8
+# CHECK-NEXT: 26: 0000000000000000 0 TLS GLOBAL DEFAULT 2 sym9
+# CHECK-NEXT: 27: 0000000000000000 0 OBJECT GLOBAL DEFAULT 2 alias9
+# CHECK-NEXT: 28: 0000000000000000 0 TLS GLOBAL DEFAULT 2 sym10
+# CHECK-NEXT: 29: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 2 alias10
+# CHECK-NEXT: 30: 0000000000000000 0 TLS GLOBAL DEFAULT 2 sym11
+# CHECK-NEXT: 31: 0000000000000000 0 IFUNC GLOBAL DEFAULT 2 alias11
+# CHECK-NEXT: 32: 0000000000000000 0 TLS GLOBAL DEFAULT 2 sym12
+# CHECK-NEXT: 33: 0000000000000000 0 FUNC GLOBAL DEFAULT 2 alias12
// Test that both % and @ are accepted.
.global foo
diff --git a/llvm/test/MC/ELF/undef.s b/llvm/test/MC/ELF/undef.s
index 29adb940a4fc..ab75230940b1 100644
--- a/llvm/test/MC/ELF/undef.s
+++ b/llvm/test/MC/ELF/undef.s
@@ -6,8 +6,8 @@
# CHECK-NEXT: Num: Value Size Type Bind Vis Ndx Name
# CHECK-NEXT: 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
# CHECK-NEXT: 1: 0000000000000000 0 NOTYPE LOCAL DEFAULT 4 .Lsym8
-# CHECK-NEXT: 2: 0000000000000000 0 NOTYPE GLOBAL HIDDEN UND hidden
-# CHECK-NEXT: 3: 0000000000000000 0 OBJECT GLOBAL DEFAULT UND sym6
+# CHECK-NEXT: 2: 0000000000000000 0 OBJECT GLOBAL DEFAULT UND sym6
+# CHECK-NEXT: 3: 0000000000000000 0 NOTYPE GLOBAL HIDDEN UND hidden
# CHECK-NEXT: 4: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND undef
.Lsym2:
diff --git a/llvm/test/MC/ELF/weak.s b/llvm/test/MC/ELF/weak.s
index d78f5db0f10c..d7750545cae3 100644
--- a/llvm/test/MC/ELF/weak.s
+++ b/llvm/test/MC/ELF/weak.s
@@ -10,21 +10,21 @@
bar:
// CHECK: Symbol {
-// CHECK: Name: bar
-// CHECK-NEXT: Value: 0x4
+// CHECK: Name: foo
+// CHECK-NEXT: Value: 0x0
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Weak
// CHECK-NEXT: Type: None
// CHECK-NEXT: Other: 0
-// CHECK-NEXT: Section: .text
+// CHECK-NEXT: Section: Undefined (0x0)
// CHECK-NEXT: }
-// CHECK: Symbol {
-// CHECK: Name: foo
-// CHECK-NEXT: Value: 0x0
+// CHECK-NEXT: Symbol {
+// CHECK-NEXT: Name: bar
+// CHECK-NEXT: Value: 0x4
// CHECK-NEXT: Size: 0
// CHECK-NEXT: Binding: Weak
// CHECK-NEXT: Type: None
// CHECK-NEXT: Other: 0
-// CHECK-NEXT: Section: Undefined (0x0)
+// CHECK-NEXT: Section: .text
// CHECK-NEXT: }
// CHECK-NEXT: ]
diff --git a/llvm/test/MC/ELF/weakref.s b/llvm/test/MC/ELF/weakref.s
index 1f250ef09b4e..d23d0fd715df 100644
--- a/llvm/test/MC/ELF/weakref.s
+++ b/llvm/test/MC/ELF/weakref.s
@@ -13,17 +13,16 @@
# CHECK-NEXT: 4: 000000000000001c 0 NOTYPE LOCAL DEFAULT 2 bar8
# CHECK-NEXT: 5: 0000000000000020 0 NOTYPE LOCAL DEFAULT 2 bar9
# CHECK-NEXT: 6: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND bar1
-# CHECK-NEXT: 7: 0000000000000028 0 NOTYPE GLOBAL DEFAULT 2 bar10
-# CHECK-NEXT: 8: 0000000000000030 0 NOTYPE GLOBAL DEFAULT 2 bar11
-# CHECK-NEXT: 9: 0000000000000030 0 NOTYPE GLOBAL DEFAULT 2 bar12
-# CHECK-NEXT: 10: 0000000000000034 0 NOTYPE GLOBAL DEFAULT 2 bar13
-# CHECK-NEXT: 11: 0000000000000038 0 NOTYPE GLOBAL DEFAULT 2 bar14
-# CHECK-NEXT: 12: 0000000000000040 0 NOTYPE GLOBAL DEFAULT 2 bar15
-# CHECK-NEXT: 13: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND bar2
-# CHECK-NEXT: 14: 0000000000000000 0 NOTYPE WEAK DEFAULT UND bar3
-# CHECK-NEXT: 15: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND bar4
-# CHECK-NEXT: 16: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND bar5
-
+# CHECK-NEXT: 7: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND bar2
+# CHECK-NEXT: 8: 0000000000000000 0 NOTYPE WEAK DEFAULT UND bar3
+# CHECK-NEXT: 9: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND bar4
+# CHECK-NEXT: 10: 0000000000000000 0 NOTYPE GLOBAL DEFAULT UND bar5
+# CHECK-NEXT: 11: 0000000000000028 0 NOTYPE GLOBAL DEFAULT 2 bar10
+# CHECK-NEXT: 12: 0000000000000030 0 NOTYPE GLOBAL DEFAULT 2 bar11
+# CHECK-NEXT: 13: 0000000000000030 0 NOTYPE GLOBAL DEFAULT 2 bar12
+# CHECK-NEXT: 14: 0000000000000034 0 NOTYPE GLOBAL DEFAULT 2 bar13
+# CHECK-NEXT: 15: 0000000000000038 0 NOTYPE GLOBAL DEFAULT 2 bar14
+# CHECK-NEXT: 16: 0000000000000040 0 NOTYPE GLOBAL DEFAULT 2 bar15
.weakref foo1, bar1
diff --git a/llvm/test/MC/Mips/elf_st_other.s b/llvm/test/MC/Mips/elf_st_other.s
index 6be849343b82..b9e19da073c5 100644
--- a/llvm/test/MC/Mips/elf_st_other.s
+++ b/llvm/test/MC/Mips/elf_st_other.s
@@ -18,9 +18,9 @@ d1:
f2:
nop
-// CHECK-LABEL: Name: d1
-// CHECK: Other: 0
// CHECK-LABEL: Name: f1
// CHECK: Other [ (0x80)
+// CHECK-LABEL: Name: d1
+// CHECK: Other: 0
// CHECK-LABEL: Name: f2
// CHECK: Other: 0
diff --git a/llvm/test/MC/Mips/insn-directive.s b/llvm/test/MC/Mips/insn-directive.s
index b08fb02d52e8..05e37ffb67cc 100644
--- a/llvm/test/MC/Mips/insn-directive.s
+++ b/llvm/test/MC/Mips/insn-directive.s
@@ -78,18 +78,18 @@ bar:
# OBJ: Name: f_mm_insn_instr
# OBJ: Other [ (0x80)
-# OBJ: Name: f_normal_insn_data
-# OBJ: Other: 0
-
-# OBJ: Name: f_normal_insn_instr
-# OBJ: Other: 0
-
# OBJ: Name: o_mm_insn_data
# OBJ: Other [ (0x80)
# OBJ: Name: o_mm_insn_instr
# OBJ: Other [ (0x80)
+# OBJ: Name: f_normal_insn_data
+# OBJ: Other: 0
+
+# OBJ: Name: f_normal_insn_instr
+# OBJ: Other: 0
+
# OBJ: Name: o_normal_insn_data
# OBJ: Other: 0
diff --git a/llvm/test/MC/PowerPC/ppc64-localentry-symbols.s b/llvm/test/MC/PowerPC/ppc64-localentry-symbols.s
index 4bfc05d3ca74..2d78f60462eb 100644
--- a/llvm/test/MC/PowerPC/ppc64-localentry-symbols.s
+++ b/llvm/test/MC/PowerPC/ppc64-localentry-symbols.s
@@ -3,9 +3,10 @@
# CHECK: Type Bind Vis Ndx Name
# CHECK: FUNC GLOBAL DEFAULT [<other: 0x60>] 2 foo
-# CHECK-NEXT: FUNC WEAK DEFAULT [<other: 0x60>] 2 foo at FBSD_1.1
+# CHECK-NEXT: FUNC WEAK DEFAULT [<other: 0x60>] 2 __impl_foo
# CHECK-NEXT: FUNC GLOBAL DEFAULT [<other: 0x60>] 2 func
# CHECK-NEXT: FUNC WEAK DEFAULT [<other: 0x60>] 2 weak_func
+# CHECK: FUNC WEAK DEFAULT [<other: 0x60>] 2 foo at FBSD_1.1
.text
.abiversion 2
More information about the llvm-commits
mailing list