ld terminated with signal 11

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
I'm working on setting up an ARM toolchain under Linux.  I've installed
binutils 2.10, arm-gcc 2.95.2 and glibc 2.1.3.  When I try to compile
the simple test code shown below, the linker terminates with a signal
11.  If I remove the iostream include and the cout statement, the
application compiles and links without errors.  Does this mean the
linker is attempting to link against an incorrect lib version?  I've
set up a similar tool chain on Windows using cygwin and didn't have
this issue.  Any help would be much appreciated.

Thanks,
Vance

#include <iostream>

using namespace std;

int main()
{
  cout << "Hello ARM" << endl;
  return 0;
}


Re: ld terminated with signal 11

Quoted text here. Click to load it

Signal 11 on a x86 Linux box is a segfault.  Tradtionally, the most
likely reason for that to occur in a GCC run is unstable hardware,
often flaky RAM --- GCC uses pointers all over the place extensively
enough that any memory glitch is almost guaranteed to crash it.  The
linker OTOH isn't particularly renowned for serving as hardware tester
in this way --- but that's usually because GCC will have crashed long
before the linker even gets to be run on a job large enough to trigger
this.

Quoted text here. Click to load it

Quite possibly.  Add -v and perhaps -Wl,-v flags to your link command
and observe what's actually happening.  Pay special attention to what
startup code and libraries get used.

And BTW: before you call that test code "simple", do yourself a favour
and look at what the preprocessor makes out of it.  Here's a small
experiment using a more current GCC and native tools on Linux:

~> echo "#include <iostream>" > tt.cc
~> gcc -E tt.cc | wc
  27753   66420  717061

I don't know about you, but I'm not particularly willing to accept
more than half a megabyte of C++ source as being a "simple test code".
The 'gcc -Q' listing of all method names alone is 125 kB!

--
Hans-Bernhard Broeker ( snipped-for-privacy@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.

Re: ld terminated with signal 11
Quoted text here. Click to load it

Are you trying to compile/link C++ code with the 'gcc' command?
It will not link properly. C++ must be linked with 'g++'.

GCC 2.95 is very old, and the ARM support is somewhat
kludged on it. Please get a GCC 3.x.y series compiler
with suitable version of binutils and libraries.

The 'simple' C++ program creates HUGE amounts of
code when expanded. Start with a pure C program.

There is little (or no at all) sense to attempt C++
before plain C is running OK.

If you're targeting an embedded system without an
operating system, please understand that the standard
I/O library needs a lot of other code to run. This
applies to stdio.h as well as the iostream functions.

--

Tauno Voipio
tauno voipio (at) iki fi


Re: ld terminated with signal 11
When I don't use a make file, I can compile and link the above program.
 After compilation, I used the file command to verify that it was an
ARM executable.  However, when I copy the program to a Zaraus 5600 PDA
and attempt to execute it, I get:

hello_arm: command not found.

Any ideas?

-Vance


Re: ld terminated with signal 11
Okay,

If I build the above program from the command line without using make,
it successfully compiles and links.  Using the file command, I can
verify that it is an ARM executable but when I copy it over to a Zaraus
5600 PDA and attempt to run the application I get:

hello_arm: command not found

Any ideas?

Thanks,
Vance


Re: ld terminated with signal 11
Quoted text here. Click to load it

What 'above program'?  You have to include adequate context with
your replies.  Every message needs to stand by itself.  See my sig
below for a way of using the inadequate google interface to usenet.

--
"If you want to post a followup via groups.google.com, don't use
 the broken "Reply" link at the bottom of the article.  Click on
We've slightly trimmed the long signature. Click to see the full one.
Re: ld terminated with signal 11
Guys,

Thanks for all of the replies.  The problem ended up being a mistake in
my MAKE file.  I had:

.cc.o
    $(CC) -c $<

while the source file ended in .cpp.  The linker core dumping on this
seems a bit extreme.  Also, thanks for the heads up about my outdated
GCC.

I think I'll stick to straight C for my test code from now on :)

-Vance


Re: ld terminated with signal 11
Quoted text here. Click to load it

Nothing written in C++ is simple.  The libraries are monstrous, and
change continuously.  Stick to C.

--
Chuck F ( snipped-for-privacy@yahoo.com) ( snipped-for-privacy@worldnet.att.net)
   Available for consulting/temporary embedded and systems.
We've slightly trimmed the long signature. Click to see the full one.

Site Timeline