mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 10:49:34 +02:00
GP-2098 .bss sections don't need valid file offsets
The ELF loader incorrectly skips NOBITS sections that have invalid file offsets, like .bss; however, the file offset is ignored for NOBITS sections. This is essentially applying #2136 to the file offset as well.
This commit is contained in:
parent
f718ff9f6f
commit
31f65b4607
1 changed files with 2 additions and 1 deletions
|
@ -2996,7 +2996,8 @@ class ElfProgramBuilder extends MemorySectionResolver implements ElfLoadHelper {
|
|||
if (type != ElfSectionHeaderConstants.SHT_NULL &&
|
||||
(includeOtherBlocks || elfSectionToLoad.isAlloc())) {
|
||||
long fileOffset = elfSectionToLoad.getOffset();
|
||||
if (fileOffset < 0 || fileOffset >= fileBytes.getSize()) {
|
||||
if (type != ElfSectionHeaderConstants.SHT_NOBITS &&
|
||||
(fileOffset < 0 || fileOffset >= fileBytes.getSize())) {
|
||||
log("Skipping section [" + elfSectionToLoad.getNameAsString() +
|
||||
"] with invalid file offset");
|
||||
continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue