Date: Sun, 27 Dec 1998 21:23:33 -0800 (PST)
From: John Polstra <jdp@polstra.com>
To: kaleb@ics.com
Cc: hackers@FreeBSD.ORG
Subject: Re: ld (bfd): wrong function names for ELF shared library DT_{INIT,FINI}
Message-ID: <199812280523.VAA08366@vashon.polstra.com>
In-Reply-To: <36869BCF.2F1CF0FB@ics.com>
References: <Pine.BSF.4.01.9812271747560.383-100000@herring.nlsystems.com>
next in thread | previous in thread | raw e-mail | index | archive | help
In article <36869BCF.2F1CF0FB@ics.com>,
Kaleb S. KEITHLEY <kaleb@ics.com> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199812280523.VAA08366>
