[lld] [test] Migrate Arm thunk tests to the default thunk order (PR #212694)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 28 23:54:29 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lld
Author: Fangrui Song (MaskRay)
<details>
<summary>Changes</summary>
Drop -z nosort-thunks (added by #<!-- -->211721 to keep creation order) and
update expectations to the default order: forward thunks sorted by
descending destination. Backward-only thunk sections keep creation
order and are unchanged.
In arm-thunk-re-add.s, retarget beq.w to imported2: sorting places
imported's pool thunk just within conditional-branch range, so
beq.w imported would reuse it instead of re-adding a thunk.
---
Patch is 57.29 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/212694.diff
15 Files Affected:
- (modified) lld/test/ELF/arm-bl-v4t.s (+50-50)
- (modified) lld/test/ELF/arm-branch-rangethunk.s (+16-18)
- (modified) lld/test/ELF/arm-force-pi-thunk.s (+9-9)
- (modified) lld/test/ELF/arm-thumb-condbranch-thunk.s (+13-13)
- (modified) lld/test/ELF/arm-thumb-interwork-shared.s (+7-7)
- (modified) lld/test/ELF/arm-thumb-interwork-thunk.s (+37-37)
- (modified) lld/test/ELF/arm-thumb-mix-range-thunk-os.s (+12-12)
- (modified) lld/test/ELF/arm-thumb-plt-range-thunk-os.s (+8-8)
- (modified) lld/test/ELF/arm-thumb-range-thunk-os-no-ext.s (+11-11)
- (modified) lld/test/ELF/arm-thumb-range-thunk-os.s (+19-19)
- (modified) lld/test/ELF/arm-thunk-arm-thumb-reuse.s (+11-11)
- (modified) lld/test/ELF/arm-thunk-linkerscript-dotexpr.s (+11-11)
- (modified) lld/test/ELF/arm-thunk-linkerscript-orphan.s (+7-7)
- (modified) lld/test/ELF/arm-thunk-linkerscript.s (+11-11)
- (modified) lld/test/ELF/arm-thunk-re-add.s (+13-13)
``````````diff
diff --git a/lld/test/ELF/arm-bl-v4t.s b/lld/test/ELF/arm-bl-v4t.s
index 31bfe010108b2..4e9d273e77570 100644
--- a/lld/test/ELF/arm-bl-v4t.s
+++ b/lld/test/ELF/arm-bl-v4t.s
@@ -1,23 +1,23 @@
// REQUIRES: arm
// RUN: rm -rf %t && split-file %s %t
// RUN: llvm-mc -arm-add-build-attributes -filetype=obj -triple=armv4t-none-linux-gnueabi %t/a.s -o %t/a.o
-// RUN: ld.lld -z nosort-thunks %t/a.o --script %t/far.lds -o %t/a-far
+// RUN: ld.lld %t/a.o --script %t/far.lds -o %t/a-far
// RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn --triple=armv4t-none-linux-gnueabi %t/a-far | FileCheck %s --check-prefixes=FAR
-// RUN: ld.lld -z nosort-thunks %t/a.o --script %t/near.lds -o %t/a-near
+// RUN: ld.lld %t/a.o --script %t/near.lds -o %t/a-near
// RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn --triple=armv4t-none-linux-gnueabi %t/a-near | FileCheck %s --check-prefixes=NEAR
-// RUN: ld.lld -z nosort-thunks %t/a.o -pie --script %t/far.lds -o %t/a-far-pie
+// RUN: ld.lld %t/a.o -pie --script %t/far.lds -o %t/a-far-pie
// RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn --triple=armv4t-none-linux-gnueabi %t/a-far-pie | FileCheck %s --check-prefixes=FAR-PIE
-// RUN: ld.lld -z nosort-thunks %t/a.o -pie --script %t/near.lds -o %t/a-near-pie
+// RUN: ld.lld %t/a.o -pie --script %t/near.lds -o %t/a-near-pie
// RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn --triple=armv4t-none-linux-gnueabi %t/a-near-pie | FileCheck %s --check-prefixes=NEAR
// RUN: llvm-mc -arm-add-build-attributes -filetype=obj -triple=armv4teb-none-linux-gnueabi %t/a.s -o %t/a.o
-// RUN: ld.lld -z nosort-thunks %t/a.o --script %t/far.lds -o %t/a-far
+// RUN: ld.lld %t/a.o --script %t/far.lds -o %t/a-far
// RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn --triple=armv4teb-none-linux-gnueabi %t/a-far | FileCheck %s --check-prefixes=FAR-EB
-// RUN: ld.lld -z nosort-thunks %t/a.o --script %t/near.lds -o %t/a-near
+// RUN: ld.lld %t/a.o --script %t/near.lds -o %t/a-near
// RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn --triple=armv4teb-none-linux-gnueabi %t/a-near | FileCheck %s --check-prefixes=NEAR
-// RUN: ld.lld -z nosort-thunks %t/a.o -pie --script %t/far.lds -o %t/a-far-pie
+// RUN: ld.lld %t/a.o -pie --script %t/far.lds -o %t/a-far-pie
// RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn --triple=armv4teb-none-linux-gnueabi %t/a-far-pie | FileCheck %s --check-prefixes=FAR-EB-PIE
-// RUN: ld.lld -z nosort-thunks %t/a.o -pie --script %t/near.lds -o %t/a-near-pie
+// RUN: ld.lld %t/a.o -pie --script %t/near.lds -o %t/a-near-pie
// RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn --triple=armv4teb-none-linux-gnueabi %t/a-near-pie | FileCheck %s --check-prefixes=NEAR
/// On Armv4T there is no blx instruction so long branch/exchange looks slightly
@@ -46,88 +46,88 @@ thumb_start:
bx lr
// FAR-LABEL: <_start>:
-// FAR-NEXT: 1000000: bl 0x1000010 <__ARMv5LongLdrPcThunk_target> @ imm = #8
+// FAR-NEXT: 1000000: bl 0x1000020 <__ARMv5LongLdrPcThunk_target> @ imm = #24
// FAR-NEXT: bx lr
// FAR-EMPTY:
// FAR-LABEL: <thumb_start>:
-// FAR-NEXT: 1000008: bl 0x1000018 <__Thumbv4ABSLongThunk_thumb_target> @ imm = #12
+// FAR-NEXT: 1000008: bl 0x1000010 <__Thumbv4ABSLongThunk_thumb_target> @ imm = #4
// FAR-NEXT: bx lr
// FAR-NEXT: bmi 0xffffba @ imm = #-88
// FAR-EMPTY:
-// FAR-NEXT: <__ARMv5LongLdrPcThunk_target>:
-// FAR-NEXT: 1000010: ldr pc, [pc, #-4] @ 0x1000014 <__ARMv5LongLdrPcThunk_target+0x4>
-// FAR-NEXT: 1000014: 00 00 00 06 .word 0x06000000
-// FAR-EMPTY:
// FAR-NEXT: <__Thumbv4ABSLongThunk_thumb_target>:
-// FAR-NEXT: 1000018: bx pc
-// FAR-NEXT: b 0x1000018 <__Thumbv4ABSLongThunk_thumb_target> @ imm = #-6
-// FAR-NEXT: 100001c: ldr r12, [pc] @ 0x1000024 <__Thumbv4ABSLongThunk_thumb_target+0xc>
+// FAR-NEXT: 1000010: bx pc
+// FAR-NEXT: b 0x1000010 <__Thumbv4ABSLongThunk_thumb_target> @ imm = #-6
+// FAR-NEXT: 1000014: ldr r12, [pc] @ 0x100001c <__Thumbv4ABSLongThunk_thumb_target+0xc>
// FAR-NEXT: bx r12
-// FAR-NEXT: 1000024: 05 00 00 06 .word 0x06000005
+// FAR-NEXT: 100001c: 05 00 00 06 .word 0x06000005
+// FAR-EMPTY:
+// FAR-NEXT: <__ARMv5LongLdrPcThunk_target>:
+// FAR-NEXT: 1000020: ldr pc, [pc, #-4] @ 0x1000024 <__ARMv5LongLdrPcThunk_target+0x4>
+// FAR-NEXT: 1000024: 00 00 00 06 .word 0x06000000
// FAR-EB-LABEL: <_start>:
-// FAR-EB-NEXT: 1000000: bl 0x1000010 <__ARMv5LongLdrPcThunk_target> @ imm = #8
+// FAR-EB-NEXT: 1000000: bl 0x1000020 <__ARMv5LongLdrPcThunk_target> @ imm = #24
// FAR-EB-NEXT: bx lr
// FAR-EB-EMPTY:
// FAR-EB-LABEL: <thumb_start>:
-// FAR-EB-NEXT: 1000008: bl 0x1000018 <__Thumbv4ABSLongThunk_thumb_target> @ imm = #12
+// FAR-EB-NEXT: 1000008: bl 0x1000010 <__Thumbv4ABSLongThunk_thumb_target> @ imm = #4
// FAR-EB-NEXT: bx lr
// FAR-EB-NEXT: bmi 0xffffba @ imm = #-88
// FAR-EB-EMPTY:
-// FAR-EB-NEXT: <__ARMv5LongLdrPcThunk_target>:
-// FAR-EB-NEXT: 1000010: ldr pc, [pc, #-4] @ 0x1000014 <__ARMv5LongLdrPcThunk_target+0x4>
-// FAR-EB-NEXT: 1000014: 06 00 00 00 .word 0x06000000
-// FAR-EB-EMPTY:
// FAR-EB-NEXT: <__Thumbv4ABSLongThunk_thumb_target>:
-// FAR-EB-NEXT: 1000018: bx pc
-// FAR-EB-NEXT: b 0x1000018 <__Thumbv4ABSLongThunk_thumb_target> @ imm = #-6
-// FAR-EB-NEXT: 100001c: ldr r12, [pc] @ 0x1000024 <__Thumbv4ABSLongThunk_thumb_target+0xc>
+// FAR-EB-NEXT: 1000010: bx pc
+// FAR-EB-NEXT: b 0x1000010 <__Thumbv4ABSLongThunk_thumb_target> @ imm = #-6
+// FAR-EB-NEXT: 1000014: ldr r12, [pc] @ 0x100001c <__Thumbv4ABSLongThunk_thumb_target+0xc>
// FAR-EB-NEXT: bx r12
-// FAR-EB-NEXT: 1000024: 06 00 00 05 .word 0x06000005
+// FAR-EB-NEXT: 100001c: 06 00 00 05 .word 0x06000005
+// FAR-EB-EMPTY:
+// FAR-EB-NEXT: <__ARMv5LongLdrPcThunk_target>:
+// FAR-EB-NEXT: 1000020: ldr pc, [pc, #-4] @ 0x1000024 <__ARMv5LongLdrPcThunk_target+0x4>
+// FAR-EB-NEXT: 1000024: 06 00 00 00 .word 0x06000000
// FAR-PIE-LABEL: <_start>:
-// FAR-PIE-NEXT: 1000000: bl 0x1000010 <__ARMv4PILongThunk_target> @ imm = #8
+// FAR-PIE-NEXT: 1000000: bl 0x1000024 <__ARMv4PILongThunk_target> @ imm = #28
// FAR-PIE-NEXT: bx lr
// FAR-PIE-EMPTY:
// FAR-PIE-NEXT: <thumb_start>:
-// FAR-PIE-NEXT: 1000008: bl 0x100001c <__Thumbv4PILongThunk_thumb_target> @ imm = #16
+// FAR-PIE-NEXT: 1000008: bl 0x1000010 <__Thumbv4PILongThunk_thumb_target> @ imm = #4
// FAR-PIE-NEXT: bx lr
// FAR-PIE-NEXT: bmi 0xffffba @ imm = #-88
// FAR-PIE-EMPTY:
-// FAR-PIE-NEXT: <__ARMv4PILongThunk_target>:
-// FAR-PIE-NEXT: 1000010: ldr r12, [pc] @ 0x1000018 <__ARMv4PILongThunk_target+0x8>
-// FAR-PIE-NEXT: add pc, pc, r12
-// FAR-PIE-NEXT: 1000018: e4 ff ff 04 .word 0x04ffffe4
-// FAR-PIE-EMPTY:
// FAR-PIE-NEXT: <__Thumbv4PILongThunk_thumb_target>:
-// FAR-PIE-NEXT: 100001c: bx pc
-// FAR-PIE-NEXT: b 0x100001c <__Thumbv4PILongThunk_thumb_target> @ imm = #-6
-// FAR-PIE-NEXT: 1000020: ldr r12, [pc, #4] @ 0x100002c <__Thumbv4PILongThunk_thumb_target+0x10>
+// FAR-PIE-NEXT: 1000010: bx pc
+// FAR-PIE-NEXT: b 0x1000010 <__Thumbv4PILongThunk_thumb_target> @ imm = #-6
+// FAR-PIE-NEXT: 1000014: ldr r12, [pc, #4] @ 0x1000020 <__Thumbv4PILongThunk_thumb_target+0x10>
// FAR-PIE-NEXT: add r12, pc, r12
// FAR-PIE-NEXT: bx r12
-// FAR-PIE-NEXT: 100002c: d9 ff ff 04 .word 0x04ffffd9
+// FAR-PIE-NEXT: 1000020: e5 ff ff 04 .word 0x04ffffe5
+// FAR-PIE-EMPTY:
+// FAR-PIE-NEXT: <__ARMv4PILongThunk_target>:
+// FAR-PIE-NEXT: 1000024: ldr r12, [pc] @ 0x100002c <__ARMv4PILongThunk_target+0x8>
+// FAR-PIE-NEXT: add pc, pc, r12
+// FAR-PIE-NEXT: 100002c: d0 ff ff 04 .word 0x04ffffd0
// FAR-EB-PIE-LABEL: <_start>:
-// FAR-EB-PIE-NEXT: 1000000: bl 0x1000010 <__ARMv4PILongThunk_target> @ imm = #8
+// FAR-EB-PIE-NEXT: 1000000: bl 0x1000024 <__ARMv4PILongThunk_target> @ imm = #28
// FAR-EB-PIE-NEXT: bx lr
// FAR-EB-PIE-EMPTY:
// FAR-EB-PIE-NEXT: <thumb_start>:
-// FAR-EB-PIE-NEXT: 1000008: bl 0x100001c <__Thumbv4PILongThunk_thumb_target> @ imm = #16
+// FAR-EB-PIE-NEXT: 1000008: bl 0x1000010 <__Thumbv4PILongThunk_thumb_target> @ imm = #4
// FAR-EB-PIE-NEXT: bx lr
// FAR-EB-PIE-NEXT: bmi 0xffffba @ imm = #-88
// FAR-EB-PIE-EMPTY:
-// FAR-EB-PIE-NEXT: <__ARMv4PILongThunk_target>:
-// FAR-EB-PIE-NEXT: 1000010: ldr r12, [pc] @ 0x1000018 <__ARMv4PILongThunk_target+0x8>
-// FAR-EB-PIE-NEXT: add pc, pc, r12
-// FAR-EB-PIE-NEXT: 1000018: 04 ff ff e4 .word 0x04ffffe4
-// FAR-EB-PIE-EMPTY:
// FAR-EB-PIE-NEXT: <__Thumbv4PILongThunk_thumb_target>:
-// FAR-EB-PIE-NEXT: 100001c: bx pc
-// FAR-EB-PIE-NEXT: b 0x100001c <__Thumbv4PILongThunk_thumb_target> @ imm = #-6
-// FAR-EB-PIE-NEXT: 1000020: ldr r12, [pc, #4] @ 0x100002c <__Thumbv4PILongThunk_thumb_target+0x10>
+// FAR-EB-PIE-NEXT: 1000010: bx pc
+// FAR-EB-PIE-NEXT: b 0x1000010 <__Thumbv4PILongThunk_thumb_target> @ imm = #-6
+// FAR-EB-PIE-NEXT: 1000014: ldr r12, [pc, #4] @ 0x1000020 <__Thumbv4PILongThunk_thumb_target+0x10>
// FAR-EB-PIE-NEXT: add r12, pc, r12
// FAR-EB-PIE-NEXT: bx r12
-// FAR-EB-PIE-NEXT: 100002c: 04 ff ff d9 .word 0x04ffffd9
+// FAR-EB-PIE-NEXT: 1000020: 04 ff ff e5 .word 0x04ffffe5
+// FAR-EB-PIE-EMPTY:
+// FAR-EB-PIE-NEXT: <__ARMv4PILongThunk_target>:
+// FAR-EB-PIE-NEXT: 1000024: ldr r12, [pc] @ 0x100002c <__ARMv4PILongThunk_target+0x8>
+// FAR-EB-PIE-NEXT: add pc, pc, r12
+// FAR-EB-PIE-NEXT: 100002c: 04 ff ff d0 .word 0x04ffffd0
// NEAR-LABEL: <_start>:
// NEAR-NEXT: 1000000: bl 0x1000010 <target> @ imm = #8
diff --git a/lld/test/ELF/arm-branch-rangethunk.s b/lld/test/ELF/arm-branch-rangethunk.s
index 8b51caa3fdc23..b630d55ffb923 100644
--- a/lld/test/ELF/arm-branch-rangethunk.s
+++ b/lld/test/ELF/arm-branch-rangethunk.s
@@ -1,10 +1,10 @@
// REQUIRES: arm
// RUN: llvm-mc -arm-add-build-attributes -filetype=obj -triple=armv7a-none-linux-gnueabi %s -o %t
// RUN: llvm-mc -arm-add-build-attributes -filetype=obj -triple=armv7a-none-linux-gnueabi %S/Inputs/far-arm-abs.s -o %tfar
-// RUN: ld.lld -z nosort-thunks %t %tfar -o %t2
+// RUN: ld.lld %t %tfar -o %t2
// RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn --triple=armv7a-none-linux-gnueabi %t2 | FileCheck --check-prefix=SHORT %s
// RUN: llvm-mc -arm-add-build-attributes -filetype=obj -triple=armv7a-none-linux-gnueabi %S/Inputs/far-long-arm-abs.s -o %tfarlong
-// RUN: ld.lld -z nosort-thunks %t %tfarlong -o %t3
+// RUN: ld.lld %t %tfarlong -o %t3
// RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn --triple=armv7a-none-linux-gnueabi %t3 | FileCheck --check-prefix=LONG %s
.syntax unified
.section .text, "ax",%progbits
@@ -19,32 +19,30 @@ _start:
beq too_far3
// SHORT: 00030000 <_start>:
-// SHORT-NEXT: 30000: bl 0x3000c <__ARMv7ABSLongThunk_too_far1>
+// SHORT-NEXT: 30000: bl 0x30014 <__ARMv7ABSLongThunk_too_far1>
// SHORT-NEXT: 30004: b 0x30010 <__ARMv7ABSLongThunk_too_far2>
-// SHORT-NEXT: 30008: beq 0x30014 <__ARMv7ABSLongThunk_too_far3>
-// SHORT: 0003000c <__ARMv7ABSLongThunk_too_far1>:
-/// 0x2030008 = too_far1
-// SHORT-NEXT: 3000c: b 0x2030008
+// SHORT-NEXT: 30008: beq 0x3000c <__ARMv7ABSLongThunk_too_far3>
+// SHORT: 0003000c <__ARMv7ABSLongThunk_too_far3>:
+/// 0x2030010 = too_far3
+// SHORT-NEXT: 3000c: b 0x2030010
// SHORT: 00030010 <__ARMv7ABSLongThunk_too_far2>:
/// 0x203000c = too_far2
// SHORT-NEXT: 30010: b 0x203000c
-// SHORT: 00030014 <__ARMv7ABSLongThunk_too_far3>:
-/// 0x2030010 = too_far3
-// SHORT-NEXT: 30014: b 0x2030010
+// SHORT: 00030014 <__ARMv7ABSLongThunk_too_far1>:
+/// 0x2030008 = too_far1
+// SHORT-NEXT: 30014: b 0x2030008
// LONG: 00030000 <_start>:
-// LONG-NEXT: 30000: bl 0x3000c <__ARMv7ABSLongThunk_too_far1>
+// LONG-NEXT: 30000: bl 0x30024 <__ARMv7ABSLongThunk_too_far1>
// LONG-NEXT: 30004: b 0x30018 <__ARMv7ABSLongThunk_too_far2>
-// LONG-NEXT: 30008: beq 0x30024 <__ARMv7ABSLongThunk_too_far3>
-// LONG: 0003000c <__ARMv7ABSLongThunk_too_far1>:
-// LONG-NEXT: 3000c: movw r12, #20
+// LONG-NEXT: 30008: beq 0x3000c <__ARMv7ABSLongThunk_too_far3>
+// LONG: 0003000c <__ARMv7ABSLongThunk_too_far3>:
+// LONG-NEXT: 3000c: movw r12, #44
// LONG-NEXT: 30010: movt r12, #515
// LONG-NEXT: 30014: bx r12
// LONG: 00030018 <__ARMv7ABSLongThunk_too_far2>:
// LONG-NEXT: 30018: movw r12, #32
// LONG-NEXT: 3001c: movt r12, #515
// LONG-NEXT: 30020: bx r12
-// LONG: 00030024 <__ARMv7ABSLongThunk_too_far3>:
-// LONG-NEXT: 30024: movw r12, #44
-// LONG-NEXT: 30028: movt r12, #515
-// LONG-NEXT: 3002c: bx r12
+// LONG: 00030024 <__ARMv7ABSLongThunk_too_far1>:
+// LONG-NEXT: 30024: b 0x2030014
diff --git a/lld/test/ELF/arm-force-pi-thunk.s b/lld/test/ELF/arm-force-pi-thunk.s
index 251209fbb08e1..db0f14b764dbd 100644
--- a/lld/test/ELF/arm-force-pi-thunk.s
+++ b/lld/test/ELF/arm-force-pi-thunk.s
@@ -1,7 +1,7 @@
// REQUIRES: arm
// RUN: rm -rf %t && split-file %s %t && cd %t
// RUN: llvm-mc -arm-add-build-attributes -filetype=obj -triple=armv7a-none-linux-gnueabi a.s -o a.o
-// RUN: ld.lld -z nosort-thunks --pic-veneer --no-rosegment --script a.lds a.o -o exe
+// RUN: ld.lld --pic-veneer --no-rosegment --script a.lds a.o -o exe
// RUN: llvm-objdump --no-print-imm-hex -d exe | FileCheck %s
// Test that we can force generation of position independent thunks even when
@@ -40,22 +40,22 @@ low_target2:
// CHECK-NEXT: <_start>:
// CHECK-NEXT: 94: 4770 bx lr
// CHECK: <low_target>:
-// CHECK-NEXT: 96: f000 f803 bl 0xa0 <__ThumbV7PILongThunk_high_target>
-// CHECK-NEXT: 9a: f000 f807 bl 0xac <__ThumbV7PILongThunk_high_target2>
+// CHECK-NEXT: 96: f000 f809 bl 0xac <__ThumbV7PILongThunk_high_target>
+// CHECK-NEXT: 9a: f000 f801 bl 0xa0 <__ThumbV7PILongThunk_high_target2>
// CHECK-NEXT: 9e: d4d4
-// CHECK: <__ThumbV7PILongThunk_high_target>:
-// CHECK-NEXT: a0: f64f 7c55 movw r12, #65365
+// CHECK: <__ThumbV7PILongThunk_high_target2>:
+// CHECK-NEXT: a0: f64f 7c75 movw r12, #65397
// CHECK-NEXT: a4: f2c0 1cff movt r12, #511
// CHECK-NEXT: a8: 44fc add r12, pc
// CHECK-NEXT: aa: 4760 bx r12
-// CHECK: <__ThumbV7PILongThunk_high_target2>:
-// CHECK-NEXT: ac: f64f 7c69 movw r12, #65385
+// CHECK: <__ThumbV7PILongThunk_high_target>:
+// CHECK-NEXT: ac: f64f 7c49 movw r12, #65353
// CHECK-NEXT: b0: f2c0 1cff movt r12, #511
// CHECK-NEXT: b4: 44fc add r12, pc
// CHECK-NEXT: b6: 4760 bx r12
// CHECK: <low_target2>:
-// CHECK-NEXT: b8: f7ff fff2 bl 0xa0 <__ThumbV7PILongThunk_high_target>
-// CHECK-NEXT: bc: f7ff fff6 bl 0xac <__ThumbV7PILongThunk_high_target2>
+// CHECK-NEXT: b8: f7ff fff8 bl 0xac <__ThumbV7PILongThunk_high_target>
+// CHECK-NEXT: bc: f7ff fff0 bl 0xa0 <__ThumbV7PILongThunk_high_target2>
.section .text_high, "ax", %progbits
diff --git a/lld/test/ELF/arm-thumb-condbranch-thunk.s b/lld/test/ELF/arm-thumb-condbranch-thunk.s
index 73daa139066d1..ef156a2852101 100644
--- a/lld/test/ELF/arm-thumb-condbranch-thunk.s
+++ b/lld/test/ELF/arm-thumb-condbranch-thunk.s
@@ -1,6 +1,6 @@
// REQUIRES: arm
// RUN: llvm-mc -arm-add-build-attributes -filetype=obj -triple=thumbv7a-none-linux-gnueabi %s -o %t.o
-// RUN: ld.lld -z nosort-thunks %t.o -o %t
+// RUN: ld.lld %t.o -o %t
// The output file is large, most of it zeroes. We dissassemble only the
// parts we need to speed up the test and avoid a large output file
// RUN: llvm-objdump -d %t --print-imm-hex --start-address=0x80000 --stop-address=0x80010 | FileCheck --check-prefix=CHECK1 %s
@@ -38,11 +38,11 @@ _start:
// CHECK1-EMPTY:
// CHECK1-NEXT: <tfunc00>:
// CHECK1-NEXT: 80000: 4770 bx lr
-// CHECK1-NEXT: 80002: f37f d7ff bl 0x1000004 <__Thumbv7ABSLongThunk_tfunc33>
-// CHECK1: <__Thumbv7ABSLongThunk_tfunc05>:
-// CHECK1-NEXT: 80008: f27f bffa b.w 0x300000 <tfunc05>
+// CHECK1-NEXT: 80002: f380 d001 bl 0x1000008 <__Thumbv7ABSLongThunk_tfunc33>
// CHECK1: <__Thumbv7ABSLongThunk_tfunc00>:
-// CHECK1-NEXT: 8000c: f7ff bff8 b.w 0x80000 <tfunc00>
+// CHECK1-NEXT: 80008: f7ff bffa b.w 0x80000 <tfunc00>
+// CHECK1: <__Thumbv7ABSLongThunk_tfunc05>:
+// CHECK1-NEXT: 8000c: f27f bff8 b.w 0x300000 <tfunc05>
FUNCTION 01
// tfunc02 is within range of tfunc02
beq.w tfunc02
@@ -52,14 +52,14 @@ _start:
// CHECK2: <tfunc01>:
// CHECK2-NEXT: 100000: 4770 bx lr
// CHECK2-NEXT: 100002: f03f a7fd beq.w 0x180000 <tfunc02>
-// CHECK2-NEXT: 100006: f47f a7ff bne.w 0x80008 <__Thumbv7ABSLongThunk_tfunc05>
+// CHECK2-NEXT: 100006: f440 8801 bne.w 0x8000c <__Thumbv7ABSLongThunk_tfunc05>
FUNCTION 02
// We can reach the Thunk Section created for bne.w tfunc05
bne.w tfunc05
beq.w tfunc00
// CHECK3: 180000: 4770 bx lr
-// CHECK3-NEXT: 180002: f440 8001 bne.w 0x80008 <__Thumbv7ABSLongThunk_tfunc05>
-// CHECK3-NEXT: 180006: f400 8001 beq.w 0x8000c <__Thumbv7ABSLongThunk_tfunc00>
+// CHECK3-NEXT: 180002: f440 8003 bne.w 0x8000c <__Thumbv7ABSLongThunk_tfunc05>
+// CHECK3-NEXT: 180006: f400 8003 beq.w 0x80010 <__Thumbv7ABSLongThunk_tfunc00>
FUNCTION 03
FUNCTION 04
FUNCTION 05
@@ -96,14 +96,14 @@ _start:
FUNCTION 29
FUNCTION 30
FUNCTION 31
-// CHECK6: <__Thumbv7ABSLongThunk_tfunc33>:
-// CHECK6-NEXT: 1000004: f0ff bffc b.w 0x1100000 <tfunc33>
-// CHECK6: <__Thumbv7ABSLongThunk_tfunc00>:
-// CHECK6-NEXT: 1000008: f47f 97fa b.w 0x80000 <tfunc00>
+// CHECK6: <__Thumbv7ABSLongThunk_tfunc00>:
+// CHECK6-NEXT: 1000004: f47f 97fc b.w 0x80000 <tfunc00>
+// CHECK6: <__Thumbv7ABSLongThunk_tfunc33>:
+// CHECK6-NEXT: 1000008: f0ff bffa b.w 0x1100000 <tfunc33>
FUNCTION 32
FUNCTION 33
// We should be able to reach an existing ThunkSection.
b.w tfunc00
// CHECK7: <tfunc33>:
// CHECK7-NEXT: 1100000: 4770 bx lr
-// CHECK7-NEXT: 1100002: f700 b801 b.w 0x1000008 <__Thumbv7ABSLongThunk_tfunc00>
+// CHECK7-NEXT: 1100002: f6ff bfff b.w 0x1000004 <__Thumbv7ABSLongThunk_tfunc00>
diff --git a/lld/test/ELF/arm-thumb-interwork-shared.s b/lld/test/ELF/arm-thumb-interwork-shared.s
index cef749df198f5..ca3ca22be0024 100644
--- a/lld/test/ELF/arm-thumb-interwork-shared.s
+++ b/lld/test/ELF/arm-thumb-interwork-shared.s
@@ -1,6 +1,6 @@
// REQUIRES: arm
// RUN: llvm-mc -arm-add-build-attributes -filetype=obj -triple=thumbv7a-none-linux-gnueabi %s -o %t
-// RUN: ld.lld -z nosort-thunks %t --shared -o %t.so
+// RUN: ld.lld %t --shared -o %t.so
// RUN: llvm-objdump --no-print-imm-hex -d --no-show-raw-insn %t.so | FileCheck %s
.syntax unified
.global sym1
@@ -19,17 +19,17 @@ sym1:
// CHECK: Disassembly of section .text:
// CHECK-EMPTY:...
[truncated]
``````````
</details>
https://github.com/llvm/llvm-project/pull/212694
More information about the llvm-commits
mailing list