You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Relocation section '.rel.dyn' at offset 0x818 contains 3 entries:
Offset Info Type Symbol's Value Symbol's Name
0000000000000000 0000000000000000 R_MIPS_NONE
Type2: R_MIPS_NONE
Type3: R_MIPS_NONE
0000000000011000 0000000000001203 R_MIPS_REL32
Type2: R_MIPS_64
Type3: R_MIPS_NONE
00000000000110d0 0000000000001203 R_MIPS_REL32
Type2: R_MIPS_64
Type3: R_MIPS_NONE
However when parsing these relocations in max_relocation_index: idx = std::max(idx, static_cast<uint32_t>(reloc_entry->r_info >> shift));
This results in an idx of 51511296
And therefore:
- Number of symbols counted: 51511297
- Table Offset: 0x530
- String Table Offset: 0x6b0
So it try to read 51511297 symbols, which is incorrect and results in a parsing error till EOF is reached. (Also many Symbol's name #16 is empty! like logs).
There are also relocation parsing error logs: Unable to find the symbol associated with the relocation (idx: 51511296) 11000 MIPS_NONE 0 0 3120000 DYNAMIC
Not sure exactly how to fix this, elf-utils also has hard time parsing it:
Relocation section [10] '.rel.dyn' at offset 0x818 contains 3 entries:
Offset Type Value Name
000000000000000000 <INVALID RELOC> 000000000000000000
0x0000000000011000 <INVALID RELOC> <INVALID SYMBOL 51511296>
0x00000000000110d0 <INVALID RELOC> <INVALID SYMBOL 51511296>
I think when parsing reloc_entry->r_info we should consider R_MIPS_REL32 types in a special way.
The text was updated successfully, but these errors were encountered:
Describe the bug
I have the following test ELF file:
Which is compiled to MIPS platform:
test-mips-64bit-le-lib.zip
This has the following relocation section:
However when parsing these relocations in
max_relocation_index
:idx = std::max(idx, static_cast<uint32_t>(reloc_entry->r_info >> shift));
This results in an idx of 51511296
And therefore:
So it try to read 51511297 symbols, which is incorrect and results in a parsing error till EOF is reached. (Also many
Symbol's name #16 is empty!
like logs).There are also relocation parsing error logs:
Unable to find the symbol associated with the relocation (idx: 51511296) 11000 MIPS_NONE 0 0 3120000 DYNAMIC
Not sure exactly how to fix this, elf-utils also has hard time parsing it:
I think when parsing
reloc_entry->r_info
we should considerR_MIPS_REL32
types in a special way.The text was updated successfully, but these errors were encountered: