(&self, flags: RelocationFlags)
| 60 | } |
| 61 | |
| 62 | fn reloc_size(&self, flags: RelocationFlags) -> Option<usize> { |
| 63 | match self.arch { |
| 64 | Architecture::X86 => match flags { |
| 65 | RelocationFlags::Coff(typ) => match typ { |
| 66 | pe::IMAGE_REL_I386_DIR16 | pe::IMAGE_REL_I386_REL16 => Some(2), |
| 67 | pe::IMAGE_REL_I386_DIR32 | pe::IMAGE_REL_I386_REL32 => Some(4), |
| 68 | _ => None, |
| 69 | }, |
| 70 | RelocationFlags::Elf(typ) => match typ { |
| 71 | elf::R_386_32 |
| 72 | | elf::R_386_PC32 |
| 73 | | elf::R_386_GOT32 |
| 74 | | elf::R_386_PLT32 |
| 75 | | elf::R_386_GOTOFF |
| 76 | | elf::R_386_GOTPC => Some(4), |
| 77 | elf::R_386_16 => Some(2), |
| 78 | _ => None, |
| 79 | }, |
| 80 | }, |
| 81 | Architecture::X86_64 => match flags { |
| 82 | RelocationFlags::Coff(typ) => match typ { |
| 83 | pe::IMAGE_REL_AMD64_ADDR32NB | pe::IMAGE_REL_AMD64_REL32 => Some(4), |
| 84 | pe::IMAGE_REL_AMD64_ADDR64 => Some(8), |
| 85 | _ => None, |
| 86 | }, |
| 87 | RelocationFlags::Elf(typ) => match typ { |
| 88 | elf::R_X86_64_PC32 => Some(4), |
| 89 | elf::R_X86_64_64 => Some(8), |
| 90 | _ => None, |
| 91 | }, |
| 92 | }, |
| 93 | } |
| 94 | } |
| 95 | } |
| 96 | |
| 97 | impl Arch for ArchX86 { |
no outgoing calls
no test coverage detected