Bug 185096 - ld --as-needed causes either crash or BFD internal error
ld --as-needed causes either crash or BFD internal error
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: binutils (Show other bugs)
rawhide
All Linux
medium Severity high
: ---
: ---
Assigned To: Jakub Jelinek
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-03-10 11:39 EST by Dmitry V. Levin
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-05-09 10:58:06 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Sourceware 2434 None None None Never

  None (edit)
Description Dmitry V. Levin 2006-03-10 11:39:46 EST
ld --as-needed sometimes fails with internal error.
I constructed a small testcase described below.

$ cat sample.cc
extern void foo(void);
void my() { foo(); }

$ g++ -Wl,--no-as-needed -shared -Wall -fPIC sample.cc -lsupc++; echo rc=$?
rc=0

$ g++ -Wl,--as-needed -shared -Wall -fPIC sample.cc -lsupc++; echo rc=$?
/usr/bin/ld: BFD 2.16.91.0.6 20060212 assertion fail elflink.c:2317     
/usr/bin/ld: BFD 2.16.91.0.6 20060212 assertion fail elflink.c:2318
[last two lines repeated many times]
/usr/bin/ld: BFD 2.16.91.0.6 20060212 internal error, aborting at elflink.c line
6453 in elf_link_output_extsym

/usr/bin/ld: Please report this bug.

collect2: ld returned 1 exit status
rc=1

Tested with binutils-2.16.91.0.6-4 and gcc-c++-4.1.0-3 on i686 and x86_64.
Comment 1 Dmitry V. Levin 2006-03-13 18:44:10 EST
Even more simple test causes ld to crash in BFD:
$ g++ -shared -Wl,--as-needed -Wl,--whole-archive `gcc
-print-file-name=libsupc++.a` -Wl,--no-whole-archive
collect2: ld terminated with signal 11 [Segmentation fault]
/usr/bin/ld: BFD 2.16.91.0.6 20060212 assertion fail elflink.c:2317
/usr/bin/ld: BFD 2.16.91.0.6 20060212 assertion fail elflink.c:2318
[last two lines repeated 149 times]
Comment 2 Dmitry V. Levin 2006-05-09 10:58:06 EDT
Fixed upstream in 2.17.50.0.1-1.

Note You need to log in before you can comment on or make changes to this bug.