Subject: Re: cpufunc.h
To: Ben Harris <>
From: Richard Earnshaw <>
List: port-arm
Date: 06/01/2001 21:37:57
> > (2) It wouldn't link, complaining about the absence of __gcc_main.
> Are you sure you don't mean "__gccmain"?  Several of the ARM targets
> (though not arm-*-netbsd or arm-*-netbsdelf) define NAME__MAIN and
> SYMBOL__MAIN to this, apparently because the ARM libraries already include
> a function called __main.  Since we don't use ARM's libraries, this isn't
> necessary on NetBSD.  Come to that, I'm not sure the __main hack is
> necessary at all.

Yep, in the ARM toolkit world __main used to call main (it may still do), 
which was bad news if gcc then tried to call __main to initialize its 
constructors and destructors.

The __main hack is need on a.out platforms; but not on ELF, which has 
support for constructor and destructor sections which the loader knows to 
call automagically.

> It looks like, in both cases, your problems come from GCC's not being
> configured correctly, rather than from bugs in the kernel.

Or some of the netbsd local hacks haven't been fed back into the master 
sources: this could be all part of the nightmare on gnu assignments issues.