Skip to content

Commit 03f2bcb

Browse files
R_MIPS_GPREL32 Support (#270)
* R_MIPS_GPREL32 Support * cargo fmt * Add name for R_MIPS_GPREL32 relocation
1 parent 7810717 commit 03f2bcb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

objdiff-core/src/arch/mips.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,7 @@ impl Arch for ArchMips {
293293
}
294294
elf::R_MIPS_PC16 => 0, // PC-relative relocation
295295
R_MIPS15_S3 => ((code & 0x001FFFC0) >> 3) as i64,
296+
elf::R_MIPS_GPREL32 => (code as i32 as i64) + self.ri_gp_value as i64,
296297
flags => bail!("Unsupported MIPS implicit relocation {flags:?}"),
297298
};
298299
Ok(Some(RelocationOverride { target: RelocationOverrideTarget::Keep, addend }))
@@ -318,6 +319,7 @@ impl Arch for ArchMips {
318319
elf::R_MIPS_GOT16 => Some("R_MIPS_GOT16"),
319320
elf::R_MIPS_PC16 => Some("R_MIPS_PC16"),
320321
elf::R_MIPS_CALL16 => Some("R_MIPS_CALL16"),
322+
elf::R_MIPS_GPREL32 => Some("R_MIPS_GPREL32"),
321323
R_MIPS15_S3 => Some("R_MIPS15_S3"),
322324
_ => None,
323325
},

0 commit comments

Comments
 (0)