When we have a dynamic relocation with a broken symbol's st_name,
tools report a useless error: "Invalid data was encountered while parsing the file".
After this change we report a warning + "<corrupt>" as a symbol name.
Differential D66734
[llvm-readobj/llvm-readelf] - Report a proper warning when dumping a broken dynamic relocation. Authored by grimar on Aug 26 2019, 5:08 AM.
Details When we have a dynamic relocation with a broken symbol's st_name, After this change we report a warning + "<corrupt>" as a symbol name.
Diff Detail Event Timeline
Comment Actions
Comment Actions
Comment Actions LGTM.
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
I think you want to replace utohextr(Offset) with PRIx32 to take advantage of createStringError's printf formatting rules:
return createStringError(object_error::parse_failed, "st_name (0x" PRIx32 ") is past the end of the string table" " of size 0x%zx", Offset, StrTab.size());