[PATCH] D111240: [llvm-readelf][docs] Add missing options and details to the help output and the command guide

Owen Reynolds via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 6 09:29:28 PDT 2021


gbreynoo created this revision.
gbreynoo added reviewers: jhenderson, MaskRay, rahmanl, zequanwu.
Herald added a subscriber: rupprecht.
gbreynoo requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This change is to keep the help text and command guide of llvm-readelf in tandem.

- In the help text mention that `--section-data`, `--section-relocations`, `--section-symbols` and `--stack-sizes` have no effect on GNU style output; give the accepted values for `--elf-output-style` and update the description of `--gnu-hash-table` to use the command guide description.
- In the command guide add the missing options `-a`, `--dependant-libraries`,`--no-demangle`, `--wide` and `-W`. Also update the description of  `--symbols` so it matches the help text.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D111240

Files:
  llvm/docs/CommandGuide/llvm-readelf.rst
  llvm/tools/llvm-readobj/Opts.td


Index: llvm/tools/llvm-readobj/Opts.td
===================================================================
--- llvm/tools/llvm-readobj/Opts.td
+++ llvm/tools/llvm-readobj/Opts.td
@@ -29,14 +29,14 @@
 def headers : FF<"headers", "Equivalent to setting: --file-header, --program-headers, --section-headers">;
 defm hex_dump : Eq<"hex-dump", "Display the specified section(s) as hexadecimal bytes">, MetaVarName<"<name or index>">;
 def relocs : FF<"relocs", "Display the relocation entries in the file">;
-def section_data : FF<"section-data", "Display section data for each section shown">;
+def section_data : FF<"section-data", "Display section data for each section shown. This option has no effect for GNU style output">;
 def section_details : FF<"section-details", "Display the section details">;
 def section_headers : FF<"section-headers", "Display section headers">;
 def section_mapping : FF<"section-mapping", "Display the section to segment mapping">;
 def section_mapping_EQ_false : FF<"section-mapping=false", "Don't display the section to segment mapping">, Flags<[HelpHidden]>;
-def section_relocations : FF<"section-relocations", "Display relocations for each section shown">;
-def section_symbols : FF<"section-symbols", "Display symbols for each section shown">;
-def stack_sizes : FF<"stack-sizes", "Display contents of all stack sizes sections">;
+def section_relocations : FF<"section-relocations", "Display relocations for each section shown. This option has no effect for GNU style output">;
+def section_symbols : FF<"section-symbols", "Display symbols for each section shown. This option has no effect for GNU style output">;
+def stack_sizes : FF<"stack-sizes", "Display contents of all stack sizes sections. This option has no effect for GNU style output">;
 def stackmap : FF<"stackmap", "Display contents of stackmap section">;
 defm string_dump : Eq<"string-dump", "Display the specified section(s) as a list of strings">, MetaVarName<"<name or index>">;
 def string_table : FF<"string-table", "Display the string table (only for XCOFF now)">;
@@ -47,10 +47,10 @@
 def grp_elf : OptionGroup<"kind">, HelpText<"OPTIONS (ELF specific)">;
 def dynamic_table : FF<"dynamic-table", "Display the dynamic section table">, Group<grp_elf>;
 def elf_linker_options : FF<"elf-linker-options", "Display the .linker-options section">, Group<grp_elf>;
-defm elf_output_style : Eq<"elf-output-style", "Specify ELF dump style">, Group<grp_elf>;
+defm elf_output_style : Eq<"elf-output-style", "Specify ELF dump style, accepted options are are LLVM and GNU">, Group<grp_elf>;
 def histogram : FF<"histogram", "Display bucket list histogram for hash sections">, Group<grp_elf>;
 def section_groups : FF<"section-groups", "Display section groups">, Group<grp_elf>;
-def gnu_hash_table : FF<"gnu-hash-table", "Display .gnu.hash section">, Group<grp_elf>;
+def gnu_hash_table : FF<"gnu-hash-table", "Display the GNU hash table for dynamic symbols.">, Group<grp_elf>;
 def hash_symbols : FF<"hash-symbols", "Display the dynamic symbols derived from the hash section">, Group<grp_elf>;
 def hash_table : FF<"hash-table", "Display .hash section">, Group<grp_elf>;
 def needed_libs : FF<"needed-libs", "Display the needed libraries">, Group<grp_elf>;
Index: llvm/docs/CommandGuide/llvm-readelf.rst
===================================================================
--- llvm/docs/CommandGuide/llvm-readelf.rst
+++ llvm/docs/CommandGuide/llvm-readelf.rst
@@ -20,7 +20,7 @@
 OPTIONS
 -------
 
-.. option:: --all
+.. option:: --all, -a
 
  Equivalent to specifying all the main display options relevant to the file
  format.
@@ -41,6 +41,10 @@
 .. option:: --demangle, -C
 
  Display demangled symbol names in the output.
+ 
+.. option:: --dependent-libraries
+
+ Display the dependent libraries section.
 
 .. option:: --dyn-relocations
 
@@ -114,6 +118,10 @@
 .. option:: --needed-libs
 
  Display the needed libraries.
+  
+.. option:: --no-demangle
+
+ Do not display demangled symbol names in the output. On by default.
 
 .. option:: --notes, -n
 
@@ -175,7 +183,7 @@
 
 .. option:: --symbols, --syms, -s
 
- Display the symbol table.
+ Display the symbol table. Also display the dynamic symbol table when using GNU output style for ELF.
 
 .. option:: --unwind, -u
 
@@ -188,7 +196,11 @@
 .. option:: --version-info, -V
 
  Display version sections.
+ 
+.. option:: --wide, -W
 
+ Ignored for GNU readelf compatibility.
+ 
 .. option:: @<FILE>
 
  Read command-line options from response file `<FILE>`.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D111240.377568.patch
Type: text/x-patch
Size: 4513 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211006/539ef0dd/attachment.bin>


More information about the llvm-commits mailing list