Hi, Could anybody help me with crt0.S? I have project, which tightly related to L4. Project written in C++ and use abstract classes. The crt0.S was taken from FIASCO L4 examples and works well with C code. Unfortunately, it does not work with C++ code. Calling constructors for global objects does not work. Program crashed when abstract classes or virtual functions are used. It seems, virtual tables is not initialized. Guess a __static_initialization_and_destruction_0 function was not called. Does anybody have a C++ compatible crt0.S? Alexei
Hello all, thanks for you help ^) Solution below. --- The modified part of a crt0.S ----- ENTRY(start) leal stack,%esp call SYMBOL_NAME(crti) call SYMBOL_NAME(main) call SYMBOL_NAME(crte) pushl %eax call exit ---- Put that in some place ----- extern "C" void __static_initialization_and_destruction_0(int, int); extern "C" void crti (void) { __static_initialization_and_destruction_0(1, 0xffff); } extern "C" void crte (void) { __static_initialization_and_destruction_0(0, 0xffff); } It is a really dirty hack. ----- Original Message ----- From: "Alexey Mandrookin" <alman@mgateinc.com> To: <l4-hackers@os.inf.tu-dresden.de> Sent: Tuesday, October 15, 2002 2:41 PM Subject: crt0.S and C++
Hi,
Could anybody help me with crt0.S?
I have project, which tightly related to L4. Project written in C++ and use abstract classes.
The crt0.S was taken from FIASCO L4 examples and works well with C code.
Unfortunately, it does not work with C++ code. Calling constructors for global objects does not work. Program crashed when abstract classes or virtual functions are used. It seems, virtual tables is not initialized. Guess a __static_initialization_and_destruction_0 function was not called.
Does anybody have a C++ compatible crt0.S?
Alexei _______________________________________________ l4-hackers mailing list l4-hackers@os.inf.tu-dresden.de http://os.inf.tu-dresden.de/mailman/listinfo/l4-hackers
participants (2)
-
Alexey Manddrookin -
Alexey Mandrookin