how to redefine _start ?
Yannick PERRET
yperret@bat710.univ-lyon1.fr
Tue Jan 8 10:18:00 GMT 2002
Hi,
I'm working on a profiler based on the 'instrument-functions'
gcc feature (functioncheck on sourceforge).
For performance reasons, I want to make some inits
before any program execution (before main). In addition
I want to perform these inits before static constructors in
C++ program (which start before main).
I tried to give my own _start, _init and _fini functions by
removing the crt1 ones (-nostartlibs). The problem is
that I cannot figure what _start is supposed to do before
calling main() (return value, args...). The problem is the
same for _fini function.
I checked the gcc source, but crt1 seems to only be ASM
code.
Is it possible to write _start and stuff in C properly ?
If yes, where to find some documentation/exemples ?
If no, anybody got an idea to perform "before-main" treatments
(and of course "after-main") ?
Thank you for any help.
Regards
--
Yannick
More information about the Binutils
mailing list