global contructors

Philippe Simons loki_666 at fastmail.fm
Fri Aug 25 18:50:24 UTC 2006


adding #define __USE_INIT_FINI__ to
/cpukit/score/cpu/arm/rtems/score/arm.h
made the trick.

Global contructors and destructors are now working fine for ARM.
Should i submit a PR for this?

Philippe

On Fri, 25 Aug 2006 08:08:05 +1000, "Chris Johns" <chrisj at rtems.org>
said:
> Philippe Simons wrote:
> > So i need to add "builtin_define ("__USE_INIT_FINI__");" to
> > arm/rtemself.h or add a #ifdef __ELF__ to _Thread_Handler?
> > 
> 
> We are the only OS putting __USE_INIT_FINI__ into gcc so I have to 
> wonder why we do this. There is no code in gcc or newlib that depends on
> it.
> 
> There was a time when we supported m68k-coff and m68k-elf and this was 
> the solution. The coff and elf systems handled static constructors 
> differently.
> 
> The main point behind the __ELF__ comment was based on all our targets 
> now supporting ELF. Looking more I see we have a couple of targets such 
> as H8300 and SH that do not have __USE_INIT_FINI__. GCC has a comment 
> about some ELF targets "use crtstuff.c to provide __CTOR_LIST__" so it 
> may not be completely safe. The H8300 and SH may be such targets.
> 
> Another solution is to add __USE_INIT_FINI__ to the RTEMS cpu header 
> file and remove it from gcc.
> 
> Ralf maintains the tools and it is his call on what to do.
> 
> Regards
> Chris

-- 
http://www.fastmail.fm - Does exactly what it says on the tin




More information about the users mailing list