[all-commits] [llvm/llvm-project] b42f96: [lld] Add thunks for hexagon (#111217)

Brian Cain via All-commits all-commits at lists.llvm.org
Sun Jul 20 09:46:52 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b42f96bc057fd9e31572069b241ba130c21144e5
      https://github.com/llvm/llvm-project/commit/b42f96bc057fd9e31572069b241ba130c21144e5
  Author: Brian Cain <brian.cain at oss.qualcomm.com>
  Date:   2025-07-20 (Sun, 20 Jul 2025)

  Changed paths:
    M lld/ELF/Arch/Hexagon.cpp
    M lld/ELF/Relocations.cpp
    M lld/ELF/Thunks.cpp
    R lld/test/ELF/hexagon-jump-error.s
    A lld/test/ELF/hexagon-thunk-range-b22rel.s
    A lld/test/ELF/hexagon-thunk-range-gdplt.s
    A lld/test/ELF/hexagon-thunk-range-plt.s
    A lld/test/ELF/hexagon-thunks-packets.s
    A lld/test/ELF/hexagon-thunks.s

  Log Message:
  -----------
  [lld] Add thunks for hexagon (#111217)

Without thunks, programs will encounter link errors complaining that the
branch target is out of range. Thunks will extend the range of branch
targets, which is a critical need for large programs. Thunks provide
this flexibility at a cost of some modest code size increase.

When configured with the maximal feature set, the hexagon port of the
linux kernel would often encounter these limitations when linking with
`lld`.

The relocations which will be extended by thunks are:

* R_HEX_B22_PCREL, R_HEX_{G,L}D_PLT_B22_PCREL, R_HEX_PLT_B22_PCREL
relocations have a range of ± 8MiB on the baseline
* R_HEX_B15_PCREL: ±65,532 bytes
* R_HEX_B13_PCREL: ±16,380 bytes
* R_HEX_B9_PCREL: ±1,020 bytes

Fixes #149689 

Co-authored-by: Alexey Karyakin <akaryaki at quicinc.com>

---------

Co-authored-by: Alexey Karyakin <akaryaki at quicinc.com>



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