James Henderson via llvm-dev
2019-Jun-24 15:15 UTC
[llvm-dev] RFC: Two llvm-readobj behaviour queries
Hi all, I just was discussing a couple of features in llvm-readobj and whether we should change them slightly: 1) llvm-readobj --all currently matches GNU readelf's --all switch in that it is equivalent to specifying a bundle of different options (including --file-headers, --program-headers, --symbols, --version-info etc). However, --all does not actually specify "all" dump types. For example, it doesn't dump ELF section groups or the addrsig section (--elf-section-groups and --addrsig respectively). I'd propose that it should dump all relevant dumping information. Ideally, I'd suggest this difference for both llvm-readobj and llvm-readelf, but I can understand nervousness in the additional dumps that this would produce in llvm-readelf versus GNU readelf. 2) llvm-readobj --notes prints the SHT_NOTE sections unless the ELF type is ET_CORE, in which case it prints the contents of the PT_NOTE segments and NOT the SHT_NOTE sections. It seems to me like there's no good reason to not try both for all file formats. For example, it's perfectly reasonable to have PT_NOTE segments in an ET_EXEC or ET_DYN object file. What would people think about removing this distinction? In this case, I'd propose printing all PT_NOTE segments and all SHT_NOTE sections not in PT_NOTE segments. In all likelihood, this would produce no different behaviour to the old behaviour. Thoughts? James -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190624/8dd056ac/attachment.html>
Peter Smith via llvm-dev
2019-Jun-24 16:01 UTC
[llvm-dev] RFC: Two llvm-readobj behaviour queries
On Mon, 24 Jun 2019 at 16:16, James Henderson via llvm-dev <llvm-dev at lists.llvm.org> wrote:> > Hi all, > > I just was discussing a couple of features in llvm-readobj and whether we should change them slightly: > > 1) llvm-readobj --all currently matches GNU readelf's --all switch in that it is equivalent to specifying a bundle of different options (including --file-headers, --program-headers, --symbols, --version-info etc). However, --all does not actually specify "all" dump types. For example, it doesn't dump ELF section groups or the addrsig section (--elf-section-groups and --addrsig respectively). I'd propose that it should dump all relevant dumping information. Ideally, I'd suggest this difference for both llvm-readobj and llvm-readelf, but I can understand nervousness in the additional dumps that this would produce in llvm-readelf versus GNU readelf. > > 2) llvm-readobj --notes prints the SHT_NOTE sections unless the ELF type is ET_CORE, in which case it prints the contents of the PT_NOTE segments and NOT the SHT_NOTE sections. It seems to me like there's no good reason to not try both for all file formats. For example, it's perfectly reasonable to have PT_NOTE segments in an ET_EXEC or ET_DYN object file. What would people think about removing this distinction? In this case, I'd propose printing all PT_NOTE segments and all SHT_NOTE sections not in PT_NOTE segments. In all likelihood, this would produce no different behaviour to the old behaviour. > > Thoughts? >I agree with both proposals. Although I suspect that people parsing the output of GNU readelf won't be using the --all switch I think it is reasonable to keep the option sets the same. Peter> James > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Michael Spencer via llvm-dev
2019-Jun-26 00:35 UTC
[llvm-dev] RFC: Two llvm-readobj behaviour queries
On Mon, Jun 24, 2019 at 8:16 AM James Henderson via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Hi all, > > I just was discussing a couple of features in llvm-readobj and whether we > should change them slightly: > > 1) llvm-readobj --all currently matches GNU readelf's --all switch in that > it is equivalent to specifying a bundle of different options (including > --file-headers, --program-headers, --symbols, --version-info etc). However, > --all does not actually specify "all" dump types. For example, it doesn't > dump ELF section groups or the addrsig section (--elf-section-groups and > --addrsig respectively). I'd propose that it should dump all relevant > dumping information. Ideally, I'd suggest this difference for both > llvm-readobj and llvm-readelf, but I can understand nervousness in the > additional dumps that this would produce in llvm-readelf versus GNU readelf. > > 2) llvm-readobj --notes prints the SHT_NOTE sections unless the ELF type > is ET_CORE, in which case it prints the contents of the PT_NOTE segments > and NOT the SHT_NOTE sections. It seems to me like there's no good reason > to not try both for all file formats. For example, it's perfectly > reasonable to have PT_NOTE segments in an ET_EXEC or ET_DYN object file. > What would people think about removing this distinction? In this case, I'd > propose printing all PT_NOTE segments and all SHT_NOTE sections not in > PT_NOTE segments. In all likelihood, this would produce no different > behaviour to the old behaviour. > > Thoughts? > > James > >I'm fine with both changes. For the first, I prefer llvm-readelf --all mimics gnu readelf. - Michael Spencer -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190625/25859f57/attachment.html>