Dear Jan, 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. 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" Thanks again! With respect, Max On Mon, Jan 22, 2024 at 11:58 AM Jan Beulich wrote: > On 22.01.2024 11:43, Maxim Dementyev wrote: > > The readelf utility has a very useful option - "--string-dump= > name>" which displays the contents of the indicated section as is (as > > printable strings). > > As far as I can understand, to do the same with the objdump you need to > do > > "objdump --section= --full-contents ...". > > But the output is in the "hexdump" format, the contents is splitted by > 0x10 > > size blocks (so, not possible to grep on this contents). > > > > Is there any plans to implement a printable strings format for this case > > for the objdump utility? > > Or is there a solution without parsing the hexdump format and restoring > > these printable strings? > > From what you write I can only guess that you'd like to use the > functionality > on non-ELF objects which binutils as whole (and maybe objdump in > particular) > supports. If so, is there a reason you can't extract the section(s) in > question using "objcopy --only-section" (e.g. as a raw binary file), and > then > use "strings" on the result? > > Jan > --