cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Visitor
Visitor
5,866 Views
Registered: ‎10-18-2007

Microblaze and C++

We are using a custom C-runtime init (we need to save some register contents and pass them as arguments to main).  But we are having trouble getting the global contructors to be called.
 
First off, I notice that if I link with mb-g++, I get the __init and __fini functions fleshed out, including calls to __do_global_ctors_aux and __do_global_dtors_aux.  But these functions are not to be found anywhere.  I also note that the crtbegin.o and crtend.o called out in the elf32microblaze.x is not to be found anywhere.
 
However, since we are using custom C-runtime, we can't link with mb-g++, because it complains about duplicate symbols.  I do not want the Xilinx provided C-runtime init, but I do want the Xilinx provided __init and __fini.  And mb-g++
 
Doesn't mb-g++ call mb-ld?  How does mb-g++ create and insert these symbols and pass them to mb-ld?
 
Is there source code available for the __init and __fini functions (and the related __do_global_ctors_aux and __do_global_dtors_aux)?
 
Is there a linker command line option to generate the __init and __fini code?
0 Kudos
0 Replies