This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Tidy up arm-elf header files
On Wed, Sep 05, 2001 at 05:55:45PM +0100, Nick Clifton wrote:
> Umm, what needs to be changed ? I am unfamilair with this area.
arm-elf appears to be using __main, called from main, to
run constructors. The preferred method for ELF is to have
a .init section, which collects instructions for a function
called _init. It is constructed from 4 pieces, crti.o,
crtbegin.o, crtend.o, crtn.o.
You'll need to write crt[in].asm files for arm. Examine
any of the implementations for other chips for inspiration;
ask if you have questions.
You'll need to enable building crtstuff.c. This is where
you get crtbegin/crtend.
You'll need to modify newlib/libc/sys/arm/crt0.S to register
_fini with atexit, then invoke _init, all before calling main.
I dunno if you want to change arm to use libgloss at the same
time. It would be nice, I suppose.
I've probably forgotten something, but that should be 99% there.
r~