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

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 9 18:49:49 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>:
----------------
MaskRay wrote:

Omit addresses from the LABEL line. If the address ever changes, the address at the `NEXT` directive will give a better diagnostic

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


More information about the llvm-commits mailing list