[PATCH] D70665: [llvm-readobj] - Implement --dependent-lib-directives flag.

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 4 09:41:57 PST 2019


MaskRay accepted this revision.
MaskRay added inline comments.
This revision is now accepted and ready to land.


================
Comment at: llvm/docs/CommandGuide/llvm-readobj.rst:157
+
+ Display the dependent libraries section.
+
----------------
jhenderson wrote:
> grimar wrote:
> > grimar wrote:
> > > MaskRay wrote:
> > > > jhenderson wrote:
> > > > > section -> directives (in case it starts getting used by COFF)
> > > > @bd1976llvm @jhenderson Do we have to call it `-directives`? A `#pragma` is referred to as a directive, but the section is not.
> > > > 
> > > > We support other options that dump extension sections (e.g. `--stack-sizes`). None has the suffix `-directives`. I think `--dependent-libs` (I presume you will prefer the plural form) should be fine.
> > > > section -> directives (in case it starts getting used by COFF)
> > > 
> > > The section type is called "SHT_LLVM_DEPENDENT_LIBRARIES". That is why I haven't changed the description.
> > > Given this the description seems to be fine?
> > Or.. Does "SHT_LLVM_DEPENDENT_LIBRARIES" used by COFF somehow or this section type is needed only for ELF?
> > (I know nothing about COFF. I've supposed it still creates a section of this type under hood, but may be I getting it wrong?).
> > Do we have to call it -directives? A #pragma is referred to as a directive, but the section is not.
> 
> > Or.. Does "SHT_LLVM_DEPENDENT_LIBRARIES" used by COFF somehow or this section type is needed only for ELF?
> 
> I actually prefer it without, but I chatted offline with @bd1976llvm who explained that for the equivalent feature in COFF, they are not listed as libraries, but rather command-line like directives e.g. `/DEFAULTLIB:library.lib`. Microsoft's `dumpbin` uses `/directives` as the option to dump them, for the record, but that dumps more than just library directives.
> 
> Happy to hear what other people think though. --dependent-libs is fine for me (or perhaps we should use `--dependent-libraries`) and I think would be sufficient for COFF too.
`--dependent-libraries` is fine for me (the section type is called `SHT_LLVM_DEPENDENT_LIBRARIES`).


================
Comment at: llvm/tools/llvm-readobj/ELFDumper.cpp:224
   void printELFLinkerOptions() override;
+
   void printStackSizes() override;
----------------
Unintended change?


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

https://reviews.llvm.org/D70665





More information about the llvm-commits mailing list