Subject: Re: When is ELF coming?
To: John Birrell <jb@cimlogic.com.au>
From: Curt Sampson <cjs@portal.ca>
List: port-alpha
Date: 11/19/1996 21:15:11
On Wed, 20 Nov 1996, John Birrell wrote:

> Code a function with one name, declare a weak alias of that function
> to another name by which it can be referenced iff there isn't another
> function of that name linked (possibly in another library).

What I can't figure out is what the use of this is. I mean, I
understand that it's useful not to have your entire namespace filled
with the symbols from all your libraries even before you start :-),
but isn't a linker supposed to do this sort of thing automagically?
This seems to work now; I can put my own getpid() in a program and
that will be called instead of the library routine without complaint,
and even though I link against libc (for printf), which contains
getpid().

Of course, I suppose things do get interesting if you override
getpid, and then call library routines that call getpid. But what's
to say you didn't want these other library routines calling your
getpid in the first place?

I'm obviously missing some essential clue here.

cjs

Curt Sampson    cjs@portal.ca		Info at http://www.portal.ca/
Internet Portal Services, Inc.	
Vancouver, BC   (604) 257-9400		De gustibus, aut bene aut nihil.