[PATCH] D62179: [llvm-readelf] - Allow dumping of the .dynamic section even if there is no PT_DYNAMIC header.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 27 01:54:40 PDT 2019

grimar reclaimed this revision.
grimar added a comment.
This revision is now accepted and ready to land.

In D62179#1516667 <https://reviews.llvm.org/D62179#1516667>, @rupprecht wrote:

> In D62179#1515750 <https://reviews.llvm.org/D62179#1515750>, @grimar wrote:
> > I had to revert this one.
> >  It broke the following tests in a different projects:
> >  (My apologies that I did not notice that before posting on review)
> >
> >   lld :: ELF/linkerscript/empty-tls.test
> >   lld :: ELF/linkerscript/pt-interp.test
> >   LLVM :: Object/invalid.test
> >   LLVM :: tools/yaml2obj/dynamic-section-raw-content.yaml
> >   
> >
> > The error is the same, it is: "Virtual address is not in any segment"
> >  and is coming from `here: https://github.com/llvm-mirror/llvm/blob/master/lib/Object/ELF.cpp#L559
> >
> > which is called from a place where dynamic tags are parsed:
> >  https://github.com/llvm-mirror/llvm/blob/master/tools/llvm-readobj/ELFDumper.cpp#L1497
> >  ...
> >  We probably can make this error not critical, i.e. skip the dynamic entries that
> >  requires other segnemts, but I am not sure it really worth the efford and 
> >  additional code complication.
> >
> > I am abandodning this patch.
> I've seen this same error internally when switching from GNU readelf to llvm-readelf and reading core files with it, and I'm interested in fixing that. GNU readelf does what you mention -- prints a warning and moves on. I think that's useful; we should be able to use tools to read partial information from a corrupt/incomplete file.

OK. I'll resurrect this one and take a look.




More information about the llvm-commits mailing list