GP-3110 fixing minor compilation issues and certification

This commit is contained in:
emteere
2024-03-07 11:16:42 -05:00
parent 59d8eefad1
commit 902bcb69a2
3 changed files with 16 additions and 26 deletions

View File

@@ -14,3 +14,5 @@ data/languages/tricore.sinc||GHIDRA||||END|
data/languages/tricore.slaspec||GHIDRA||||END|
data/manuals/tricore.idx||GHIDRA||||END|
data/manuals/tricore2.idx||GHIDRA||||END|
data/patterns/patternconstraints.xml||GHIDRA||||END|
data/patterns/tricore_patterns.xml||GHIDRA||||END|

View File

@@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -25,7 +25,6 @@ import ghidra.program.model.mem.Memory;
import ghidra.program.model.mem.MemoryAccessException;
import ghidra.program.model.reloc.RelocationResult;
import ghidra.program.model.reloc.Relocation.Status;
import ghidra.util.Msg;
import ghidra.util.exception.NotFoundException;
public class Tricore_ElfRelocationHandler
@@ -52,22 +51,10 @@ public class Tricore_ElfRelocationHandler
Program program = elfRelocationContext.getProgram();
Memory memory = program.getMemory();
if (R_TRICORE_NONE == type) {
return RelocationResult.SKIPPED;
}
long addend = relocation.hasAddend() ? relocation.getAddend() : memory.getInt(relocationAddress);
long offset = relocationAddress.getOffset();
int symbolIndex = relocation.getSymbolIndex();
long symbolValue = 0;
String symbolName = null;
ElfSymbol symbol = elfRelocationContext.getSymbol(symbolIndex);
if (symbol != null) {
symbolValue = elfRelocationContext.getSymbolValue(symbol);
symbolName = symbol.getNameAsString();
}
long rv = 0;
int byteLength = -1;

View File

@@ -4,9 +4,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -17,15 +17,6 @@ package ghidra.app.util.bin.format.elf.relocation;
public enum Tricore_ElfRelocationType implements ElfRelocationType {
// e_flags Identifying TriCore/PCP Derivatives
public static final int EF_TRICORE_V1_1 = 0x80000000;
public static final int EF_TRICORE_V1_2 = 0x40000000;
public static final int EF_TRICORE_V1_3 = 0x20000000;
public static final int EF_TRICORE_PCP2 = 0x02000000;
// TriCore Section Attribute Flags
public static final int SHF_TRICORE_ABS = 0x400;
public static final int SHF_TRICORE_NOREAD = 0x800;
R_TRICORE_NONE(0), // none none
R_TRICORE_32REL(1), // word32 S + A - P
@@ -137,6 +128,16 @@ public enum Tricore_ElfRelocationType implements ElfRelocationType {
R_TRICORE_SBREG_S2(78), // SMALL DATA Baseregister operand 2
R_TRICORE_SBREG_S1(79), // SMALL DATA Baseregister operand 1
R_TRICORE_SBREG_D(80); // SMALL DATA Baseregister destination
// e_flags Identifying TriCore/PCP Derivatives
public static final int EF_TRICORE_V1_1 = 0x80000000;
public static final int EF_TRICORE_V1_2 = 0x40000000;
public static final int EF_TRICORE_V1_3 = 0x20000000;
public static final int EF_TRICORE_PCP2 = 0x02000000;
// TriCore Section Attribute Flags
public static final int SHF_TRICORE_ABS = 0x400;
public static final int SHF_TRICORE_NOREAD = 0x800;
public final int typeId;