@@ -1261,7 +1261,7 @@ Thunk::Thunk(Symbol &d, int64_t a) : destination(d), addend(a), offset(0) {
12611261
12621262Thunk::~Thunk () = default ;
12631263
1264- static Thunk *addThunkAArch64 (RelType type, Symbol &s, int64_t a) {
1264+ static Thunk *addThunkAArch64 (Ctx &ctx, RelType type, Symbol &s, int64_t a) {
12651265 if (type != R_AARCH64_CALL26 && type != R_AARCH64_JUMP26 &&
12661266 type != R_AARCH64_PLT32)
12671267 fatal (" unrecognized relocation type" );
@@ -1357,8 +1357,8 @@ static Thunk *addThunkV6M(const InputSection &isec, RelType reloc, Symbol &s,
13571357}
13581358
13591359// Creates a thunk for Thumb-ARM interworking or branch range extension.
1360- static Thunk *addThunkArm (const InputSection &isec, RelType reloc, Symbol &s ,
1361- int64_t a) {
1360+ static Thunk *addThunkArm (Ctx &ctx, const InputSection &isec, RelType reloc,
1361+ Symbol &s, int64_t a) {
13621362 // Decide which Thunk is needed based on:
13631363 // Available instruction set
13641364 // - An Arm Thunk can only be used if Arm state is available.
@@ -1430,7 +1430,7 @@ static Thunk *addThunkPPC32(const InputSection &isec, const Relocation &rel,
14301430 return make<PPC32LongThunk>(s, rel.addend );
14311431}
14321432
1433- static Thunk *addThunkPPC64 (RelType type, Symbol &s, int64_t a) {
1433+ static Thunk *addThunkPPC64 (Ctx &ctx, RelType type, Symbol &s, int64_t a) {
14341434 assert ((type == R_PPC64_REL14 || type == R_PPC64_REL24 ||
14351435 type == R_PPC64_REL24_NOTOC) &&
14361436 " unexpected relocation type for thunk" );
@@ -1460,23 +1460,23 @@ static Thunk *addThunkPPC64(RelType type, Symbol &s, int64_t a) {
14601460 return make<PPC64PDLongBranchThunk>(s, a);
14611461}
14621462
1463- Thunk *elf::addThunk (const InputSection &isec, Relocation &rel) {
1463+ Thunk *elf::addThunk (Ctx &ctx, const InputSection &isec, Relocation &rel) {
14641464 Symbol &s = *rel.sym ;
14651465 int64_t a = rel.addend ;
14661466
14671467 switch (ctx.arg .emachine ) {
14681468 case EM_AARCH64:
1469- return addThunkAArch64 (rel.type , s, a);
1469+ return addThunkAArch64 (ctx, rel.type , s, a);
14701470 case EM_ARM:
1471- return addThunkArm (isec, rel.type , s, a);
1471+ return addThunkArm (ctx, isec, rel.type , s, a);
14721472 case EM_AVR:
14731473 return addThunkAVR (rel.type , s, a);
14741474 case EM_MIPS:
14751475 return addThunkMips (rel.type , s);
14761476 case EM_PPC:
14771477 return addThunkPPC32 (isec, rel, s);
14781478 case EM_PPC64:
1479- return addThunkPPC64 (rel.type , s, a);
1479+ return addThunkPPC64 (ctx, rel.type , s, a);
14801480 default :
14811481 llvm_unreachable (" add Thunk only supported for ARM, AVR, Mips and PowerPC" );
14821482 }
0 commit comments