forked from Imagelibrary/binutils-gdb
binutils, objdump: Add --ctf-parent-section
This lets you examine CTF where the parent and child dicts are in entirely
different sections, rather than in a CTF archive with members with different
names. The linker doesn't emit ELF objects structured like this, but some
third-party linkers may; it's also useful for objcopy-constructed files
in some cases.
(This is what the objdump --ctf-parent option used to do before commit
80b56fad5c in 2021. The new semantics of that option are much more
useful, but that doesn't mean the old ones are never useful at all, so let's
bring them back.)
(I was specifically driven to add this by DTrace's obscure "ctypes" and
"dtypes" options, which dump its internal, dynamically-generated dicts out
to files for debugging purposes: there are two, one the parent of the other.
Since they're in two separate files rather than a CTF archive and we have no
tools that paste files together into archives, objdump wouldn't show them --
and even pasting them together into an ELF executable with objcopy didn't
help, since objdump had no options that could be used to look in specific
sections for the parent dict. With --ctf-parent-section, this sort of
obscure use case becomes possible again. You'll never need it for the
output of the normal linker.)
binutils/
* doc/ctf.options.texi: Add --ctf-parent-section=.
* objdump.c (dump_ctf): Implement it.
(dump_bfd): Likewise.
(main): Likewise.
This commit is contained in:
@@ -22,3 +22,13 @@ function at link time. When looking at CTF archives that have been
|
||||
created by a linker that uses the name changer to rename the parent
|
||||
archive member, @option{--ctf-parent} can be used to specify the name
|
||||
used for the parent.
|
||||
|
||||
@item --ctf-parent-section=@var{section}
|
||||
|
||||
This option lets you pick a completely different section for the CTF
|
||||
parent dictionary containing unambiguous types than for the child
|
||||
dictionaries that contain the ambiguous remainder. The linker does
|
||||
not emit ELF objects structured like this, but some third-party linkers
|
||||
may. It's also convenient to inspect CTF written out as multiple raw
|
||||
files to compose them with objcopy, which can put them in different
|
||||
ELF sections but not in different members of a single CTF dict.
|
||||
|
||||
Reference in New Issue
Block a user