ld terminated with signal 11

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

  1. 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

using namespace std;

int main() { cout

Reply to
vsouders
Loading thread data ...

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.

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 " > 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 (broeker@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.
Reply to
Hans-Bernhard Broeker

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
Reply to
Tauno Voipio

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

Reply to
vsouders

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

Reply to
vsouders

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

--
Chuck F (cbfalconer@yahoo.com) (cbfalconer@worldnet.att.net)
   Available for consulting/temporary embedded and systems.
     USE worldnet address!
Reply to
CBFalconer

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 
 "show options" at the top of the article, then click on the 
 "Reply" at the bottom of the article headers." - Keith Thompson
Reply to
CBFalconer

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

Reply to
vsouders

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.