From owner-freebsd-hackers Sun Dec 27 21:23:52 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id VAA23136 for freebsd-hackers-outgoing; Sun, 27 Dec 1998 21:23:52 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from wall.polstra.com (rtrwan160.accessone.com [206.213.115.74]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id VAA23130 for ; Sun, 27 Dec 1998 21:23:49 -0800 (PST) (envelope-from jdp@polstra.com) Received: from vashon.polstra.com (vashon.polstra.com [206.213.73.13]) by wall.polstra.com (8.9.1/8.9.1) with ESMTP id VAA23253; Sun, 27 Dec 1998 21:23:33 -0800 (PST) (envelope-from jdp@polstra.com) From: John Polstra Received: (from jdp@localhost) by vashon.polstra.com (8.9.1/8.9.1) id VAA08366; Sun, 27 Dec 1998 21:23:33 -0800 (PST) (envelope-from jdp@polstra.com) Date: Sun, 27 Dec 1998 21:23:33 -0800 (PST) Message-Id: <199812280523.VAA08366@vashon.polstra.com> To: kaleb@ics.com Subject: Re: ld (bfd): wrong function names for ELF shared library DT_{INIT,FINI} Newsgroups: polstra.freebsd.hackers In-Reply-To: <36869BCF.2F1CF0FB@ics.com> References: Organization: Polstra & Co., Seattle, WA Cc: hackers@FreeBSD.ORG Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In article <36869BCF.2F1CF0FB@ics.com>, Kaleb S. KEITHLEY wrote: > > > > > > What is named ".init" and ".fini" are the **section** where these > > > functions are placed in. This are not the function names. In fact, > > > the function names are not specified at all. _init and _fini come > > > from folklore (speek, the first ELF implementations). > > > > I haven't looked at the i386 code but the alpha _init() and _fini() are > > already in the correct sections. > > On x86 ELF binutils/ld does not create .init or .fini sections. Nor does it need to. Nor should it. That's taken care of by the various crt*.o modules in /usr/lib. > In the past, given the lack of tools to tag things as belonging in > the .init and .fini sections that I have kludged it with assembler > to create .init() and .fini() functions, and they were called. Given > that the .init and .fini sections are simply executable code, I > think the distinction between being sections and being functions is > too subtle to support your case. There is nothing subtle about the difference between sections and functions. -- John Polstra jdp@polstra.com John D. Polstra & Co., Inc. Seattle, Washington USA "Nobody ever went broke underestimating the taste of the American public." -- H. L. Mencken To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message