Class ElfRelocationHandler
- java.lang.Object
-
- ghidra.app.util.bin.format.elf.relocation.ElfRelocationHandler
-
- All Implemented Interfaces:
ExtensionPoint
public abstract class ElfRelocationHandler extends java.lang.Object implements ExtensionPoint
ElfRelocationHandler
provides the base class for processor specific ELF relocation handlers.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface ghidra.util.classfinder.ExtensionPoint
ExtensionPoint.Exclude, ExtensionPoint.Util
-
-
Constructor Summary
Constructors Constructor Description ElfRelocationHandler()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract boolean
canRelocate(ElfHeader elf)
ElfRelocationContext
createRelocationContext(ElfLoadHelper loadHelper, ElfRelocationTable relocationTable, java.util.Map<ElfSymbol,Address> symbolMap)
Relocation context for a specific Elf image and relocation table.static void
markAsError(Program program, Address relocationAddress, long type, java.lang.String symbolName, java.lang.String msg, MessageLog log)
Generate error log entry and bookmark at relocationAddress where import failed to be applied.static void
markAsError(Program program, Address relocationAddress, java.lang.String type, java.lang.String symbolName, java.lang.String msg, MessageLog log)
Generate error log entry and bookmark at relocationAddress where import failed to be applied.static void
markAsUnhandled(Program program, Address relocationAddress, long type, long symbolIndex, java.lang.String symbolName, MessageLog log)
Generate error log entry and bookmark at relocationAddress indicating an unhandled relocation.static void
markAsUninitializedMemory(Program program, Address relocationAddress, long type, long symbolIndex, java.lang.String symbolName, MessageLog log)
Generate error log entry and bookmark at relocationAddress where import failed to transition block to initialized while processing relocation.static void
markAsWarning(Program program, Address relocationAddress, java.lang.String type, java.lang.String symbolName, long symbolIndex, java.lang.String msg, MessageLog log)
Generate warning log entry and bookmark at relocationAddress where import issue occurred.static void
markAsWarning(Program program, Address relocationAddress, java.lang.String type, java.lang.String msg, MessageLog log)
Generate warning log entry and bookmark at relocationAddress where import issue occurred.abstract void
relocate(ElfRelocationContext elfRelocationContext, ElfRelocation relocation, Address relocationAddress)
Perform relocation fixup
-
-
-
Method Detail
-
canRelocate
public abstract boolean canRelocate(ElfHeader elf)
-
createRelocationContext
public ElfRelocationContext createRelocationContext(ElfLoadHelper loadHelper, ElfRelocationTable relocationTable, java.util.Map<ElfSymbol,Address> symbolMap)
Relocation context for a specific Elf image and relocation table. The relocation context is used to process relocations and manage any data required to process relocations.- Parameters:
loadHelper
- Elf load helperrelocationTable
- Elf relocation tablesymbolMap
- Elf symbol placement map
-
relocate
public abstract void relocate(ElfRelocationContext elfRelocationContext, ElfRelocation relocation, Address relocationAddress) throws MemoryAccessException, NotFoundException
Perform relocation fixup- Parameters:
elfRelocationContext
- relocation contextrelocation
- ELF relocationrelocationAddress
- relocation target address (fixup location)- Throws:
MemoryAccessException
- memory access failureNotFoundException
- required relocation data not found
-
markAsUnhandled
public static void markAsUnhandled(Program program, Address relocationAddress, long type, long symbolIndex, java.lang.String symbolName, MessageLog log)
Generate error log entry and bookmark at relocationAddress indicating an unhandled relocation.- Parameters:
program
-relocationAddress
- relocation address to be bookmarkedtype
- relocation typesymbolIndex
- associated symbol index within symbol tablesymbolName
- associated symbol namelog
- import log
-
markAsUninitializedMemory
public static void markAsUninitializedMemory(Program program, Address relocationAddress, long type, long symbolIndex, java.lang.String symbolName, MessageLog log)
Generate error log entry and bookmark at relocationAddress where import failed to transition block to initialized while processing relocation.- Parameters:
program
-relocationAddress
- relocation address to be bookmarkedtype
- relocation typesymbolIndex
- associated symbol index within symbol tablesymbolName
- associated symbol namelog
- import log
-
markAsError
public static void markAsError(Program program, Address relocationAddress, long type, java.lang.String symbolName, java.lang.String msg, MessageLog log)
Generate error log entry and bookmark at relocationAddress where import failed to be applied.- Parameters:
program
-relocationAddress
- relocation address to be bookmarkedtype
- relocation typesymbolName
- associated symbol namelog
- import log
-
markAsError
public static void markAsError(Program program, Address relocationAddress, java.lang.String type, java.lang.String symbolName, java.lang.String msg, MessageLog log)
Generate error log entry and bookmark at relocationAddress where import failed to be applied.- Parameters:
program
-relocationAddress
- relocation address to be bookmarkedtype
- relocation typesymbolName
- associated symbol namemsg
- additional error messagelog
- import log
-
markAsWarning
public static void markAsWarning(Program program, Address relocationAddress, java.lang.String type, java.lang.String msg, MessageLog log)
Generate warning log entry and bookmark at relocationAddress where import issue occurred.- Parameters:
program
-relocationAddress
- relocation address to be bookmarkedtype
- relocation typemsg
- message associated with warninglog
- import log
-
markAsWarning
public static void markAsWarning(Program program, Address relocationAddress, java.lang.String type, java.lang.String symbolName, long symbolIndex, java.lang.String msg, MessageLog log)
Generate warning log entry and bookmark at relocationAddress where import issue occurred.- Parameters:
program
-relocationAddress
- relocation address to be bookmarkedtype
- relocation typesymbolName
- symbol namesymbolIndex
- symbol indexmsg
- message associated with warninglog
- import log
-
-