Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Jan 1998 05:49:14 +0000 (GMT)
From:      Terry Lambert <tlambert@primenet.com>
To:        garbanzo@hooked.net (Alex)
Cc:        roberto@keltia.freenix.fr, freebsd-current@FreeBSD.ORG
Subject:   Re: Building EGCS.  What am I missing?
Message-ID:  <199801270549.WAA00788@usr01.primenet.com>
In-Reply-To: <Pine.BSF.3.96.980126173228.235P-100000@zippy.dyn.ml.org> from "Alex" at Jan 26, 98 05:35:04 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> 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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199801270549.WAA00788>