Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(MIPS): added R_MIPS_26 Relocation #525

Merged
merged 2 commits into from
Nov 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading