Commit: readelf: decode LTO symbol tables
Nick Clifton
nickc@redhat.com
Mon Oct 19 14:27:40 GMT 2020
Hi Guys,
Whilst working on a problem with the lto-plugin I noticed that we do
not have any way of displaying the contents of LTO symbol table
sections. We can use nm or objdump with the plugin enabled, but this
shows us the translated version of the symbol tables, not the
original.
So I am applying the attached patch to add a new option to readelf:
--lto-syms When used it displays the contents of any LTO symbol
tables in the provided files. (I had originally planned to extend the
--syms option so that it could take argument indicating the kind of
symbols to display, eg --syms=lto, but this proved to be too
disruptive to the codebase, so I went with a new command line option
instead).
The patch also handles v1 symbol extension table sections, if they
exist.
Cheers
Nick
binutils/ChangeLog
2020-10-19 Nick Clifton <nickc@redhat.com>
* readelf.c (do_lto_syms): New local.
(long_option_values): Add OPTION_LTO_SYMS.
(options): Add --lto-syms.
(usage): Mention the new option.
(parse_args): Parse the new option.
(get_lto_kind): New function.
(get_lto_visibility): New function.
(get_lto_sym_type): New function.
(display_lto_symtab): New function - displays the contents of an
LTo symbol table section.
(process_lto_symbol_tables): New functions. Calls
dipslay_lto_symtab on any LTO symbol table section.
(process_object_file): Call process_lto_symbol_tables.
* doc/binutils.texi: Document the new option.
* NEWS: Mention the new feature.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: readelf-lto-syms.patch
Type: text/x-patch
Size: 11789 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20201019/bfca09d8/attachment.bin>
More information about the Binutils
mailing list