codesourcery toolchain 2009: Linker Script

Hello!

I've been wandering around the net to resolve my linker script problem
using arm-none-eabi (e.g. Codesourcery g++ lite edition)

I hope you guys can help me.

Here is my condition:

I have beagleboard running Angstrom Linux

I have arm-none-eabi-gcc compiler on my host computer.

I tried to compile this simple hello.c:

#include <stdio.h>

int main(){

        printf("hello!\n");
        return 0;
}

i.e. ./bin/arm-none-eabi-gcc hello.c -o hello

but it gave me:

/home/dio/sandbox/toolchain/arm-2007q3/bin/../lib/gcc/arm-none-eabi/
4.2.1/../../../../arm-none-eabi/bin/ld: warning: cannot find entry
symbol _start; defaulting to 00008018
/home/dio/sandbox/toolchain/arm-2007q3/bin/../lib/gcc/arm-none-eabi/
4.2.1/../../../../arm-none-eabi/lib/libc.a(lib_a-makebuf.o): In
function `__smakebuf':
makebuf.c:(.text+0xf8): undefined reference to `isatty'
/home/dio/sandbox/toolchain/arm-2007q3/bin/../lib/gcc/arm-none-eabi/
4.2.1/../../../../arm-none-eabi/lib/libc.a(lib_a-sbrkr.o): In function
`_sbrk_r':
sbrkr.c:(.text+0x18): undefined reference to `_sbrk'
/home/dio/sandbox/toolchain/arm-2007q3/bin/../lib/gcc/arm-none-eabi/
4.2.1/../../../../arm-none-eabi/lib/libc.a(lib_a-writer.o): In
function `_write_r':
writer.c:(.text+0x20): undefined reference to `_write'
/home/dio/sandbox/toolchain/arm-2007q3/bin/../lib/gcc/arm-none-eabi/
4.2.1/../../../../arm-none-eabi/lib/libc.a(lib_a-closer.o): In
function `_close_r':
closer.c:(.text+0x18): undefined reference to `_close'
/home/dio/sandbox/toolchain/arm-2007q3/bin/../lib/gcc/arm-none-eabi/
4.2.1/../../../../arm-none-eabi/lib/libc.a(lib_a-fstatr.o): In
function `_fstat_r':
fstatr.c:(.text+0x1c): undefined reference to `_fstat'
/home/dio/sandbox/toolchain/arm-2007q3/bin/../lib/gcc/arm-none-eabi/
4.2.1/../../../../arm-none-eabi/lib/libc.a(lib_a-lseekr.o): In
function `_lseek_r':
lseekr.c:(.text+0x20): undefined reference to `_lseek'
/home/dio/sandbox/toolchain/arm-2007q3/bin/../lib/gcc/arm-none-eabi/
4.2.1/../../../../arm-none-eabi/lib/libc.a(lib_a-readr.o): In function
`_read_r':
readr.c:(.text+0x20): undefined reference to `_read'
collect2: ld returned 1 exit status

If I put "-T generic.ld" it is compiled OK but gives segmentation
fault message on my Beagle.

How to generate the correct linker script?

Thanks for your attention!

Best,

Dio

Dio wrote:

Hello!

I've been wandering around the net to resolve my linker script problem
using arm-none-eabi (e.g. Codesourcery g++ lite edition)

I hope you guys can help me.

Here is my condition:

I have beagleboard running Angstrom Linux

I have arm-none-eabi-gcc compiler on my host computer.

I tried to compile this simple hello.c:

#include <stdio.h>

int main(){

        printf("hello!\n");
        return 0;
}

Assuming you want to run above program as Linux user space application
(under Angstrom), have you tried to use

arm-none-linux-gnueabi-gcc

instead of arm-none-eabi-gcc?

http://www.codesourcery.com/sgpp/lite/arm/portal/release858

Best regards

dirk

From: beagleboard@googlegroups.com
[mailto:beagleboard@googlegroups.com] On Behalf Of Dio
Sent: Thursday, September 03, 2009 9:04 PM
To: Beagle Board
Subject: [beagleboard] codesourcery toolchain 2009: Linker Script

Hello!

I've been wandering around the net to resolve my linker script problem
using arm-none-eabi (e.g. Codesourcery g++ lite edition)

Koen is going to blow a gasket!!!

You should use the OE cross compiler if you are targeting the Angstrom file
system. If you have OE installed, you will find the compiler in
tmp/cross/armv7a/bin