dyld: handle rebind on symbols relocated by CALL_PLT

This commit is contained in:
occheung 2022-06-01 12:33:40 +08:00 committed by Sébastien Bourdeauducq
parent 2cd43bf4f7
commit d924bfc958
1 changed files with 10 additions and 0 deletions

View File

@ -179,6 +179,16 @@ impl<'a> Library<'a> {
}
}
R_RISCV_CALL_PLT => {
let sym = self.symtab.get(ELF32_R_SYM(rela.r_info) as usize)
.ok_or("symbol out of bounds of symbol table")?;
let sym_name = self.name_starting_at(sym.st_name as usize)?;
if sym_name == name {
self.update_rela(rela, addr - (self.image_off + rela.r_offset))?
}
}
// No associated symbols for other relocation types.
_ => ()
}