Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
marxin committed Jan 26, 2025
1 parent a888458 commit 5db6ad2
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions libwild/src/aarch64.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use crate::arch::Arch;
use crate::elf::extract_bits;
use crate::elf::BitRange;
use crate::elf::DynamicRelocationKind;
Expand Down Expand Up @@ -889,18 +890,14 @@ impl crate::arch::Relaxation for Relaxation {
// IFuncs cannot be referenced directly, they always need to go via the GOT.
if value_flags.contains(ValueFlags::IFUNC) {
return match relocation_kind {
object::elf::R_AARCH64_CALL26 => Some(Self {
kind: RelaxationKind::NoOp,
// TODO: reuse
rel_info: RelocationKindInfo {
kind: RelocationKind::PltRelative,
size: RelocationSize::BitMasking {
range: BitRange { start: 2, end: 28 },
insn: RelocationInstruction::JumpCall,
},
mask: None,
},
}),
rel @ object::elf::R_AARCH64_CALL26 => {
let mut relocation = AArch64::relocation_from_raw(rel).unwrap();
relocation.kind = RelocationKind::PltRelative;
return Some(Relaxation {
kind: RelaxationKind::NoOp,
rel_info: relocation,
});
}
_ => None,
};
}
Expand Down

0 comments on commit 5db6ad2

Please sign in to comment.