@@ -1261,7 +1261,7 @@ Thunk::Thunk(Symbol &d, int64_t a) : destination(d), addend(a), offset(0) {
1261
1261
1262
1262
Thunk::~Thunk () = default ;
1263
1263
1264
- static Thunk *addThunkAArch64 (RelType type, Symbol &s, int64_t a) {
1264
+ static Thunk *addThunkAArch64 (Ctx &ctx, RelType type, Symbol &s, int64_t a) {
1265
1265
if (type != R_AARCH64_CALL26 && type != R_AARCH64_JUMP26 &&
1266
1266
type != R_AARCH64_PLT32)
1267
1267
fatal (" unrecognized relocation type" );
@@ -1357,8 +1357,8 @@ static Thunk *addThunkV6M(const InputSection &isec, RelType reloc, Symbol &s,
1357
1357
}
1358
1358
1359
1359
// 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) {
1362
1362
// Decide which Thunk is needed based on:
1363
1363
// Available instruction set
1364
1364
// - 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,
1430
1430
return make<PPC32LongThunk>(s, rel.addend );
1431
1431
}
1432
1432
1433
- static Thunk *addThunkPPC64 (RelType type, Symbol &s, int64_t a) {
1433
+ static Thunk *addThunkPPC64 (Ctx &ctx, RelType type, Symbol &s, int64_t a) {
1434
1434
assert ((type == R_PPC64_REL14 || type == R_PPC64_REL24 ||
1435
1435
type == R_PPC64_REL24_NOTOC) &&
1436
1436
" unexpected relocation type for thunk" );
@@ -1460,23 +1460,23 @@ static Thunk *addThunkPPC64(RelType type, Symbol &s, int64_t a) {
1460
1460
return make<PPC64PDLongBranchThunk>(s, a);
1461
1461
}
1462
1462
1463
- Thunk *elf::addThunk (const InputSection &isec, Relocation &rel) {
1463
+ Thunk *elf::addThunk (Ctx &ctx, const InputSection &isec, Relocation &rel) {
1464
1464
Symbol &s = *rel.sym ;
1465
1465
int64_t a = rel.addend ;
1466
1466
1467
1467
switch (ctx.arg .emachine ) {
1468
1468
case EM_AARCH64:
1469
- return addThunkAArch64 (rel.type , s, a);
1469
+ return addThunkAArch64 (ctx, rel.type , s, a);
1470
1470
case EM_ARM:
1471
- return addThunkArm (isec, rel.type , s, a);
1471
+ return addThunkArm (ctx, isec, rel.type , s, a);
1472
1472
case EM_AVR:
1473
1473
return addThunkAVR (rel.type , s, a);
1474
1474
case EM_MIPS:
1475
1475
return addThunkMips (rel.type , s);
1476
1476
case EM_PPC:
1477
1477
return addThunkPPC32 (isec, rel, s);
1478
1478
case EM_PPC64:
1479
- return addThunkPPC64 (rel.type , s, a);
1479
+ return addThunkPPC64 (ctx, rel.type , s, a);
1480
1480
default :
1481
1481
llvm_unreachable (" add Thunk only supported for ARM, AVR, Mips and PowerPC" );
1482
1482
}
0 commit comments