[PATCH] D74955: [obj2yaml] - Dump SHT_STRTAB, SHT_SYMTAB and SHT_DYNSYM sections.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 25 06:47:48 PST 2020


grimar added a comment.

In D74955#1890908 <https://reviews.llvm.org/D74955#1890908>, @jhenderson wrote:

> I don't have a clear solution to this yet, as I agree we shouldn't throw away important information like section addresses when using obj2yaml. I'm not concerned by the section header order, as that technically has no impact on anything (as long as section indexes in other things are updated correctly).


In my use case the order is important. In short: I've experimented with a code to dump program headers and make an object produced
after `obj->obj2yaml->yaml2obj->obj` operation have the same segments, sections in segments etc. 
In this case it is important to keep the order and addresses of allocatable implicit sections.

> Could we perhaps only list the implicit sections when they have a non-default value for something (i.e. a value that would be different from when they are not specified, such as a non-zero address)?

A non-zero address for allocatable sections is pretty common. I.e. we will always print .dynsym/.dynstr sections..

My concern is also that reading SHT_STRTAB/SHT_SYMTAB/SHT_DYNSYM and printing
different from "default" ones is a much more complicated logic than simply dumping them as `RawContentSection`, like this patch does.

What if we introduce an option, e.g. `--dump-implicit-sec`  to dump them? It could be used for test cases creating
purposes and hide such details what should work good for a general case probably.


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

https://reviews.llvm.org/D74955





More information about the llvm-commits mailing list