Compare commits

...

3 Commits

Author SHA1 Message Date
9123928b76 Add name for R_MIPS_GPREL32 relocation 2025-10-08 20:24:38 -06:00
Ethan Lafrenais
b5846cc1c8 cargo fmt 2025-10-08 18:47:29 -04:00
Ethan Lafrenais
c3ab203ec1 R_MIPS_GPREL32 Support 2025-10-08 18:42:03 -04:00

View File

@@ -293,6 +293,7 @@ impl Arch for ArchMips {
}
elf::R_MIPS_PC16 => 0, // PC-relative relocation
R_MIPS15_S3 => ((code & 0x001FFFC0) >> 3) as i64,
elf::R_MIPS_GPREL32 => (code as i32 as i64) + self.ri_gp_value as i64,
flags => bail!("Unsupported MIPS implicit relocation {flags:?}"),
};
Ok(Some(RelocationOverride { target: RelocationOverrideTarget::Keep, addend }))
@@ -318,6 +319,7 @@ impl Arch for ArchMips {
elf::R_MIPS_GOT16 => Some("R_MIPS_GOT16"),
elf::R_MIPS_PC16 => Some("R_MIPS_PC16"),
elf::R_MIPS_CALL16 => Some("R_MIPS_CALL16"),
elf::R_MIPS_GPREL32 => Some("R_MIPS_GPREL32"),
R_MIPS15_S3 => Some("R_MIPS15_S3"),
_ => None,
},