GP-2256 avoid ELF PLT disassembly when alternate instruction set exists

This commit is contained in:
ghidra1 2022-06-29 11:06:30 -04:00
parent 47cda95669
commit dd917fba7a

View file

@ -18,6 +18,7 @@ package ghidra.app.util.bin.format.elf;
import java.util.*;
import ghidra.app.cmd.refs.RemoveReferenceCmd;
import ghidra.app.util.PseudoDisassembler;
import ghidra.program.disassemble.Disassembler;
import ghidra.program.model.address.*;
import ghidra.program.model.data.*;
@ -470,10 +471,13 @@ public class ElfDefaultGotPltMarkup {
TaskMonitor monitor) throws CancelledException {
try {
// Disassemble section.
// Disassemble PLT section.
// Disassembly is only done so we can see all instructions since many
// of them are unreachable after applying relocations
disassemble(minAddress, maxAddress, program, monitor);
// of them are unreachable after applying relocations. Avoid disassembly
// when alternate instruction sets exist.
if (!PseudoDisassembler.hasLowBitCodeModeInAddrValues(program)) {
disassemble(minAddress, maxAddress, program, monitor);
}
// Any symbols in the linkage section should be converted to External function thunks
// This can be seen with ARM Android examples.