This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
GNU ld and -init/-fini
- To: binutils@sourceware.cygnus.com
- Subject: GNU ld and -init/-fini
- From: mark@codesourcery.com
- Date: Mon, 21 Jun 1999 16:09:57 -0700
- Organization: CodeSourcery, LLC
The IRIX 6 linker provdides -init and -fini switches. These switches
set DT_INIT and DT_FINI flags in the dynamic table, which cause the
named functions to be executed at initialization/finalization time.
GCC uses these to call global constructors when a shared library is
loaded.
There do not seem to be equivalent GNU ld switches. What is the
method used on Linux, etc. in order to make the same sort of thing
happen?
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com