[llvm] 14d76a3 - [llvm-readelf][docs] Add missing options and details to the help output and the command guide

via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 7 09:11:32 PDT 2021


Author: gbreynoo
Date: 2021-10-07T17:11:02+01:00
New Revision: 14d76a376a412d5720cc83c40d00d8e5fb163105

URL: https://github.com/llvm/llvm-project/commit/14d76a376a412d5720cc83c40d00d8e5fb163105
DIFF: https://github.com/llvm/llvm-project/commit/14d76a376a412d5720cc83c40d00d8e5fb163105.diff

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

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.

Differential Revision: https://reviews.llvm.org/D111240

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/docs/CommandGuide/llvm-readelf.rst b/llvm/docs/CommandGuide/llvm-readelf.rst
index 59a9da60e53d..8ba1a0e7ee95 100644
--- a/llvm/docs/CommandGuide/llvm-readelf.rst
+++ b/llvm/docs/CommandGuide/llvm-readelf.rst
@@ -20,7 +20,7 @@ input. Otherwise, it will read from the specified ``filenames``.
 OPTIONS
 -------
 
-.. option:: --all
+.. option:: --all, -a
 
  Equivalent to specifying all the main display options relevant to the file
  format.
@@ -41,6 +41,10 @@ OPTIONS
 .. 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 @@ OPTIONS
 .. 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 @@ OPTIONS
 
 .. 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 @@ OPTIONS
 .. option:: --version-info, -V
 
  Display version sections.
+ 
+.. option:: --wide, -W
 
+ Ignored for GNU readelf compatibility. The output is already similar to when using -W with GNU readelf.
+ 
 .. option:: @<FILE>
 
  Read command-line options from response file `<FILE>`.

diff  --git a/llvm/tools/llvm-readobj/Opts.td b/llvm/tools/llvm-readobj/Opts.td
index 493b93769eb4..148be3e42951 100644
--- a/llvm/tools/llvm-readobj/Opts.td
+++ b/llvm/tools/llvm-readobj/Opts.td
@@ -29,14 +29,14 @@ def file_header : FF<"file-header", "Display file header">;
 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 unwind : FF<"unwind", "Display unwind information">;
 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: LLVM or 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>;


        


More information about the llvm-commits mailing list