public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* collect2: ld terminated with signal 11 [Segmentation fault]
       [not found] ` <20070908192921.32180.qmail@sourceware.org>
@ 2007-09-08 22:01   ` Don Cohen
  2007-09-08 22:36     ` Mike Frysinger
  0 siblings, 1 reply; 5+ messages in thread
From: Don Cohen @ 2007-09-08 22:01 UTC (permalink / raw)
  To: binutils


Is this the place to report bugs or ask for help?

I hope all will be clear from the following transcript.
I'm hoping for advice on what to do (upgrade?) to fix the problem or
failing that what to do to help diagnose it.

===
dcohen@saturn:~/mysql-5.0.45/client> g++ -O3 -DDBUG_OFF
-fno-implicit-templates 
-fno-exceptions -fno-rtti -rdynamic -o .libs/mysql mysql.o readline.o sql_string.o completion_hash.o  ../cmd-line-utils/libedit/libedit.a -lncurses ../libmysql/.libs/libmysqlclient.so -lcrypt -lnsl -lm -lz -Wl,--rpath -Wl,/home/dcohen/mysql/lib/mysql
collect2: ld terminated with signal 11 [Segmentation fault]
dcohen@saturn:~/mysql-5.0.45/client> g++ --version
g++ (GCC) 4.1.0 (SUSE Linux)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There
is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.

dcohen@saturn:~/mysql-5.0.45/client> uname -a
Linux saturn 2.6.16.27-0.9-default #1 SMP Tue Feb 13 09:35:18 UTC 2007
ia64
ia64 ia64 GNU/Linux
dcohen@saturn:~/mysql-5.0.45/client>

===

pinskia at gcc dot gnu dot org writes:
 > ------- Comment #1 from pinskia at gcc dot gnu dot org  2007-09-08 19:29 -------
 > This is ld crashing and ld is part of the binutils project.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: collect2: ld terminated with signal 11 [Segmentation fault]
  2007-09-08 22:01   ` collect2: ld terminated with signal 11 [Segmentation fault] Don Cohen
@ 2007-09-08 22:36     ` Mike Frysinger
  2007-09-09  3:43       ` [Bug other/33357] " Don Cohen
  0 siblings, 1 reply; 5+ messages in thread
From: Mike Frysinger @ 2007-09-08 22:36 UTC (permalink / raw)
  To: binutils; +Cc: Don Cohen

[-- Attachment #1: Type: text/plain, Size: 452 bytes --]

On Saturday 08 September 2007, Don Cohen wrote:
> Is this the place to report bugs or ask for help?

yes

> I hope all will be clear from the following transcript.
> I'm hoping for advice on what to do (upgrade?) to fix the problem or
> failing that what to do to help diagnose it.

you should start with what version of binutils you're actually using ... run 
`ld --version`

if that version != 2.18, then you should first upgrade
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 827 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug other/33357] collect2: ld terminated with signal 11 [Segmentation fault]
  2007-09-08 22:36     ` Mike Frysinger
@ 2007-09-09  3:43       ` Don Cohen
  2007-09-17 12:10         ` Nick Clifton
  0 siblings, 1 reply; 5+ messages in thread
From: Don Cohen @ 2007-09-09  3:43 UTC (permalink / raw)
  To: pinskia, vapier, gcc-bugzilla, binutils

pinskia at gcc dot gnu dot org writes:
 > This is ld crashing and ld is part of the binutils project.
Mike Frysinger writes:
 > you should start with what version of binutils you're actually using ... run 
 > `ld --version`
 > if that version != 2.18, then you should first upgrade

Thank you both for your replies.  I have now built binutils 2.18.
However I'm not root on this machine and so cannot install it in the
place where the original command (g++ -O3 -DDBUG_OFF ...) will find
it.  Can either of you tell me how to arrange for the g++ command to
use the version of ld I've just built?
I see at least two problems here.  First, g++ is not simply calling ld
on the same arguments - when I replace g++ with ld I get an error
about unrecognized option -DDBUG_OFF.
Second, I suspect that the ld I just built is the file
~/binutils-2.18/ld/ld-new - is that correct?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Bug other/33357] collect2: ld terminated with signal 11 [Segmentation  fault]
  2007-09-09  3:43       ` [Bug other/33357] " Don Cohen
