| 147 | }; |
| 148 | |
| 149 | static const char* GetRelocationString(MachoPpcRelocationType relocType) |
| 150 | { |
| 151 | static const char* relocTable[] = |
| 152 | { |
| 153 | "PPC_RELOC_VANILLA", |
| 154 | "PPC_RELOC_PAIR", |
| 155 | "PPC_RELOC_BR14", |
| 156 | "PPC_RELOC_BR24", |
| 157 | "PPC_RELOC_HI16", |
| 158 | "PPC_RELOC_LO16", |
| 159 | "PPC_RELOC_HA16", |
| 160 | "PPC_RELOC_LO14", |
| 161 | "PPC_RELOC_SECTDIFF", |
| 162 | "PPC_RELOC_PB_LA_PTR", |
| 163 | "PPC_RELOC_HI16_SECTDIFF", |
| 164 | "PPC_RELOC_LO16_SECTDIFF", |
| 165 | "PPC_RELOC_HA16_SECTDIFF", |
| 166 | "PPC_RELOC_JBSR", |
| 167 | "PPC_RELOC_LO14_SECTDIFF", |
| 168 | "PPC_RELOC_LOCAL_SECTDIFF" |
| 169 | }; |
| 170 | if (relocType >= PPC_RELOC_VANILLA && relocType < MAX_MACHO_PPC_RELOCATION) |
| 171 | return relocTable[relocType]; |
| 172 | return "Unknown PPC relocation"; |
| 173 | } |
| 174 | |
| 175 | #define HA(x) (uint16_t)((((x) >> 16) + (((x) & 0x8000) ? 1 : 0)) & 0xffff) |
| 176 |
no test coverage detected