On Mon, 04 Jul 2005 07:21:29 -0700, ABC wrote:
> But when I run the a.out formed by compiling the main.c with test.so
> and running the a.out my main is called.
>
When is the main of libc.so ever called?
Of course your main is called if you ask the operating system to do just
that (by invoking your program). However, by loading your library, you ask
the OS to do something different, namely load the library, and prepare it
to have its functions by some already existing process. (the loading
process to be precise)
--
You can't run away forever,
But there's nothing wrong with getting a good head start.
--- Jim Steinman, "Rock and Roll Dreams Come Through"