[LLVMdev] static initialization

Hiesgen, Raphael Raphael.Hiesgen at haw-hamburg.de
Tue Nov 25 23:48:51 PST 2014


Hi there,

I am currently working on the native port of an embedded OS and trying to get static initialization to work. We have our own startup code to handle things before the main is called. When using gcc I acquire the function pointers to the initializer array and iterate over them. I asked on the llvm IRC channel and got this helpful guide [1] for gcc. Apparently it works in a similar way on clang, but remains silent on the details.

Is there a more detailed documentation I have overlooked or could you give me a hint how to acquire function pointers?

Thanks
Raphael


[1] http://wiki.osdev.org/Calling_Global_Constructors



More information about the llvm-dev mailing list