Skip to content

Commit

Permalink
Support R_PPC64_DTPREL16_LO_DS
Browse files Browse the repository at this point in the history
  • Loading branch information
rui314 committed Feb 20, 2024
1 parent 7ead723 commit 9f07fd0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions elf/arch-ppc64v1.cc
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,9 @@ void InputSection<E>::apply_reloc_alloc(Context<E> &ctx, u8 *base) {
case R_PPC64_DTPREL16_LO:
*(ub16 *)loc = lo(S + A - ctx.dtp_addr);
break;
case R_PPC64_DTPREL16_LO_DS:
*(ub16 *)loc |= ((S + A - ctx.dtp_addr) & 0x3fff) << 2;
break;
case R_PPC64_TPREL16_HA:
*(ub16 *)loc = ha(S + A - ctx.tp_addr);
break;
Expand Down Expand Up @@ -401,6 +404,7 @@ void InputSection<E>::scan_relocations(Context<E> &ctx) {
case R_PPC64_TLSLD:
case R_PPC64_DTPREL16_HA:
case R_PPC64_DTPREL16_LO:
case R_PPC64_DTPREL16_LO_DS:
break;
default:
Error(ctx) << *this << ": unknown relocation: " << rel;
Expand Down

0 comments on commit 9f07fd0

Please sign in to comment.