readelf --string-dump analog for objdump
Jan Beulich
jbeulich@suse.com
Mon Jan 22 12:19:05 GMT 2024
On 22.01.2024 13:11, Maxim Dementyev wrote:
> Thanks for pointing me out the objdump utility!
> Unfortunately, --only-section isn't a good choice: it produces all other
> information in the output file, not only the section in question.
> But I've found the need option of objdump utility: --dump-section
> Unfortunately, apart from this, again, the objdump utility creates a
> formatted file as an output, and I can add --only-section to reduce the
> size of it and redirect it to /dev/null.
But you're aware of objcopy's --output-target option, by using of which
you could have it produce a raw binary output file?
> So, this is usable with one intermediate file for a section.
> But it is much more complicated than just:
> "readelf -p section file | grep something".
>
> And a possible solution (how to improve the objdump utility in a generic
> way) could be a special value for the --dump-section option to produce the
> output only for this section instead of redirecting it to a separate file:
> "objcopy --dump-section section=stdout | grep something"
Maybe. Plain "stdout" would be at risk of being ambiguous though. Then
again the use of '=' there is making the whole construct ambiguous
already, for '=' potentially (even if unlikely) being part of the
section name.
Jan
More information about the Binutils
mailing list