[all-commits] [llvm/llvm-project] 651afa: [LLD][ELF] Do not reuse thunks in OVERLAYs (#200415)

Peter Smith via All-commits all-commits at lists.llvm.org
Wed Jun 10 03:03:49 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 651afa86119fd138488490862d1418eb40a43473
      https://github.com/llvm/llvm-project/commit/651afa86119fd138488490862d1418eb40a43473
  Author: Peter Smith <peter.smith at arm.com>
  Date:   2026-06-10 (Wed, 10 Jun 2026)

  Changed paths:
    M lld/ELF/Relocations.cpp
    A lld/test/ELF/aarch64-thunk-bti-overlay-reuse.s
    A lld/test/ELF/arm-thunk-overlay-reuse.s

  Log Message:
  -----------
  [LLD][ELF] Do not reuse thunks in OVERLAYs (#200415)

We cannot guarantee that a thunk in an OVERLAY will be in memory at the
same time as the caller if the caller is not in the same output section.
It is safe for a caller in an OVERLAY to reuse a thunk in a non-OVERLAY
section as we know that will be in memory. Thunks that are placed
before their target, are alternative entry points and can also be reused.

Resurrect the isThunkSectionCompatible function that was recently
removed as it served a similar purpose for thunks in different
partitions.

Potentially fixes #199966 which mentions a similar problem for sections
assigned to TCM (Tightly Coupled Memory). It should be possible to model
a TCM as an OVERLAY. If not then there may need to be a command-line
option to inhibit thunk sharing across output sections.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list