This is an archive of the discontinued LLVM Phabricator instance.

[llvm-readelf/obj] - Change the return type of the `createDRI(...)` to `Expected<>`
ClosedPublic

Authored by grimar on Aug 24 2020, 6:00 AM.

Details

Summary

This allows to get rid of "Invalid data was encountered while parsing the file"
error reported in cases when sh_size/sh_offset of sections are broken.

Diff Detail

Event Timeline

grimar created this revision.Aug 24 2020, 6:00 AM
Herald added a project: Restricted Project. · View Herald Transcript
grimar requested review of this revision.Aug 24 2020, 6:00 AM
MaskRay accepted this revision.Aug 24 2020, 11:09 AM

LGTM.

This revision is now accepted and ready to land.Aug 24 2020, 11:09 AM
jhenderson accepted this revision.Aug 25 2020, 12:17 AM

LGTM.

llvm/test/tools/llvm-readobj/ELF/dyn-symbols.test
579

Not related to this patch, but the inconsistency of where this warning is reported in comparison to the entsize warning looks weird. Looking at code comments (see line 1942 in ElfDumper.cpp in this diff), in one place we ignore the entsize so that we can dump the symbol table, but then later on, we obviously don't. Something for a follow-up patch probably.

This revision was automatically updated to reflect the committed changes.
grimar marked an inline comment as done.