From owner-freebsd-hackers Sat Jan 2 06:33:33 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id GAA22072 for freebsd-hackers-outgoing; Sat, 2 Jan 1999 06:33:33 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from spooky.rwwa.com (rwwa.com [198.115.177.3]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id GAA22067 for ; Sat, 2 Jan 1999 06:33:30 -0800 (PST) (envelope-from witr@rwwa.com) Received: from spooky.rwwa.com (localhost.rwwa.com [127.0.0.1]) by spooky.rwwa.com (8.8.7/8.8.7) with ESMTP id JAA01573; Sat, 2 Jan 1999 09:34:50 -0500 (EST) (envelope-from witr@rwwa.com) Message-Id: <199901021434.JAA01573@spooky.rwwa.com> X-Mailer: exmh version 2.0zeta 7/24/97 To: John Polstra cc: kaleb@ics.com, hackers@FreeBSD.ORG Subject: Re: ld (bfd): wrong function names for ELF shared library DT_{INIT,FINI} In-reply-to: Your message of "Mon, 28 Dec 1998 09:57:03 PST." <199812281757.JAA09526@vashon.polstra.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 02 Jan 1999 09:34:50 -0500 From: Robert Withrow Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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