mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-28 17:11:11 -09:00
GP-3110 fixing minor compilation issues and certification
This commit is contained in:
@@ -14,3 +14,5 @@ data/languages/tricore.sinc||GHIDRA||||END|
|
|||||||
data/languages/tricore.slaspec||GHIDRA||||END|
|
data/languages/tricore.slaspec||GHIDRA||||END|
|
||||||
data/manuals/tricore.idx||GHIDRA||||END|
|
data/manuals/tricore.idx||GHIDRA||||END|
|
||||||
data/manuals/tricore2.idx||GHIDRA||||END|
|
data/manuals/tricore2.idx||GHIDRA||||END|
|
||||||
|
data/patterns/patternconstraints.xml||GHIDRA||||END|
|
||||||
|
data/patterns/tricore_patterns.xml||GHIDRA||||END|
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* 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.mem.MemoryAccessException;
|
||||||
import ghidra.program.model.reloc.RelocationResult;
|
import ghidra.program.model.reloc.RelocationResult;
|
||||||
import ghidra.program.model.reloc.Relocation.Status;
|
import ghidra.program.model.reloc.Relocation.Status;
|
||||||
import ghidra.util.Msg;
|
|
||||||
import ghidra.util.exception.NotFoundException;
|
import ghidra.util.exception.NotFoundException;
|
||||||
|
|
||||||
public class Tricore_ElfRelocationHandler
|
public class Tricore_ElfRelocationHandler
|
||||||
@@ -52,22 +51,10 @@ public class Tricore_ElfRelocationHandler
|
|||||||
Program program = elfRelocationContext.getProgram();
|
Program program = elfRelocationContext.getProgram();
|
||||||
Memory memory = program.getMemory();
|
Memory memory = program.getMemory();
|
||||||
|
|
||||||
if (R_TRICORE_NONE == type) {
|
|
||||||
return RelocationResult.SKIPPED;
|
|
||||||
}
|
|
||||||
|
|
||||||
long addend = relocation.hasAddend() ? relocation.getAddend() : memory.getInt(relocationAddress);
|
long addend = relocation.hasAddend() ? relocation.getAddend() : memory.getInt(relocationAddress);
|
||||||
long offset = relocationAddress.getOffset();
|
long offset = relocationAddress.getOffset();
|
||||||
int symbolIndex = relocation.getSymbolIndex();
|
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;
|
long rv = 0;
|
||||||
int byteLength = -1;
|
int byteLength = -1;
|
||||||
|
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* 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 {
|
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_NONE(0), // none none
|
||||||
R_TRICORE_32REL(1), // word32 S + A - P
|
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_S2(78), // SMALL DATA Baseregister operand 2
|
||||||
R_TRICORE_SBREG_S1(79), // SMALL DATA Baseregister operand 1
|
R_TRICORE_SBREG_S1(79), // SMALL DATA Baseregister operand 1
|
||||||
R_TRICORE_SBREG_D(80); // SMALL DATA Baseregister destination
|
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;
|
public final int typeId;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user