Fix some compiler warnings.

This commit is contained in:
James Benton 2019-10-02 20:44:49 +01:00
parent 088a2ca0ed
commit dc715cfb81
4 changed files with 4 additions and 10 deletions

View File

@ -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);
}

View File

@ -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;

View File

@ -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();

View File

@ -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<Option> options, Program program,
TaskMonitor monitor, MessageLog log) throws IOException {
try {
GenericFactory factory = MessageLogContinuesFactory.create(log);
byte[] data = RplConverter.convertRpl(provider, monitor);
RplHeader rpl = RplHeader.createRplHeader(factory, new ByteArrayProvider(data));
ElfProgramBuilder.loadElf((ElfHeader)rpl, program, options, log, monitor);
ElfProgramBuilder.loadElf(rpl, program, options, log, monitor);
} catch (ElfException e) {
throw new IOException(e.getMessage());
} catch (CancelledException e) {