* [ECOS] initialization priority workaround
@ 2000-02-17 11:42 James Robertson
2000-02-17 12:26 ` Jonathan Larmour
0 siblings, 1 reply; 2+ messages in thread
From: James Robertson @ 2000-02-17 11:42 UTC (permalink / raw)
To: ecos-discuss
Hi,
I'm building eCos using gcc 2.8.1. Yes, this gcc doesn't support the
initialization priority feature that eCos uses for constructor ordering.
Unfortunately, this is a custom modified gcc, and I'm not able to upgrade to
2.95 at this time. I've written a perl script to reorder the __CTOR_LIST__ by
hand, but I was wondering if there were any better workarounds. Did you have any
workaround before you put the constructor ordering in gcc?
James
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [ECOS] initialization priority workaround
2000-02-17 11:42 [ECOS] initialization priority workaround James Robertson
@ 2000-02-17 12:26 ` Jonathan Larmour
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Larmour @ 2000-02-17 12:26 UTC (permalink / raw)
To: James Robertson; +Cc: ecos-discuss
James Robertson wrote:
>
> Hi,
> I'm building eCos using gcc 2.8.1. Yes, this gcc doesn't support the
> initialization priority feature that eCos uses for constructor ordering.
> Unfortunately, this is a custom modified gcc, and I'm not able to upgrade to
> 2.95 at this time. I've written a perl script to reorder the __CTOR_LIST__ by
> hand, but I was wondering if there were any better workarounds. Did you have any
> workaround before you put the constructor ordering in gcc?
We hacked the linker script to manually order the constructors in the
__CTOR_LIST__ by matching the various object files the constructor symbols
came from. Like so (from the old code):
#ifdef CYG_KERNEL_USE_INIT_PRIORITY
__CTOR_LIST__ = .;
KEEP(*(SORT(.ctors*)))
__CTOR_END__ = .;
__DTOR_LIST__ = .;
KEEP(*(SORT(.dtors*)))
__DTOR_END__ = .;
#else
__CTOR_LIST__ = .;
*sched.o(.ctors*)
*clock.o(.ctors*)
*thread.o(.ctors*)
*(.ctors*)
__CTOR_END__ = .;
__DTOR_LIST__ = .;
*(.dtors)
__DTOR_END__ = .;
#endif
To be honest, your perl script is probably the best thing in the absence of
the compiler feature.
Jifl
--
Red Hat, 35 Cambridge Place, Cambridge, UK. CB2 1NS Tel: +44 (1223) 728762
"Plan to be spontaneous tomorrow." || These opinions are all my own fault
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2000-02-17 12:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-02-17 11:42 [ECOS] initialization priority workaround James Robertson
2000-02-17 12:26 ` Jonathan Larmour
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).