> From: Jeremie Courreges-Anglas <j...@wxcvbn.org>
> Date: Sat, 09 Jul 2022 13:02:57 +0200
> 
> On riscv64 I miss having a usable readelf.  We could just build
> llvm-readelf instead.  The actual tool is called llvm-readobj, with
> GNU compat when called under the llvm-readelf or readelf names.
> 
> People will probably find this useful on arm64 and powerpc64 too.
> 
> This shouldn't have a negative impact on ports.  ok?

Yes, I think it would be good to have this.  Even on amd64 since our
ancient GNU binutils readelf doesn't support the latest and greatest
ELF features.

ok kettenis@

> Index: Makefile
> ===================================================================
> RCS file: /home/cvs/src/gnu/usr.bin/clang/Makefile,v
> retrieving revision 1.18
> diff -u -p -r1.18 Makefile
> --- Makefile  17 Dec 2021 14:55:44 -0000      1.18
> +++ Makefile  9 Jul 2022 10:51:13 -0000
> @@ -102,6 +102,8 @@ SUBDIR+=include/llvm-objcopy
>  SUBDIR+=llvm-objcopy
>  SUBDIR+=include/llvm-objdump
>  SUBDIR+=llvm-objdump
> +SUBDIR+=include/llvm-readobj
> +SUBDIR+=llvm-readobj
>  
>  .if ${AR_VERSION:L} == "llvm"
>  SUBDIR+=libLLVMDlltoolDriver
> Index: include/llvm-readobj/Makefile
> ===================================================================
> RCS file: include/llvm-readobj/Makefile
> diff -N include/llvm-readobj/Makefile
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ include/llvm-readobj/Makefile     6 Jul 2022 00:55:05 -0000
> @@ -0,0 +1,23 @@
> +# $OpenBSD: Makefile,v 1.2 2021/12/17 14:55:44 patrick Exp $
> +
> +.include <bsd.own.mk>
> +
> +TBLGEN=      ${.OBJDIR}/../../llvm-tblgen/llvm-tblgen
> +OBJCOPY_INC=${.CURDIR}/../../../../llvm/llvm/tools/llvm-readobj
> +
> +GEN= Opts.inc
> +
> +all: ${GEN}
> +
> +install:
> +     @# Nothing here so far ...
> +
> +clean cleandir:
> +     rm -f ${GEN}
> +
> +Opts.inc: ${OBJCOPY_INC}/Opts.td
> +     ${TBLGEN} -I${.CURDIR}/../../../../llvm/llvm/include \
> +             -I${.CURDIR}/../../../../llvm/llvm/tools/llvm-readobj \
> +             -gen-opt-parser-defs -o ${.TARGET} ${.ALLSRC}
> +
> +.include <bsd.obj.mk>
> Index: llvm-readobj/Makefile
> ===================================================================
> RCS file: llvm-readobj/Makefile
> diff -N llvm-readobj/Makefile
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ llvm-readobj/Makefile     9 Jul 2022 01:21:04 -0000
> @@ -0,0 +1,30 @@
> +# $OpenBSD: Makefile,v 1.2 2021/12/17 14:55:47 patrick Exp $
> +
> +.include <bsd.own.mk>
> +
> +PROG=        llvm-readobj
> +BINDIR=      /usr/bin
> +LINKS=       ${BINDIR}/llvm-readobj ${BINDIR}/llvm-readelf
> +MAN= llvm-readelf.1 llvm-readobj.1
> +
> +SRCS=        ARMWinEHPrinter.cpp \
> +     COFFDumper.cpp \
> +     COFFImportDumper.cpp \
> +     ELFDumper.cpp \
> +     llvm-readobj.cpp \
> +     MachODumper.cpp \
> +     ObjDumper.cpp \
> +     WasmDumper.cpp \
> +     Win64EHDumper.cpp \
> +     WindowsResourceDumper.cpp \
> +     XCOFFDumper.cpp
> +
> +CPPFLAGS+=   -I${.OBJDIR}/../include/llvm-readobj
> +
> +.PATH:       ${.CURDIR}/../../../llvm/llvm/tools/llvm-readobj
> +
> +LLVM_LIBDEPS=        LLVM
> +
> +LDADD+= -L ${.OBJDIR}/../libLLVM -lLLVM
> +
> +.include <bsd.prog.mk>
> Index: llvm-readobj/llvm-readelf.1
> ===================================================================
> RCS file: llvm-readobj/llvm-readelf.1
> diff -N llvm-readobj/llvm-readelf.1
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ llvm-readobj/llvm-readelf.1       9 Jul 2022 01:20:20 -0000
> @@ -0,0 +1,269 @@
> +.\" Man page generated from reStructuredText.
> +.
> +.
> +.nr rst2man-indent-level 0
> +.
> +.de1 rstReportMargin
> +\\$1 \\n[an-margin]
> +level \\n[rst2man-indent-level]
> +level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
> +-
> +\\n[rst2man-indent0]
> +\\n[rst2man-indent1]
> +\\n[rst2man-indent2]
> +..
> +.de1 INDENT
> +.\" .rstReportMargin pre:
> +. RS \\$1
> +. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
> +. nr rst2man-indent-level +1
> +.\" .rstReportMargin post:
> +..
> +.de UNINDENT
> +. RE
> +.\" indent \\n[an-margin]
> +.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
> +.nr rst2man-indent-level -1
> +.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
> +.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
> +..
> +.TH "LLVM-READELF" "1" "2022-07-05" "13" "LLVM"
> +.SH NAME
> +llvm-readelf \- GNU-style LLVM Object Reader
> +.SH SYNOPSIS
> +.sp
> +\fBllvm\-readelf\fP [\fIoptions\fP] [\fIinput...\fP]
> +.SH DESCRIPTION
> +.sp
> +The \fBllvm\-readelf\fP tool displays low\-level format\-specific information
> +about one or more object files.
> +.sp
> +If \fBinput\fP is "\fB\-\fP", \fBllvm\-readelf\fP reads from standard
> +input. Otherwise, it will read from the specified \fBfilenames\fP\&.
> +.SH OPTIONS
> +.INDENT 0.0
> +.TP
> +.B \-\-all
> +Equivalent to specifying all the main display options relevant to the file
> +format.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-addrsig
> +Display the address\-significance table.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-arch\-specific, \-A
> +Display architecture\-specific information, e.g. the ARM attributes section 
> on ARM.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-bb\-addr\-map
> +Display the contents of the basic block address map section(s), which 
> contain the
> +address of each function, along with the relative offset of each basic block.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-demangle, \-C
> +Display demangled symbol names in the output.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-dyn\-relocations
> +Display the dynamic relocation entries.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-dyn\-symbols, \-\-dyn\-syms
> +Display the dynamic symbol table.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-dynamic\-table, \-\-dynamic, \-d
> +Display the dynamic table.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-cg\-profile
> +Display the callgraph profile section.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-histogram, \-I
> +Display a bucket list histogram for dynamic symbol hash tables.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-elf\-linker\-options
> +Display the linker options section.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-elf\-output\-style=<value>
> +Format ELF information in the specified style. Valid options are \fBLLVM\fP 
> and
> +\fBGNU\fP\&. \fBLLVM\fP output is an expanded and structured format, whilst 
> \fBGNU\fP
> +(the default) output mimics the equivalent GNU \fBreadelf\fP output.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-section\-groups, \-g
> +Display section groups.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-expand\-relocs
> +When used with \fI\%\-\-relocations\fP, display each relocation in an 
> expanded
> +multi\-line format.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-file\-header, \-h
> +Display file headers.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-gnu\-hash\-table
> +Display the GNU hash table for dynamic symbols.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-hash\-symbols
> +Display the expanded hash table with dynamic symbol data.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-hash\-table
> +Display the hash table for dynamic symbols.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-headers, \-e
> +Equivalent to setting: \fI\%\-\-file\-header\fP, 
> \fI\%\-\-program\-headers\fP,
> +and \fI\%\-\-sections\fP\&.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-help
> +Display a summary of command line options.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-hex\-dump=<section[,section,...]>, \-x
> +Display the specified section(s) as hexadecimal bytes. \fBsection\fP may be a
> +section index or section name.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-needed\-libs
> +Display the needed libraries.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-notes, \-n
> +Display all notes.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-program\-headers, \-\-segments, \-l
> +Display the program headers.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-raw\-relr
> +Do not decode relocations in RELR relocation sections when displaying them.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-relocations, \-\-relocs, \-r
> +Display the relocation entries in the file.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-sections, \-\-section\-headers, \-S
> +Display all sections.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-section\-data
> +When used with \fI\%\-\-sections\fP, display section data for each section
> +shown. This option has no effect for GNU style output.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-section\-details, \-t
> +Display all section details. Used as an alternative to 
> \fI\%\-\-sections\fP\&.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-section\-mapping
> +Display the section to segment mapping.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-section\-relocations
> +When used with \fI\%\-\-sections\fP, display relocations for each section
> +shown. This option has no effect for GNU style output.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-section\-symbols
> +When used with \fI\%\-\-sections\fP, display symbols for each section shown.
> +This option has no effect for GNU style output.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-stackmap
> +Display contents of the stackmap section.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-stack\-sizes
> +Display the contents of the stack sizes section(s), i.e. pairs of function
> +names and the size of their stack frames. Currently only implemented for GNU
> +style output.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-string\-dump=<section[,section,...]>, \-p
> +Display the specified section(s) as a list of strings. \fBsection\fP may be a
> +section index or section name.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-symbols, \-\-syms, \-s
> +Display the symbol table.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-unwind, \-u
> +Display unwind information.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-version
> +Display the version of the \fBllvm\-readelf\fP executable.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-version\-info, \-V
> +Display version sections.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B @<FILE>
> +Read command\-line options from response file \fI<FILE>\fP\&.
> +.UNINDENT
> +.SH EXIT STATUS
> +.sp
> +\fBllvm\-readelf\fP returns 0 under normal operation. It returns a non\-zero
> +exit code if there were any errors.
> +.SH SEE ALSO
> +.sp
> +\fBllvm\-nm(1)\fP, \fBllvm\-objdump(1)\fP, \fBllvm\-readobj(1)\fP
> +.SH AUTHOR
> +Maintained by the LLVM Team (https://llvm.org/).
> +.SH COPYRIGHT
> +2003-2022, LLVM Project
> +.\" Generated by docutils manpage writer.
> +.
> Index: llvm-readobj/llvm-readobj.1
> ===================================================================
> RCS file: llvm-readobj/llvm-readobj.1
> diff -N llvm-readobj/llvm-readobj.1
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ llvm-readobj/llvm-readobj.1       9 Jul 2022 00:09:15 -0000
> @@ -0,0 +1,404 @@
> +.\" Man page generated from reStructuredText.
> +.
> +.
> +.nr rst2man-indent-level 0
> +.
> +.de1 rstReportMargin
> +\\$1 \\n[an-margin]
> +level \\n[rst2man-indent-level]
> +level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
> +-
> +\\n[rst2man-indent0]
> +\\n[rst2man-indent1]
> +\\n[rst2man-indent2]
> +..
> +.de1 INDENT
> +.\" .rstReportMargin pre:
> +. RS \\$1
> +. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
> +. nr rst2man-indent-level +1
> +.\" .rstReportMargin post:
> +..
> +.de UNINDENT
> +. RE
> +.\" indent \\n[an-margin]
> +.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
> +.nr rst2man-indent-level -1
> +.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
> +.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
> +..
> +.TH "LLVM-READOBJ" "1" "2022-07-05" "13" "LLVM"
> +.SH NAME
> +llvm-readobj \- LLVM Object Reader
> +.SH SYNOPSIS
> +.sp
> +\fBllvm\-readobj\fP [\fIoptions\fP] [\fIinput...\fP]
> +.SH DESCRIPTION
> +.sp
> +The \fBllvm\-readobj\fP tool displays low\-level format\-specific information
> +about one or more object files.
> +.sp
> +If \fBinput\fP is "\fB\-\fP", \fBllvm\-readobj\fP reads from standard
> +input. Otherwise, it will read from the specified \fBfilenames\fP\&.
> +.SH DIFFERENCES TO LLVM-READELF
> +.sp
> +\fBllvm\-readelf\fP is an alias for the \fBllvm\-readobj\fP tool with a
> +slightly different command\-line interface and output that is GNU compatible.
> +Following is a list of differences between \fBllvm\-readelf\fP and
> +\fBllvm\-readobj\fP:
> +.INDENT 0.0
> +.IP \(bu 2
> +\fBllvm\-readelf\fP uses \fIGNU\fP for the \fI\%\-\-elf\-output\-style\fP 
> option
> +by default. \fBllvm\-readobj\fP uses \fILLVM\fP\&.
> +.IP \(bu 2
> +\fBllvm\-readelf\fP allows single\-letter grouped flags (e.g.
> +\fBllvm\-readelf \-SW\fP is the same as  \fBllvm\-readelf \-S \-W\fP).
> +\fBllvm\-readobj\fP does not allow grouping.
> +.IP \(bu 2
> +\fBllvm\-readelf\fP provides \fI\%\-s\fP as an alias for
> +\fI\%\-\-symbols\fP, for GNU \fBreadelf\fP compatibility, whereas it is
> +an alias for \fI\%\-\-section\-headers\fP in \fBllvm\-readobj\fP\&.
> +.IP \(bu 2
> +\fBllvm\-readobj\fP provides \fB\-t\fP as an alias for \fI\%\-\-symbols\fP\&.
> +\fBllvm\-readelf\fP does not.
> +.IP \(bu 2
> +\fBllvm\-readobj\fP provides \fB\-\-sr\fP, \fB\-\-sd\fP, \fB\-\-st\fP and 
> \fB\-\-dt\fP as
> +aliases for \fI\%\-\-section\-relocations\fP, \fI\%\-\-section\-data\fP,
> +\fI\%\-\-section\-symbols\fP and \fI\%\-\-dyn\-symbols\fP respectively.
> +\fBllvm\-readelf\fP does not provide these aliases, to avoid conflicting
> +with grouped flags.
> +.UNINDENT
> +.SH GENERAL AND MULTI-FORMAT OPTIONS
> +.sp
> +These options are applicable to more than one file format, or are unrelated 
> to
> +file formats.
> +.INDENT 0.0
> +.TP
> +.B \-\-all
> +Equivalent to specifying all the main display options relevant to the file
> +format.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-addrsig
> +Display the address\-significance table.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-expand\-relocs
> +When used with \fI\%\-\-relocs\fP, display each relocation in an expanded
> +multi\-line format.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-file\-header, \-h
> +Display file headers.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-headers, \-e
> +Equivalent to setting: \fI\%\-\-file\-header\fP, 
> \fI\%\-\-program\-headers\fP,
> +and \fI\%\-\-sections\fP\&.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-help
> +Display a summary of command line options.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-hex\-dump=<section[,section,...]>, \-x
> +Display the specified section(s) as hexadecimal bytes. \fBsection\fP may be a
> +section index or section name.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-needed\-libs
> +Display the needed libraries.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-relocations, \-\-relocs, \-r
> +Display the relocation entries in the file.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-sections, \-\-section\-headers, \-S
> +Display all sections.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-section\-data, \-\-sd
> +When used with \fI\%\-\-sections\fP, display section data for each section
> +shown. This option has no effect for GNU style output.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-section\-relocations, \-\-sr
> +When used with \fI\%\-\-sections\fP, display relocations for each section
> +shown. This option has no effect for GNU style output.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-section\-symbols, \-\-st
> +When used with \fI\%\-\-sections\fP, display symbols for each section shown.
> +This option has no effect for GNU style output.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-stackmap
> +Display contents of the stackmap section.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-string\-dump=<section[,section,...]>, \-p
> +Display the specified section(s) as a list of strings. \fBsection\fP may be a
> +section index or section name.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-string\-table
> +Display contents of the string table.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-symbols, \-\-syms, \-s
> +Display the symbol table.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-unwind, \-u
> +Display unwind information.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-version
> +Display the version of the \fBllvm\-readobj\fP executable.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B @<FILE>
> +Read command\-line options from response file \fI<FILE>\fP\&.
> +.UNINDENT
> +.SH ELF SPECIFIC OPTIONS
> +.sp
> +The following options are implemented only for the ELF file format.
> +.INDENT 0.0
> +.TP
> +.B \-\-arch\-specific, \-A
> +Display architecture\-specific information, e.g. the ARM attributes section 
> on ARM.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-bb\-addr\-map
> +Display the contents of the basic block address map section(s), which 
> contain the
> +address of each function, along with the relative offset of each basic block.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-demangle, \-C
> +Display demangled symbol names in the output.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-dependent\-libraries
> +Display the dependent libraries section.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-dyn\-relocations
> +Display the dynamic relocation entries.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-dyn\-symbols, \-\-dyn\-syms, \-\-dt
> +Display the dynamic symbol table.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-dynamic\-table, \-\-dynamic, \-d
> +Display the dynamic table.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-cg\-profile
> +Display the callgraph profile section.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-histogram, \-I
> +Display a bucket list histogram for dynamic symbol hash tables.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-elf\-linker\-options
> +Display the linker options section.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-elf\-output\-style=<value>
> +Format ELF information in the specified style. Valid options are \fBLLVM\fP 
> and
> +\fBGNU\fP\&. \fBLLVM\fP output (the default) is an expanded and structured 
> format,
> +whilst \fBGNU\fP output mimics the equivalent GNU \fBreadelf\fP output.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-section\-groups, \-g
> +Display section groups.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-gnu\-hash\-table
> +Display the GNU hash table for dynamic symbols.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-hash\-symbols
> +Display the expanded hash table with dynamic symbol data.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-hash\-table
> +Display the hash table for dynamic symbols.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-notes, \-n
> +Display all notes.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-program\-headers, \-\-segments, \-l
> +Display the program headers.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-raw\-relr
> +Do not decode relocations in RELR relocation sections when displaying them.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-section\-mapping
> +Display the section to segment mapping.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-stack\-sizes
> +Display the contents of the stack sizes section(s), i.e. pairs of function
> +names and the size of their stack frames. Currently only implemented for GNU
> +style output.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-version\-info, \-V
> +Display version sections.
> +.UNINDENT
> +.SH MACH-O SPECIFIC OPTIONS
> +.sp
> +The following options are implemented only for the Mach\-O file format.
> +.INDENT 0.0
> +.TP
> +.B \-\-macho\-data\-in\-code
> +Display the Data in Code command.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-macho\-dsymtab
> +Display the Dsymtab command.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-macho\-indirect\-symbols
> +Display indirect symbols.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-macho\-linker\-options
> +Display the Mach\-O\-specific linker options.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-macho\-segment
> +Display the Segment command.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-macho\-version\-min
> +Display the version min command.
> +.UNINDENT
> +.SH PE/COFF SPECIFIC OPTIONS
> +.sp
> +The following options are implemented only for the PE/COFF file format.
> +.INDENT 0.0
> +.TP
> +.B \-\-codeview
> +Display CodeView debug information.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-codeview\-ghash
> +Enable global hashing for CodeView type stream de\-duplication.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-codeview\-merged\-types
> +Display the merged CodeView type stream.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-codeview\-subsection\-bytes
> +Dump raw contents of CodeView debug sections and records.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-coff\-basereloc
> +Display the .reloc section.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-coff\-debug\-directory
> +Display the debug directory.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-coff\-tls\-directory
> +Display the TLS directory.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-coff\-directives
> +Display the .drectve section.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-coff\-exports
> +Display the export table.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-coff\-imports
> +Display the import table.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-coff\-load\-config
> +Display the load config.
> +.UNINDENT
> +.INDENT 0.0
> +.TP
> +.B \-\-coff\-resources
> +Display the .rsrc section.
> +.UNINDENT
> +.SH EXIT STATUS
> +.sp
> +\fBllvm\-readobj\fP returns 0 under normal operation. It returns a non\-zero
> +exit code if there were any errors.
> +.SH SEE ALSO
> +.sp
> +\fBllvm\-nm(1)\fP, \fBllvm\-objdump(1)\fP, \fBllvm\-readelf(1)\fP
> +.SH AUTHOR
> +Maintained by the LLVM Team (https://llvm.org/).
> +.SH COPYRIGHT
> +2003-2022, LLVM Project
> +.\" Generated by docutils manpage writer.
> +.
> 
> 
> -- 
> jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE
> 
> 

Reply via email to