[PATCH] D139888: [lld][ARM] add linker support for Armv4(T) absolute relocations

Ties Stuij via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 12 15:17:37 PST 2022


stuij created this revision.
Herald added subscribers: kristof.beyls, arichardson, emaste.
Herald added a reviewer: MaskRay.
Herald added a project: All.
stuij requested review of this revision.
Herald added subscribers: llvm-commits, StephenFan.
Herald added a project: LLVM.

changes:

- BLX: The Arm architecture versions that support the branch and link

instruction (BLX), can rewrite BLs in place when a state change from Arm<->Thumb
is required. Armv4T does not have BLX and so needs thunks for state changes.

- v4T Thumb long branches needed their own thunk. We could have used the v6M

implementation, but v6M doesn't have Arm state and must resolve to rather
inefficient stack reshuffling. We also can't reuse v7 thumb thunks as they use
MOVV/MOVT, which wasn't available yet for v4T.

- Remove the `lack of BLX' warning. LLVM only supports Arm Architecture versions

upwards of v4, which we now all support in LLD.

- The ARMV5ABSLongThunk thunk was renamed to ARMV4ABSLongThunk to follow the

convention that it's named after the lowest arch version that makes use of
it. It gives the appearance something is wrong if code targeting a lower arch
version is using a thunk named after a higher arch.

- removed isCompatibleWith method from ARMV5ABSLongThunk and ARMV5PILongThunk,

as they were identical to the ARMThunk parent class implementation.

Support for (efficient) position independent thunks for v4T will be added in a
follow-up patch, including possible related thunk renaming and code comment
cleanup.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D139888

Files:
  lld/ELF/Arch/ARM.cpp
  lld/ELF/Driver.cpp
  lld/ELF/Thunks.cpp
  lld/test/ELF/arm-bl-v4t.s
  lld/test/ELF/arm-bl-v6.s
  lld/test/ELF/arm-blx-v4t.s
  lld/test/ELF/arm-blx.s
  lld/test/ELF/arm-bx-v4t.s
  lld/test/ELF/arm-thumb-interwork-thunk-v5.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D139888.482288.patch
Type: text/x-patch
Size: 27488 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20221212/dd40235d/attachment-0001.bin>


More information about the llvm-commits mailing list