From dc715cfb81d490116e88acbfa256f8f9c4caa83f Mon Sep 17 00:00:00 2001 From: James Benton Date: Wed, 2 Oct 2019 20:44:49 +0100 Subject: [PATCH] Fix some compiler warnings. --- src/main/java/cafeloader/Cafe_ElfExtension.java | 6 ++---- src/main/java/cafeloader/Cafe_ElfRelocationHandler.java | 1 - src/main/java/cafeloader/RplConverter.java | 3 +-- src/main/java/ghidra/app/util/opinion/CafeLoader.java | 4 +--- 4 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/main/java/cafeloader/Cafe_ElfExtension.java b/src/main/java/cafeloader/Cafe_ElfExtension.java index 2893342..880bbb8 100644 --- a/src/main/java/cafeloader/Cafe_ElfExtension.java +++ b/src/main/java/cafeloader/Cafe_ElfExtension.java @@ -134,8 +134,6 @@ public class Cafe_ElfExtension extends ElfExtension { private void processRplExports(ElfLoadHelper elfLoadHelper, ElfSectionHeader sectionHeader) { String sectionName = sectionHeader.getNameAsString(); - Address loadAddress = elfLoadHelper.findLoadAddress(sectionHeader, 0); - Memory memory = elfLoadHelper.getProgram().getMemory(); boolean isDataExports = sectionName.contentEquals(".dexports"); if (!isDataExports) { // Function exports are already in symbol table @@ -148,11 +146,11 @@ public class Cafe_ElfExtension extends ElfExtension { try { int count = reader.readNextInt(); - int signature = reader.readNextInt(); + /* int signature = */ reader.readNextInt(); for (int i = 0; i < count; ++i) { int value = reader.readNextInt(); int nameOffset = reader.readNextInt(); - boolean isTlsExport = (nameOffset & 0x80000000) != 0; + /* boolean isTlsExport = (nameOffset & 0x80000000) != 0; */ String name = reader.readAsciiString(sectionHeader.getOffset() + (nameOffset & 0x7FFFFFFF)); elfLoadHelper.createSymbol(elfLoadHelper.getDefaultAddress(value), name, true, false, null); } diff --git a/src/main/java/cafeloader/Cafe_ElfRelocationHandler.java b/src/main/java/cafeloader/Cafe_ElfRelocationHandler.java index 737bc92..58f5d55 100644 --- a/src/main/java/cafeloader/Cafe_ElfRelocationHandler.java +++ b/src/main/java/cafeloader/Cafe_ElfRelocationHandler.java @@ -11,7 +11,6 @@ import ghidra.util.Msg; import ghidra.util.exception.InvalidInputException; import ghidra.util.exception.NotFoundException; import ghidra.program.model.symbol.ExternalLocation; -import ghidra.program.model.symbol.ExternalLocationIterator; import ghidra.program.model.symbol.RefType; import ghidra.program.model.symbol.SourceType; diff --git a/src/main/java/cafeloader/RplConverter.java b/src/main/java/cafeloader/RplConverter.java index 67c37f6..38f11b8 100644 --- a/src/main/java/cafeloader/RplConverter.java +++ b/src/main/java/cafeloader/RplConverter.java @@ -14,7 +14,6 @@ import ghidra.app.util.bin.format.elf.ElfException; import ghidra.app.util.bin.format.elf.ElfSectionHeader; import ghidra.app.util.bin.format.elf.ElfSectionHeaderConstants; import ghidra.app.util.bin.format.elf.RplSectionHeader; -import ghidra.util.exception.CancelledException; import ghidra.util.task.TaskMonitor; import ghidra.util.*; @@ -30,7 +29,7 @@ public class RplConverter { public static final byte ELFOSABI_VERSION_CAFE = (byte) 0xFE; public static byte[] convertRpl(ByteProvider byteProvider, TaskMonitor monitor) - throws ElfException, IOException, CancelledException, DataFormatException { + throws ElfException, IOException, DataFormatException { // Read elf header RplHeader elfHeader = RplHeader.createRplHeader(RethrowContinuesFactory.INSTANCE, byteProvider); BinaryReader reader = elfHeader.getReader(); diff --git a/src/main/java/ghidra/app/util/opinion/CafeLoader.java b/src/main/java/ghidra/app/util/opinion/CafeLoader.java index 60010ce..66a95f6 100644 --- a/src/main/java/ghidra/app/util/opinion/CafeLoader.java +++ b/src/main/java/ghidra/app/util/opinion/CafeLoader.java @@ -14,7 +14,6 @@ import ghidra.app.util.Option; import ghidra.app.util.bin.ByteArrayProvider; import ghidra.app.util.bin.ByteProvider; import ghidra.app.util.bin.format.elf.ElfException; -import ghidra.app.util.bin.format.elf.ElfHeader; import ghidra.app.util.importer.MessageLog; import ghidra.app.util.importer.MessageLogContinuesFactory; import ghidra.program.model.lang.LanguageCompilerSpecPair; @@ -54,12 +53,11 @@ public class CafeLoader extends ElfLoader { @Override public void load(ByteProvider provider, LoadSpec loadSpec, List