External argc and argv

Martin v. Loewis martin@mira.isdn.cs.tu-berlin.de
Wed Mar 31 23:46:00 GMT 1999


> I am aware it will be OS specific.  I have it set up for 10 platforms right
> now, and I'm looking to do this with Linux on Intel x86.  So I guess my
> question is, how can I do this on Linux for Intel x86?

It depends on the C library. Some versions of the library provide
__libc_argc, and __libc_argv. However, using these internal symbols is
deprecated, and glibc 2.1 does not export them anymore (at least not
from the shared library).

Of course, you can always replace crt1.o to get hold of these values.
Or you just write a suitable main() function :-)

I think comp.os.linux.development is a better place for this subject.

Regards,
Martin



More information about the Gcc mailing list