[Bug tools/24809] eu-unstrip to drop SECTION symbols if section .note.gnu.gold-version present

mark at klomp dot org sourceware-bugzilla@sourceware.org
Mon Jul 15 12:59:00 GMT 2019


--- Comment #1 from Mark Wielaard <mark at klomp dot org> ---
I can replicate this if I use objcopy to produce the hello.debug and
hello.stripped binaries. But why don't you just use eu-strip?

$ eu-strip -f hello.debug -o hello.stripped hello
$ eu-unstrip hello.stripped hello.debug -o hello.unstripped

$ ls -la
-rwxrwxr-x. 1 mark mark 10416 Jul 15 14:50 hello
-rw-rw-r--. 1 mark mark    92 Jul 15 14:50 hello.c
-rwxrwxr-x. 1 mark mark  6840 Jul 15 14:52 hello.debug
-rwxrwxr-x. 1 mark mark  6488 Jul 15 14:52 hello.stripped
-rwxrwxr-x. 1 mark mark 10416 Jul 15 14:52 hello.unstripped

$ readelf -s hello.debug | grep -c SECTION
$ readelf -s hello.stripped | grep -c SECTION
$ readelf -s hello.unstripped | grep -c SECTION

Which seems much more reasonable than what objcopy does.

I am not sure eu-unstrip should remove extra stuff objcopy adds. It seems that
if the user created these bigger than necessary .debug and .stripped files,
then they wanted that for some reason. It seems unwise to second guess the

If there is a bug, then I think it is simply a bug in objcopy, which can be
prevented by using eu-strip instead.

You are receiving this mail because:
You are on the CC list for the bug.

More information about the Elfutils-devel mailing list