Bug 10982 - objcopy brings 'invalid operation' when adding debug link section
Summary: objcopy brings 'invalid operation' when adding debug link section
Status: RESOLVED INVALID
Alias: None
Product: binutils
Classification: Unclassified
Component: gold (show other bugs)
Version: 2.21
: P2 normal
Target Milestone: ---
Assignee: Ian Lance Taylor
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-11-18 20:53 UTC by robert.wohlrab
Modified: 2009-11-30 15:12 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description robert.wohlrab 2009-11-18 20:53:00 UTC
From Debian bug:

Matthias Klose wrote:
[....]
> > `debian/sauerbraten-dbg/usr/lib/debug//usr/lib/games/sauerbraten/sauer_cl
> >ient': Invalid operation dh_strip: objcopy returned exit code 1
> >
> > Is this a known problem with binutils-gold?
> 
> yes, I did see this as well recently.
Could it be that it is new with 2.20-3 or 2.20-4? I think I didn't saw that in
earlier version. I think I saw it the first time when compiling batctl - which
I compiled right after update of my Sources file. This was after the 11.
November.

I wanted to write a bug report right now but haven't a glue why it fails.

objcopy --only-keep-debug debian/batctl/usr/sbin/batctl debian/batctl-

seems to work without any problems. The real problem is 

objcopy --add-gnu-debuglink debian/batctl-dbg/usr/lib/debug//usr/sbin/batctl
debian/batctl/usr/sbin/batctl

So a small test would be:

$ echo 'int main() { return 0; }' > test.c && \
 gcc -g3 test.c -o test && \
 objcopy --only-keep-debug test test.dbg && \
 objcopy --add-gnu-debuglink=./test.dbg test && echo "cool it works"
objcopy:stCdJOm4: cannot create debug link section `./test.dbg': Invalid
operation

This works with the old linker, but not with binutils-gold

So I build the cvs version of the linker and objcopy and it is the same here. 
So it is propably an upstream bug.

Downstream bug can be found at http://bugs.debian.org/556951
Comment 1 Matthias Klose 2009-11-19 02:00:08 UTC
unsure if this really is a binutils/gold bug; it's only seen in Debian unstable
with a recent glibc upload. not in testing or Ubuntu.
Comment 2 robert.wohlrab 2009-11-19 10:57:03 UTC
According to http://bugs.debian.org/556951 it is a Debian specific eglibc bug.
Comment 3 Michal Nowak 2009-11-30 15:06:16 UTC
(In reply to comment #2)
> According to http://bugs.debian.org/556951 it is a Debian specific eglibc bug.

Can we close this then?
Comment 4 robert.wohlrab 2009-11-30 15:12:44 UTC
Yes, wanted to wait until I had a change to test the eglibc fix.