[PATCH] D65388: [llvm-readelf/llvm-readobj] - Test the case when e_shstrndx==SHN_XINDEX, but sec[0].sh_link is broken.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 31 07:34:07 PDT 2019


grimar added a comment.

In D65388#1606277 <https://reviews.llvm.org/D65388#1606277>, @jhenderson wrote:

> In D65388#1606226 <https://reviews.llvm.org/D65388#1606226>, @grimar wrote:
>
> > This duplication was introduced in D63266 <https://reviews.llvm.org/D63266>. The intention was to skip non-critical errors to allow readelf to dump things.
> >  I though about this and possible similar situations today too, btw. My idea was to add some kind of error policy for stuff in ELF.h.
> >  For example `ERR_MODE_STRICT` which would act as now, reporting everything, and mode `ERR_MODE_DUMP` which dumpers and tools
> >  like `obj2yaml` could use (`obj2yaml` can win from relaxing the error checking a lot).
> >  I had no chance to investigate this, can take a look closer tomorrow.
>
>
> Thanks, that sounds like a good plan to explore to me.


I investigated this and ended up with a warning handler passed as a parameter.
It seems that making a global warning handler for `ELFFile<ELFT>` it too intrusive,
but such a local solution looks flexible and seems works good: D65515 <https://reviews.llvm.org/D65515>


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65388/new/

https://reviews.llvm.org/D65388





More information about the llvm-commits mailing list