Skip to content

Commit eb5b018

Browse files
committed
elfload: Fix issue with loading non PROGBITS during section loading
During elf section loading the loader loads non program sections by anding with SHT_PROGBITS(0x1). Change the and to an equals to make it correct. We need to change this to actual load using program headers, but I will do that in the next few patches.
1 parent 5acb27d commit eb5b018

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

cpu/common/parse.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -670,12 +670,11 @@ readfile_elf (char *filename)
670670
}
671671
}
672672

673-
674673
for (i = 0, elf_spnt = elf_shdata; i < ELF_SHORT_H (elfhdr.e_shnum);
675674
i++, elf_spnt++)
676675
{
677676

678-
if ((ELF_LONG_H (elf_spnt->sh_type) & SHT_PROGBITS)
677+
if ((ELF_LONG_H (elf_spnt->sh_type) == SHT_PROGBITS)
679678
&& (ELF_LONG_H (elf_spnt->sh_flags) & SHF_ALLOC))
680679
{
681680

0 commit comments

Comments
 (0)