Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 02 Jan 1999 09:34:50 -0500
From:      Robert Withrow <witr@rwwa.com>
To:        John Polstra <jdp@polstra.com>
Cc:        kaleb@ics.com, hackers@FreeBSD.ORG
Subject:   Re: ld (bfd): wrong function names for ELF shared library  DT_{INIT,FINI}
Message-ID:  <199901021434.JAA01573@spooky.rwwa.com>
In-Reply-To: Your message of "Mon, 28 Dec 1998 09:57:03 PST." <199812281757.JAA09526@vashon.polstra.com> 

next in thread | previous in thread | raw e-mail | index | archive | help

jdp@polstra.com said:
:- You are not supposed to write your own _init() and _fini() functions
:- directly, nor do you need to (see below).  Those symbols are reserved
:- to the implementation.

And by "implementation" you mean the CCS?

Also, dlopen(3) says:

 When an object is first loaded into the address space in this way, its
 function _init(), if any, is called by the dynamic linker. 

It doesn't make any mention of this being restricted to the implementation,
and I've always assumed I could use the init/fini functions for library
specific load-time initting and fining (the need for which is damn
rare, btw).

jdp@polstra.com said:
:- Look up "reserved identifiers" in the C standard if you want the gory
:- details.

The C standard doesn't have anything to say about dynamic linking.  It
could have been that the choice of "_" as the first character in these
names could have been a mistake WRT the C standard.  I wouldn't jump to
the conclusion that this mechanism was intended to be restricted to the
CCS based on the choice of the names, at least without some more
authoratative document (concerning dynamic linking) explicitly saying
so.
---------------------------------------------------------------------
Robert Withrow, R.W. Withrow Associates, Swampscott MA, witr@rwwa.COM



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199901021434.JAA01573>