Hi OpenRISC gurus:

What's the status of C++ support for the bare (non-Linux) toolchain? Is the GCC 
/ newlib / libgloss support ready?


I'm trying to write a simple test case in C++ and I'm having trouble. I have a 
little experience with linker script files and start-up code, but it's not 
enough and I haven't been able to figure it out yet. I found no mention of C++ 
in the OpenRISC ABI.


The Test Suite does not use newlib at the moment, and I'm not trying to support 
the full C++ library, just the basic language features. I guess I'll have to 
write something like this in the linker script file:

        PROVIDE (__CTOR_LIST__ = .);
  .ctors      : { *(.ctors) }  /* maybe with SORT(...) */
        PROVIDE (__CTOR_END__ = .);


I'm guessing the OpenRISC port of GCC generates that kind of pointer table, as 
I think there are other ways. I will also have to write some code that goes 
through the list of pointerts and calls all the functions.

I suspect supporting C++ exceptions will be harder. I learnt some time ago that 
GCC is able to generate two types of exception information. With the first 
type, the code sorts the exception tables itself the first time one is thrown, 
which can be problematic if you have multiple threads. Therefore, you also have 
to write support for critical sections and the like in your OS, in a way that 
the GCC support libraries can use it. There's also the sorting penalty on the 
first touch.


With the second type of exception information, the linker sorts the exception 
tables and they can be placed in a read-only section. Not all real-time OSes 
support this newer format though. This is all not very good documented.


Can anybody point me in the right direction?


Thanks,
  rdiez

_______________________________________________
OpenRISC mailing list
[email protected]
http://lists.openrisc.net/listinfo/openrisc

Reply via email to