From owner-freebsd-hackers Sun Dec 27 13:33:33 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA05515 for freebsd-hackers-outgoing; Sun, 27 Dec 1998 13:33:33 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from nlsystems.com (nlsys.demon.co.uk [158.152.125.33]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA05510 for ; Sun, 27 Dec 1998 13:33:30 -0800 (PST) (envelope-from dfr@nlsystems.com) Received: from localhost (dfr@localhost) by nlsystems.com (8.9.1/8.8.5) with SMTP id VAA01535; Sun, 27 Dec 1998 21:33:06 GMT Date: Sun, 27 Dec 1998 21:33:06 +0000 (GMT) From: Doug Rabson To: "Kaleb S. KEITHLEY" cc: hackers@FreeBSD.ORG Subject: Re: [Fwd: Re: ld (bfd): wrong function names for ELF shared library DT_{INIT,FINI}] In-Reply-To: <36869D85.7DE14518@ics.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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