_init()

Keith Robertson kjrobert at alumni.uwaterloo.ca
Mon Jul 4 16:05:07 UTC 2005


Ed Sutter wrote:
> Hi!,
> I built the gen405 bsp, with minor modifications to the serial
> port, and when I run it, it drops off the end of the earth when
> _init() is called out of _Thread_Handler().  I see that _init
> is essentially a function prolog, and according to the "Using C++"
> Wiki documentation (thanks Chris) it should be followed by all
> of the constructor initialization calls, and then an epilog.
> I can't find any of that in my build (I'm not even using C++).
> Symbolically, the next entry is _fini, which appears to also be
> a prolog.  After that is just some other data totally unrelated
> to this; hence the execution just takes an exception at that point.
> 
> The Wiki says that alignment of the prolog/calls/epilog is pretty
> tricky and requires that...
> 
>  "... gcc configuration, linkcmds and bsp_specs must harmonize ..."

AFAICT, the gen405 port is a bit borked at the moment.   There are a 
couple of issues (not just this one) that AFAICS would prevent it from 
running on _any_ hardware.  However, it is possible to fix :).  I've 
been working on a modified version extensively without any problems.

I've attached a patch that should help you out.  I had to manually 
construct the patch as there were (unfortunately) some other unrelated 
changes that went in on the same submission to my local subversion 
repository.  So please let me know if you have any problems with it.

I'm not a bsp_specs/_init/_fini expert, so this might not be totally 
correct, but it's working on my test configuration currently.  Again, 
please let me/us know.

> By the way, if I simply remove the call to _init(), the app runs
> fine; however, I want to make sure that's an ok thing to do.

This is presumably because you're not using c++.

Cheers,

Keith

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: gen405_init.patch
URL: <http://lists.rtems.org/pipermail/users/attachments/20050704/793f9105/attachment-0001.ksh>


More information about the users mailing list