mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-28 17:11:11 -09:00
Merge branch 'GP-3259_ryanmkurtz_macho-ppc'
This commit is contained in:
@@ -1209,6 +1209,11 @@ public class MachoProgramBuilder {
|
|||||||
private void performRelocations(LinkedHashMap<RelocationInfo, Address> relocationMap)
|
private void performRelocations(LinkedHashMap<RelocationInfo, Address> relocationMap)
|
||||||
throws CancelledException {
|
throws CancelledException {
|
||||||
MachoRelocationHandler handler = MachoRelocationHandlerFactory.getHandler(machoHeader);
|
MachoRelocationHandler handler = MachoRelocationHandlerFactory.getHandler(machoHeader);
|
||||||
|
if (handler == null) {
|
||||||
|
log.appendMsg(String.format("No relocation handler for machine type 0x%x",
|
||||||
|
machoHeader.getCpuType()));
|
||||||
|
}
|
||||||
|
|
||||||
Iterator<RelocationInfo> iter = relocationMap.keySet().iterator();
|
Iterator<RelocationInfo> iter = relocationMap.keySet().iterator();
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
RelocationInfo relocationInfo = iter.next();
|
RelocationInfo relocationInfo = iter.next();
|
||||||
@@ -1216,12 +1221,7 @@ public class MachoProgramBuilder {
|
|||||||
MachoRelocation relocation = null;
|
MachoRelocation relocation = null;
|
||||||
|
|
||||||
RelocationResult result = RelocationResult.FAILURE;
|
RelocationResult result = RelocationResult.FAILURE;
|
||||||
if (handler == null) {
|
if (handler != null) {
|
||||||
handleRelocationError(address, String.format(
|
|
||||||
"No relocation handler for machine type 0x%x to process relocation at %s with type 0x%x",
|
|
||||||
machoHeader.getCpuType(), address, relocationInfo.getType()));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
relocation = handler.isPairedRelocation(relocationInfo)
|
relocation = handler.isPairedRelocation(relocationInfo)
|
||||||
? new MachoRelocation(program, machoHeader, address, relocationInfo,
|
? new MachoRelocation(program, machoHeader, address, relocationInfo,
|
||||||
iter.next())
|
iter.next())
|
||||||
@@ -1258,7 +1258,8 @@ public class MachoProgramBuilder {
|
|||||||
new long[] { relocationInfo.getValue(),
|
new long[] { relocationInfo.getValue(),
|
||||||
relocationInfo.getLength(), relocationInfo.isPcRelocated() ? 1 : 0,
|
relocationInfo.getLength(), relocationInfo.isPcRelocated() ? 1 : 0,
|
||||||
relocationInfo.isExternal() ? 1 : 0, relocationInfo.isScattered() ? 1 : 0 },
|
relocationInfo.isExternal() ? 1 : 0, relocationInfo.isScattered() ? 1 : 0 },
|
||||||
result.byteLength(), relocation.getTargetDescription());
|
result.byteLength(),
|
||||||
|
relocation != null ? relocation.getTargetDescription() : null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user