[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
Fri May 24 05:49:29 PDT 2019
grimar abandoned this revision.
grimar added a comment.
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
I looked on the `empty-tls.test` and the problem is that it contains only TLS prorgam header,
and the following call fails:
case ELF::DT_SYMTAB:
DynSymRegion.Addr = toMappedAddr(Dyn.getPtr());
..
I.e. since there is no segment, covering the address of dynamic symbol table,
it fails to get its data properly.
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.
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