From owner-freebsd-current Mon Jan 26 21:49:25 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id VAA13005 for current-outgoing; Mon, 26 Jan 1998 21:49:25 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from smtp02.primenet.com (smtp02.primenet.com [206.165.6.132]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id VAA12999 for ; Mon, 26 Jan 1998 21:49:23 -0800 (PST) (envelope-from tlambert@usr01.primenet.com) Received: (from daemon@localhost) by smtp02.primenet.com (8.8.8/8.8.8) id WAA07460; Mon, 26 Jan 1998 22:49:22 -0700 (MST) Received: from usr01.primenet.com(206.165.6.201) via SMTP by smtp02.primenet.com, id smtpd007438; Mon Jan 26 22:49:17 1998 Received: (from tlambert@localhost) by usr01.primenet.com (8.8.5/8.8.5) id WAA00788; Mon, 26 Jan 1998 22:49:14 -0700 (MST) From: Terry Lambert Message-Id: <199801270549.WAA00788@usr01.primenet.com> Subject: Re: Building EGCS. What am I missing? To: garbanzo@hooked.net (Alex) Date: Tue, 27 Jan 1998 05:49:14 +0000 (GMT) Cc: roberto@keltia.freenix.fr, freebsd-current@FreeBSD.ORG In-Reply-To: from "Alex" at Jan 26, 98 05:35:04 pm X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk > I tried that, and it built just fine. However, I can't seem to get it to > make shared libraries at all :/ I've mucked around with switching to ELF, > however, the milding success I've had with that makes me wary of > rebuilding the whole system (which I'd have to do if I wanted to do elf X > programming). Any words of wisdom? Make sure you use the new binutils. Also, you must use a gas that understands weak symbols. The libraries are implemented by statically linking a PLT out of the shared library image, and overriding the symbols via relocation on a dlopen(), so that a call through the PLT gets the function from the shared library of choice. The most recent one wins. This is somewhat of the substance of the discussion about dladdr(), at least with regards to ELf, wherein the test program, when given a libc function address, identified the stub in the PLT of the main image (argv[0]) instead of the symbol in the shared library, and the path to the shared library as it was loaded by ld.so. Admittedly, the subject of the discussion didn't match the subject line for that one; it was an easy miss. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.