Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 Dec 1998 21:33:06 +0000 (GMT)
From:      Doug Rabson <dfr@nlsystems.com>
To:        "Kaleb S. KEITHLEY" <kaleb@ics.com>
Cc:        hackers@FreeBSD.ORG
Subject:   Re: [Fwd: Re: ld (bfd): wrong function names for ELF shared library DT_{INIT,FINI}]
Message-ID:  <Pine.BSF.4.01.9812272126260.383-100000@herring.nlsystems.com>
In-Reply-To: <36869D85.7DE14518@ics.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 27 Dec 1998, Kaleb S. KEITHLEY wrote:

> forwarded here because of a mangled hackers address in the CC: line.
> 
> Okay. I've confirmed that on e.g. Linux that ld does create .init and
> .fini sections, and on ELF FreeBSD 3.0-RELEASE it does not. Was this
> intentional?

On 3.0-RELEASE, these sections are created by the various C startup
pieces, crt1.o, crti.o, crtbegin.o, crtend.o and crtn.o.  I have no idea
if ld(1) was supposed to create the sections but if you use the stock gcc
compiler in the release to link the program or shared library, then the
various pieces are threaded together in the correct sequence.

For linking 'by hand' on i386, you need something like:

	crt1.o crti.o crtbegin.o myfile.o crtend.o crtn.o

for programs and:

	crti.o crtbeginS.o myfile crtendS.o crtn.o

for shared libs.

The sequence is different for alpha (remove crti.o and crtn.o).

--
Doug Rabson				Mail:  dfr@nlsystems.com
Nonlinear Systems Ltd.			Phone: +44 181 442 9037



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?Pine.BSF.4.01.9812272126260.383-100000>