Compare commits

...

1 Commits

Author SHA1 Message Date
23a37fdfda nac3ld: discard NONE relocations 2025-03-21 16:21:53 +08:00

View File

@ -228,6 +228,11 @@ impl<'a> Linker<'a> {
} }
for reloc in relocs { for reloc in relocs {
// Skip NONE type relocations. It is 0 across all targets.
if reloc.type_info() == 0 {
continue;
}
let sym = match reloc.sym_info() as usize { let sym = match reloc.sym_info() as usize {
STN_UNDEF => None, STN_UNDEF => None,
sym_index => { sym_index => {
@ -670,6 +675,9 @@ impl<'a> Linker<'a> {
} }
} }
// Discard NONE relocations
(Isa::CortexA9, R_ARM_NONE) | (Isa::RiscV32, R_RISCV_NONE) => (),
_ => { _ => {
println!("Relocation type 0x{:X?} is not supported", reloc.type_info()); println!("Relocation type 0x{:X?} is not supported", reloc.type_info());
unimplemented!() unimplemented!()