@@ -321,7 +321,7 @@ static void writePltLong(uint8_t *buf, uint64_t gotPltEntryAddr,
321321void ARM::writePlt (uint8_t *buf, const Symbol &sym,
322322 uint64_t pltEntryAddr) const {
323323 if (!useThumbPLTs (ctx)) {
324- uint64_t offset = sym.getGotPltVA () - pltEntryAddr - 8 ;
324+ uint64_t offset = sym.getGotPltVA (ctx ) - pltEntryAddr - 8 ;
325325
326326 // The PLT entry is similar to the example given in Appendix A of ELF for
327327 // the Arm Architecture. Instead of using the Group Relocations to find the
@@ -335,15 +335,15 @@ void ARM::writePlt(uint8_t *buf, const Symbol &sym,
335335 };
336336 if (!llvm::isUInt<27 >(offset)) {
337337 // We cannot encode the Offset, use the long form.
338- writePltLong (buf, sym.getGotPltVA (), pltEntryAddr);
338+ writePltLong (buf, sym.getGotPltVA (ctx ), pltEntryAddr);
339339 return ;
340340 }
341341 write32 (buf + 0 , pltData[0 ] | ((offset >> 20 ) & 0xff ));
342342 write32 (buf + 4 , pltData[1 ] | ((offset >> 12 ) & 0xff ));
343343 write32 (buf + 8 , pltData[2 ] | (offset & 0xfff ));
344344 memcpy (buf + 12 , trapInstr.data (), 4 ); // Pad to 16-byte boundary
345345 } else {
346- uint64_t offset = sym.getGotPltVA () - pltEntryAddr - 12 ;
346+ uint64_t offset = sym.getGotPltVA (ctx ) - pltEntryAddr - 12 ;
347347 assert (llvm::isUInt<32 >(offset) && " This should always fit into a 32-bit offset" );
348348
349349 // A PLT entry will be:
@@ -387,7 +387,7 @@ bool ARM::needsThunk(RelExpr expr, RelType type, const InputFile *file,
387387 // be resolved as a branch to the next instruction. If it is hidden, its
388388 // binding has been converted to local, so we just check isUndefined() here. A
389389 // undefined non-weak symbol will have been errored.
390- if (s.isUndefined () && !s.isInPlt ())
390+ if (s.isUndefined () && !s.isInPlt (ctx ))
391391 return false ;
392392 // A state change from ARM to Thumb and vice versa must go through an
393393 // interworking thunk if the relocation type is not R_ARM_CALL or
@@ -404,7 +404,7 @@ bool ARM::needsThunk(RelExpr expr, RelType type, const InputFile *file,
404404 return true ;
405405 [[fallthrough]];
406406 case R_ARM_CALL: {
407- uint64_t dst = (expr == R_PLT_PC) ? s.getPltVA () : s.getVA ();
407+ uint64_t dst = (expr == R_PLT_PC) ? s.getPltVA (ctx ) : s.getVA ();
408408 return !inBranchRange (type, branchAddr, dst + a) ||
409409 (!ctx.arg .armHasBlx && (s.getVA () & 1 ));
410410 }
@@ -417,7 +417,7 @@ bool ARM::needsThunk(RelExpr expr, RelType type, const InputFile *file,
417417 return true ;
418418 [[fallthrough]];
419419 case R_ARM_THM_CALL: {
420- uint64_t dst = (expr == R_PLT_PC) ? s.getPltVA () : s.getVA ();
420+ uint64_t dst = (expr == R_PLT_PC) ? s.getPltVA (ctx ) : s.getVA ();
421421 return !inBranchRange (type, branchAddr, dst + a) ||
422422 (!ctx.arg .armHasBlx && (s.getVA () & 1 ) == 0 );;
423423 }
@@ -686,9 +686,9 @@ void ARM::relocate(uint8_t *loc, const Relocation &rel, uint64_t val) const {
686686 bool isBlx = (read16 (loc + 2 ) & 0x1000 ) == 0 ;
687687 // lld 10.0 and before always used bit0Thumb when deciding to write a BLX
688688 // even when type not STT_FUNC.
689- if (!rel.sym ->isFunc () && !rel.sym ->isInPlt () && isBlx == useThumb)
689+ if (!rel.sym ->isFunc () && !rel.sym ->isInPlt (ctx ) && isBlx == useThumb)
690690 stateChangeWarning (ctx, loc, rel.type , *rel.sym );
691- if ((rel.sym ->isFunc () || rel.sym ->isInPlt ()) ? !useThumb : isBlx) {
691+ if ((rel.sym ->isFunc () || rel.sym ->isInPlt (ctx )) ? !useThumb : isBlx) {
692692 // We are writing a BLX. Ensure BLX destination is 4-byte aligned. As
693693 // the BLX instruction may only be two byte aligned. This must be done
694694 // before overflow check.
0 commit comments