[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Tue, 30 Apr 2002 23:39:54 -0400
Hello, I just have a question about how the glibc initialization
routines work. I'm writing an OS kernel in C++ (for academic purposes).
The problem is that using certain features such as exceptions and global
static constructors requires support from the C++ runtime. Under gcc 3.0
and up, the details of runtime are specified by the new x86 C++ ABI
standard. However, the runtime library has some dependencies on glibc.
Most of them I can emulate, such as printf(), etc. However, the
program's crt file calls the glibc function __libc_start_main. As far as
I can tell, __libc_start_main calls the program's .init, sets up a call
to the program's .fini, and calls main. The compiler places certain
functions in .init and .fini that set up C++ features such as
constructors for static global objects. Thus, this part of glibc has to
be emulated for the C++ runtime to work properly. However,
__libc_start_main also calls __libc_init and _dl_aux_init. I just want
to know if both those functions are entirely glibc-specific (ie. they
only touch data structures necessary to steup glibc) or do they have any
effects that I'd need to emulate to initialize the C++ runtime properly?
Thanks in advance,
|[Prev in Thread]
||[Next in Thread]|
- glibc Initialization,