Skip to content

Commit

Permalink
Support R_AARCH64_PLT32
Browse files Browse the repository at this point in the history
  • Loading branch information
rui314 committed Feb 1, 2023
1 parent fdc592b commit e505900
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions elf/arch-arm64.cc
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,10 @@ void InputSection<E>::apply_reloc_alloc(Context<E> &ctx, u8 *base) {
*(ul32 *)loc |= bits(val, 27, 2);
break;
}
case R_AARCH64_PLT32:
check(S + A - P, -(1LL << 31), 1LL << 31);
*(ul32 *)loc = S + A - P;
break;
case R_AARCH64_CONDBR19:
case R_AARCH64_LD_PREL_LO19:
check(S + A - P, -(1LL << 20), 1LL << 20);
Expand Down Expand Up @@ -506,6 +510,7 @@ void InputSection<E>::scan_relocations(Context<E> &ctx) {
break;
case R_AARCH64_CALL26:
case R_AARCH64_JUMP26:
case R_AARCH64_PLT32:
if (sym.is_imported)
sym.flags |= NEEDS_PLT;
break;
Expand Down

0 comments on commit e505900

Please sign in to comment.