| 87 | } |
| 88 | |
| 89 | fn find_reloc_arg( |
| 90 | &self, |
| 91 | ins: &powerpc::ParsedIns, |
| 92 | resolved: Option<ResolvedRelocation>, |
| 93 | ) -> Option<usize> { |
| 94 | match resolved?.relocation.flags { |
| 95 | RelocationFlags::Elf(elf::R_PPC_EMB_SDA21) => Some(1), |
| 96 | RelocationFlags::Elf(elf::R_PPC_REL24 | elf::R_PPC_REL14) |
| 97 | | RelocationFlags::Coff(pe::IMAGE_REL_PPC_REL24 | pe::IMAGE_REL_PPC_REL14) => { |
| 98 | ins.args.iter().rposition(is_relative_arg) |
| 99 | } |
| 100 | RelocationFlags::Elf( |
| 101 | elf::R_PPC_ADDR16_HI | elf::R_PPC_ADDR16_HA | elf::R_PPC_ADDR16_LO, |
| 102 | ) |
| 103 | | RelocationFlags::Coff(pe::IMAGE_REL_PPC_REFHI | pe::IMAGE_REL_PPC_REFLO) => { |
| 104 | ins.args.iter().rposition(is_rel_abs_arg) |
| 105 | } |
| 106 | RelocationFlags::Elf(elf::R_PPC64_TOC16) => ins.args.iter().rposition(is_offset_arg), |
| 107 | _ => None, |
| 108 | } |
| 109 | } |
| 110 | } |
| 111 | |
| 112 | impl Arch for ArchPpc { |