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

Brian Cain via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 8 08:26:12 PST 2024


================
@@ -1531,6 +1579,21 @@ static Thunk *addThunkAVR(Ctx &ctx, RelType type, Symbol &s, int64_t a) {
   }
 }
 
+static Thunk *addThunkHexagon(Ctx &ctx, const InputSection &isec,
+                              Relocation &rel, Symbol &s) {
+  switch (rel.type) {
+  case R_HEX_B9_PCREL:
+  case R_HEX_B13_PCREL:
+  case R_HEX_B15_PCREL:
+  case R_HEX_B22_PCREL:
+  case R_HEX_PLT_B22_PCREL:
+  case R_HEX_GD_PLT_B22_PCREL:
+    return make<HexagonThunk>(ctx, isec, rel, s);
+  default:
+    fatal("unrecognized relocation type " + toString(rel.type));
----------------
androm3da wrote:

This has been changed to follow the pattern used by other architectures, hopefully it's satisfactory.

> ensure this indeed unreachable

Sorry, I'm not sure I understand what would be sufficient.  Ensure it by reviewing the set of relocations for which we could add a thunk?  Or by increasing test coverage here?  Or ... ?

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


More information about the llvm-commits mailing list