mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-09-28 17:11:11 -09:00
GP-4228 Corrected X86-64 ELF GOT allocation for object module import for
R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX relocations
This commit is contained in:
@@ -113,6 +113,7 @@ class X86_64_ElfRelocationContext extends ElfRelocationContext {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean requiresGotEntry(ElfRelocation r) {
|
private boolean requiresGotEntry(ElfRelocation r) {
|
||||||
|
|
||||||
switch (r.getType()) {
|
switch (r.getType()) {
|
||||||
case X86_64_ElfRelocationConstants.R_X86_64_GOTPCREL:
|
case X86_64_ElfRelocationConstants.R_X86_64_GOTPCREL:
|
||||||
// case X86_64_ElfRelocationConstants.R_X86_64_GOTOFF64:
|
// case X86_64_ElfRelocationConstants.R_X86_64_GOTOFF64:
|
||||||
@@ -120,8 +121,11 @@ class X86_64_ElfRelocationContext extends ElfRelocationContext {
|
|||||||
// case X86_64_ElfRelocationConstants.R_X86_64_GOT64:
|
// case X86_64_ElfRelocationConstants.R_X86_64_GOT64:
|
||||||
case X86_64_ElfRelocationConstants.R_X86_64_GOTPCREL64:
|
case X86_64_ElfRelocationConstants.R_X86_64_GOTPCREL64:
|
||||||
// case X86_64_ElfRelocationConstants.R_X86_64_GOTPC64:
|
// case X86_64_ElfRelocationConstants.R_X86_64_GOTPC64:
|
||||||
// case X86_64_ElfRelocationConstants.R_X86_64_GOTPCRELX:
|
return true;
|
||||||
// case X86_64_ElfRelocationConstants.R_X86_64_REX_GOTPCRELX:
|
case X86_64_ElfRelocationConstants.R_X86_64_GOTPCRELX:
|
||||||
|
case X86_64_ElfRelocationConstants.R_X86_64_REX_GOTPCRELX:
|
||||||
|
// NOTE: Relocation may not actually require GOT entry in which case %got
|
||||||
|
// may be over-allocated, but is required in some cases.
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user