[lld] [lld] Add thunks for hexagon (PR #111217)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 10 22:19:42 PDT 2025


================
@@ -1692,6 +1741,24 @@ static std::unique_ptr<Thunk> addThunkAVR(Ctx &ctx, RelType type, Symbol &s,
   }
 }
 
+static std::unique_ptr<Thunk> addThunkHexagon(Ctx &ctx,
+                                              const InputSection &isec,
+                                              Relocation &rel, Symbol &s) {
+  switch (rel.type) {
+  case R_HEX_B9_PCREL:
----------------
MaskRay wrote:

In `needsThunk` you list 7 relocation types

  case R_HEX_B22_PCREL:
  case R_HEX_PLT_B22_PCREL:
  case R_HEX_GD_PLT_B22_PCREL:
  case R_HEX_LD_PLT_B22_PCREL:
  case R_HEX_B15_PCREL:
  case R_HEX_B13_PCREL:
  case R_HEX_B9_PCREL:

Here are only 6. Please fix it and don't add `Fatal`. It should just be unreachable. ARM has Fatal because it has complex microarch thunk logic, so some erroneous code paths are technically reachable.

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


More information about the llvm-commits mailing list