Bug 6498 - binaries linked with gold cannot be stripped
Summary: binaries linked with gold cannot be stripped
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: gold (show other bugs)
Version: 2.19
: P2 normal
Target Milestone: ---
Assignee: Ian Lance Taylor
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-08 14:21 UTC by Matthias Klose
Modified: 2008-05-30 04:18 UTC (History)
1 user (show)

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


Attachments
test binary (303.49 KB, application/octet-stream)
2008-05-08 14:23 UTC, Matthias Klose
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Klose 2008-05-08 14:21:39 UTC
trying to build a debian package with gold; the packaging strips each binary
before building the final package; about 3000 packages fail to build with this
or a similiar error:

strip --remove-section=.comment --remove-section=.note debian/a2ps/usr/bin/a2ps
BFD: debian/a2ps/usr/bin/stgTUPUK: section `.dynsym' can't be allocated in segment 3
LOAD: .dynsym .dynstr .hash .gnu.hash .interp .gnu.version .gnu.version_r
strip:debian/a2ps/usr/bin/stgTUPUK[.text]: Bad value
BFD: debian/a2ps/usr/bin/stgTUPUK: section `.dynsym' can't be allocated in segment 3
LOAD: .dynsym .dynstr .hash .gnu.hash .interp .gnu.version .gnu.version_r
strip:debian/a2ps/usr/bin/stgTUPUK: Bad value
Comment 1 Matthias Klose 2008-05-08 14:23:41 UTC
Created attachment 2727 [details]
test binary
Comment 2 Ian Lance Taylor 2008-05-30 04:18:57 UTC
This is a known bug when using old versions of strip on x86_64.  It happens
because the default page size for gold for x86_64 is 0x1000.  The default page
size for old versions of the GNU binutils for x86_64 was 0x100000.  Using an old
version of strip on an executable with a page size smaller than the default
would fail.

I believe this bug was fixed in the GNU binutils on 2006-05-27 (i.e., long
before gold was released) with this patch:
http://sourceware.org/ml/binutils/2006-05/msg00476.html

If you still see failures with a version of strip built after that date (i.e.,
binutils 2.18 or later), please reopen this bug.

Thanks for reporting it.