On Mon, Jan 22, 2024 at 6:42 PM Nick Clifton wrote: > > Or is there a solution without parsing the hexdump format and > > restoring these printable strings? > > I take it that you need to restrict the output to strings found in > just one section ? (Otherwise you could use the "strings" tool). > > Actually talking of the strings program it might be a lot easier > to augment this tool to restrict its output to a specified section. > It already has a function called strings_a_section() which decides > if a given section should be scanned. It would not take much to > enhance this function to test for a named section... > Thanks for your suggestions, Nick! In fact, as Jan already mentioned, I can get the contents of the named section with the help of objcopy --dump-section secname=secoutfile ... And I need redirect the output to null (I don't need it), because I cannot get raw output for this section by using --output-target, see my reply https://sourceware.org/pipermail/binutils/2024-January/132041.html This solutions needs an intermediate file in the comparison with non-platform-independent solution, but more simple: readelf -p secname | grep sometext And I don't need the strings utility, because I know the content of this section is a ASCII text with spaces that was added with the command: objcopy --add-section secname=secfile --set-section-flags secname=noload,readonly ... Regards, Max > --