Gentoo Archives: gentoo-embedded

From: Mike Frysinger <vapier@g.o>
To: gentoo-embedded@l.g.o
Cc: Christopher Friedt <chrisfriedt@×××××.com>
Subject: Re: [gentoo-embedded] gcc question - entry point problem in small, static app
Date: Tue, 31 Mar 2009 08:07:07
Message-Id: 200903310407.05008.vapier@gentoo.org
In Reply to: Re: [gentoo-embedded] gcc question - entry point problem in small, static app by Christopher Friedt
1 On Monday 30 March 2009 08:03:01 Christopher Friedt wrote:
2 > On Mon, Mar 30, 2009 at 12:08 PM, Ahmed Ammar wrote:
3 > > You are saying that this code is expected to run by the bootloader (i.e.
4 > > no linux) therefore shouldn't you be using a non *-linux-* ? i.e.
5 > > something like armv5te-softfloat-elf?
6 >
7 > Yeah, it is non-linux... I just don't feel like going through the
8 > trouble of building a new toolchain to compile / assemble some code
9 > that doesn't require any syscalls whatsoever. It is intended to be run
10 > directly from the bootloader.
11
12 then you cant use any libraries/files from glibc or gcc because they're
13 assuming a Linux environment. that means you need to use -nostdlib. then you
14 need to provide code to setup the C runtime environment (the "start" symbol
15 entry point) which will tail off to the main() function.
16
17 also, the default linker script is targetting a Linux environment which means
18 you'll probably also have to write your own linker script.
19 -mike

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-embedded] gcc question - entry point problem in small, static app Christopher Friedt <chrisfriedt@×××××.com>