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

Jordan Rupprecht via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 24 13:34:59 PDT 2019


rupprecht added a comment.

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.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D62179





More information about the llvm-commits mailing list