Skip to content

Ghidra is a software reverse engineering (SRE) framework

GP-3110 fixing minor compilation issues and certification

emteere902bcb69a24b
diff --git a/Ghidra/Processors/tricore/certification.manifest b/Ghidra/Processors/tricore/certification.manifest
index 9f9ba7efa0..369942d44e 100644
--- a/Ghidra/Processors/tricore/certification.manifest
+++ b/Ghidra/Processors/tricore/certification.manifest
@@ -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|
diff --git a/Ghidra/Processors/tricore/src/main/java/ghidra/app/util/bin/format/elf/relocation/Tricore_ElfRelocationHandler.java b/Ghidra/Processors/tricore/src/main/java/ghidra/app/util/bin/format/elf/relocation/Tricore_ElfRelocationHandler.java
index d47cc1f7a4..bf66e90f25 100644
--- a/Ghidra/Processors/tricore/src/main/java/ghidra/app/util/bin/format/elf/relocation/Tricore_ElfRelocationHandler.java
+++ b/Ghidra/Processors/tricore/src/main/java/ghidra/app/util/bin/format/elf/relocation/Tricore_ElfRelocationHandler.java
@@ -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;
diff --git a/Ghidra/Processors/tricore/src/main/java/ghidra/app/util/bin/format/elf/relocation/Tricore_ElfRelocationType.java b/Ghidra/Processors/tricore/src/main/java/ghidra/app/util/bin/format/elf/relocation/Tricore_ElfRelocationType.java
index 688e3e3b5a..e7b87d4e9f 100644
--- a/Ghidra/Processors/tricore/src/main/java/ghidra/app/util/bin/format/elf/relocation/Tricore_ElfRelocationType.java
+++ b/Ghidra/Processors/tricore/src/main/java/ghidra/app/util/bin/format/elf/relocation/Tricore_ElfRelocationType.java
@@ -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;