@ 2007-09-17 12:10         ` Nick Clifton
  2007-09-17 16:42           ` Don Cohen
  0 siblings, 1 reply; 5+ messages in thread
From: Nick Clifton @ 2007-09-17 12:10 UTC (permalink / raw)
  To: Don Cohen; +Cc: pinskia, vapier, gcc-bugzilla, binutils

Hi Don,

> Thank you both for your replies.  I have now built binutils 2.18.
> However I'm not root on this machine and so cannot install it in the
> place where the original command (g++ -O3 -DDBUG_OFF ...) will find
> it.  Can either of you tell me how to arrange for the g++ command to
> use the version of ld I've just built?

There are several possibilities:

   1. Build your own local version of g++ as well and install everything in 
your own local install tree.  This might be a good idea if you have other bugs 
in the compiler or linker that you might want to track down.

   2. Compile everything to object files first.  Then perform a final link 
adding "-v" to the gcc command line.  This will show you the linker command 
line that gcc is using.  Copy this command line, replacing the name of the 
linker program with the path to your own, newly built linker.

      The problem with this approach is that you are using g++.  (If you are 
not compiling C++ sources then switch to gcc and you will not encounter the 
following problem).  The problem is that g++ does not invoke the linker 
directly.  Instead it uses an intermediary program called collect2 which 
performs some additional work before invoking the linker.  This could still be 
worked around if it were not for the fact that g++ communicates some critical 
information to collect2 via environment variables rather than the command line. 
  These variables are not shown in the "g++ -v" output and they include the 
path to the linker that collect2 invokes.  [A big design bug imho].  Try adding 
"--Wl,-debug" to the g++ command line to see some output from collect2.

    The simplest way around this problem is to still use g++ to perform the 
final link, but to rename your newly built linker executable to "real-ld" and 
put it in your PATH somewhere.  (I normally use the current directory where I 
am running my tests).  Collect2 should look for an executable called "real-ld" 
first and if it cannot find one, then use "collect-ld" or "ld" or something 
else which will probably be in the path given to it by the compiler, and not in 
a path controllable by you.

> I see at least two problems here.  First, g++ is not simply calling ld
> on the same arguments - when I replace g++ with ld I get an error
> about unrecognized option -DDBUG_OFF.

> Second, I suspect that the ld I just built is the file
> ~/binutils-2.18/ld/ld-new - is that correct?

Correct.  When the built ld-new executable is installed it is renamed to ld.

Cheers
   Nick


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Bug other/33357] collect2: ld terminated with signal 11 [Segmentation fault]
  2007-09-17 12:10         ` Nick Clifton
@ 2007-09-17 16:42           ` Don Cohen
  0 siblings, 0 replies; 5+ messages in thread
From: Don Cohen @ 2007-09-17 16:42 UTC (permalink / raw)
  To: Nick Clifton; +Cc: pinskia, vapier, gcc-bugzilla, binutils

Nick Clifton writes:
 > There are several possibilities:
...
I ended up following the recommendation below - worked fine.
I installed the binutils build into my own directory and then added
the -B.  In fact I just added that to the input I passed to .configure
and the entire mysql build completed without problem.

------- Comment #3 from schwab at suse dot de  2007-09-09 08:09 -------
Use -B${binutils-bindir}, where ${binutils-bindir} is the directory where the
binutils binaries were installed.  `-BPREFIX'      This option specifies where
to find the executables, libraries,      include files, and data files of the
compiler itself.       The compiler driver program runs one or more of the
subprograms      `cpp', `cc1', `as' and `ld'.  It tries PREFIX as a prefix for
each      program it tries to run, both with and without `MACHINE/VERSION/'    
 (*note Target Options::).

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-09-17 16:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-33357-15072@http.gcc.gnu.org/bugzilla/>
     [not found] ` <20070908192921.32180.qmail@sourceware.org>
2007-09-08 22:01   ` collect2: ld terminated with signal 11 [Segmentation fault] Don Cohen
2007-09-08 22:36     ` Mike Frysinger
2007-09-09  3:43       ` [Bug other/33357] " Don Cohen
2007-09-17 12:10         ` Nick Clifton
2007-09-17 16:42           ` Don Cohen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).