[lld] [LLD][ELF] Do not reuse thunks in OVERLAYs (PR #200415)

Peter Smith via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 1 07:03:46 PDT 2026


================
@@ -0,0 +1,89 @@
+// REQUIRES: arm
+// RUN: rm -rf %t && split-file %s %t && cd %t
+// RUN: llvm-mc -arm-add-build-attributes -filetype=obj -triple=armv4t-none-eabi a.s -o a.o
+// RUN: ld.lld a.o -T overlay.ld -o overlay
+// RUN: llvm-objdump -d --no-show-raw-insn overlay | FileCheck %s
+
+/// A thunk in a different overlay should not be shared as we cannot guarantee it
+/// is in memory. It is OK for an overlay to share a thunk in a non-overlay as
+/// that will be in memory.
+
+// CHECK-LABEL: 00001000 <_start>:
+// CHECK-NEXT: 1000: bl 0x1004
+// CHECK-LABEL 00001004 <__Thumbv4ABSLongThunk_far>:
----------------
smithp35 wrote:

ACK.

https://github.com/llvm/llvm-project/pull/200415


More information about the llvm-commits mailing list