GT-2845 - updated ELF Loader to utilize FileBytes and eliminated its use

of MemoryBlockUtil

Conflicts:
	Ghidra/Features/Base/src/main/java/ghidra/app/util/opinion/ElfLoader.java
This commit is contained in:
ghidra1
2019-07-15 17:55:25 -04:00
committed by Ryan Kurtz
parent 7b5b1fb542
commit 12af9291c9
8 changed files with 82 additions and 98 deletions
@@ -15,16 +15,17 @@
*/
package ghidra.app.util.bin.format.elf.relocation;
import ghidra.app.util.MemoryBlockUtils;
import ghidra.app.util.bin.StructConverter;
import ghidra.app.util.bin.format.elf.*;
import ghidra.program.model.address.*;
import ghidra.program.model.address.Address;
import ghidra.program.model.address.AddressSpace;
import ghidra.program.model.listing.Listing;
import ghidra.program.model.listing.Program;
import ghidra.program.model.mem.Memory;
import ghidra.program.model.mem.MemoryAccessException;
import ghidra.program.model.util.CodeUnitInsertionException;
import ghidra.util.exception.NotFoundException;
import ghidra.util.task.TaskMonitor;
public class AVR32_ElfRelocationHandler extends ElfRelocationHandler {
@@ -144,18 +145,10 @@ public class AVR32_ElfRelocationHandler extends ElfRelocationHandler {
newSectionTypeBuff.append("Global External Function");
}
ElfLoadHelper loadHelper = elfRelocationContext.getLoadHelper();
try {
loadHelper.getMemoryBlockUtil().createInitializedBlock(
newSectionNameBuff.toString(), currNewAddress, null,
currElfSymbolSize, newSectionTypeBuff.toString(), null,
isReadable, // Readable
isWritable, // Not Writable
isExecutable, // Executable
TaskMonitor.DUMMY);
}
catch (AddressOverflowException e) {
loadHelper.log(e.getMessage());
}
MemoryBlockUtils.createInitializedBlock(program, false,
newSectionNameBuff.toString(), currNewAddress, currElfSymbolSize,
newSectionTypeBuff.toString(), "AVR32-ELF Loader", isReadable,
isWritable, isExecutable, loadHelper.getLog());
}
}
try {