readelf --string-dump analog for objdump
Jan Beulich
jbeulich@suse.com
Tue Jan 23 07:41:33 GMT 2024
On 22.01.2024 18:19, Maxim Dementyev wrote:
> On Mon, Jan 22, 2024 at 1:19 PM Jan Beulich <jbeulich@suse.com> wrote:
>
>> On 22.01.2024 13:11, Maxim Dementyev wrote:
>>> 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?
>>
>> I'm using GNU objcopy (Gentoo 2.41 p4) 2.41.0.
>
> There is no such a type for --output-target as raw
> (invalid bfd target), only binary;
> but this format produces a file with zero length.
Not for me. Did you specify -j <section> for the tool to know
what to copy?
> At the same time, if I do not use this option,
> by default it's elf64-x86-64 and the size is 816 bytes.
Of course.
> The file generated by --dump-section has the length
> of 198 bytes, and this is all that I need,
> no other stuff.
Well, if that is what you need, then I see no problem with you
going this route. I merely wanted to point out that there is an
alternative. (I was actually surprised when I first saw
--dump-section, as that looks to me like merely shorthand for the
-O / -j combination.)
Jan
More information about the Binutils
mailing list