[lld] [lld] Add thunks for hexagon (PR #111217)
Fangrui Song via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 10 22:14:02 PDT 2025
================
@@ -2129,17 +2129,44 @@ void ThunkCreator::mergeThunks(ArrayRef<OutputSection *> outputSections) {
});
}
-static int64_t getPCBias(Ctx &ctx, RelType type) {
- if (ctx.arg.emachine != EM_ARM)
- return 0;
- switch (type) {
- case R_ARM_THM_JUMP19:
- case R_ARM_THM_JUMP24:
- case R_ARM_THM_CALL:
- return 4;
- default:
- return 8;
+constexpr uint32_t HEXAGON_MASK_END_PACKET = 3 << 14;
+constexpr uint32_t HEXAGON_END_OF_PACKET = 3 << 14;
+constexpr uint32_t HEXAGON_END_OF_DUPLEX = 0 << 14;
+
+// Return the distance between the packet start and the instruction in the
+// relocation.
+static int getHexagonPacketOffset(const InputSection &isec,
+ const Relocation &rel) {
+ const ArrayRef<uint8_t> SectContents = isec.content();
----------------
MaskRay wrote:
lld uses the `variableName` naming convention.
The most common convention uses `sec` for InputSection and `data` for section content.
(We use `osec` for `OutputSection`, and `sec` is for InputSection. Some old code might not stick with the convention.)
https://github.com/llvm/llvm-project/pull/111217
More information about the llvm-commits
mailing list