Skip to content

Commit

Permalink
feat(MIPS): added R_MIPS_26 Relocation
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielBotnik committed Nov 9, 2024
1 parent a4fa0da commit c2a5661
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion cle/backends/elf/relocation/mips.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@ class R_MIPS_REL32(GenericRelativeReloc):
pass


class R_MIPS_26(GenericAbsoluteReloc):
def relocate(self):
if not self.resolved:
return False

original_value = self.owner.memory.unpack_word(self.dest_addr)
original_value += (self.value // 4)

self.owner.memory.pack_word(self.dest_addr, original_value)
return True


class R_MIPS_JUMP_SLOT(GenericAbsoluteReloc):
pass

Expand Down Expand Up @@ -129,7 +141,7 @@ class R_MIPS_TLS_TPREL64(GenericTLSOffsetReloc):
# 1: R_MIPS_16,
2: R_MIPS_32,
3: R_MIPS_REL32,
# 4: R_MIPS_26,
4: R_MIPS_26,
5: R_MIPS_HI16,
6: R_MIPS_LO16,
# 7: R_MIPS_GPREL16,
Expand Down

0 comments on commit c2a5661

Please sign in to comment.