Merge remote-tracking branch

'origin/GP-5413_ghidra1_x86ElfGotAllocError' into patch (Closes #7525)
This commit is contained in:
Ryan Kurtz 2025-02-25 06:59:05 -05:00
commit de95e7e4a9
2 changed files with 11 additions and 8 deletions

View file

@ -23,16 +23,14 @@ import ghidra.app.util.bin.format.elf.extend.MIPS_ElfExtension;
import ghidra.app.util.bin.format.elf.relocation.MIPS_ElfRelocationHandler.MIPS_DeferredRelocation; import ghidra.app.util.bin.format.elf.relocation.MIPS_ElfRelocationHandler.MIPS_DeferredRelocation;
import ghidra.program.model.address.*; import ghidra.program.model.address.*;
import ghidra.program.model.data.PointerDataType; import ghidra.program.model.data.PointerDataType;
import ghidra.program.model.listing.BookmarkType;
import ghidra.program.model.mem.MemoryAccessException; import ghidra.program.model.mem.MemoryAccessException;
import ghidra.program.model.mem.MemoryBlock; import ghidra.program.model.mem.MemoryBlock;
import ghidra.program.model.reloc.RelocationResult;
import ghidra.program.model.reloc.Relocation.Status; import ghidra.program.model.reloc.Relocation.Status;
import ghidra.program.model.reloc.RelocationResult;
import ghidra.program.model.symbol.Symbol; import ghidra.program.model.symbol.Symbol;
import ghidra.program.model.symbol.SymbolUtilities; import ghidra.program.model.symbol.SymbolUtilities;
import ghidra.util.*; import ghidra.util.*;
import ghidra.util.exception.AssertException; import ghidra.util.exception.AssertException;
import ghidra.util.exception.NotFoundException;
/** /**
* {@link MIPS_ElfRelocationContext} provides extended relocation context with the ability * {@link MIPS_ElfRelocationContext} provides extended relocation context with the ability

View file

@ -24,7 +24,8 @@ import ghidra.program.model.data.PointerDataType;
import ghidra.program.model.mem.MemoryAccessException; import ghidra.program.model.mem.MemoryAccessException;
import ghidra.program.model.mem.MemoryBlock; import ghidra.program.model.mem.MemoryBlock;
import ghidra.util.*; import ghidra.util.*;
import ghidra.util.exception.*; import ghidra.util.exception.InvalidInputException;
import ghidra.util.exception.NotFoundException;
/** /**
* <code>X86_64_ElfRelocationContext</code> provides ability to generate a * <code>X86_64_ElfRelocationContext</code> provides ability to generate a
@ -160,7 +161,9 @@ class X86_64_ElfRelocationContext extends ElfRelocationContext<X86_64_ElfRelocat
} }
if (gotElfSymbol != null && gotElfSymbol.getValue() != 0) { if (gotElfSymbol != null && gotElfSymbol.getValue() != 0) {
throw new AssertException(ElfConstants.GOT_SYMBOL_NAME + " already allocated"); loadHelper
.log("GOT allocatiom failed. " + ElfConstants.GOT_SYMBOL_NAME + " already defined");
return null;
} }
int alignment = getLoadAdapter().getLinkageBlockAlignment(); int alignment = getLoadAdapter().getLinkageBlockAlignment();
@ -283,7 +286,9 @@ class X86_64_ElfRelocationContext extends ElfRelocationContext<X86_64_ElfRelocat
} }
} }
catch (MemoryAccessException e) { catch (MemoryAccessException e) {
throw new AssertException(e); // unexpected String msg = "Failed to create GOT at " + allocatedGotAddress;
loadHelper.log(msg);
Msg.error(this, msg, e);
} }
} }