Subject: Re: When is ELF coming?
To: Curt Sampson <cjs@portal.ca>
From: John Birrell <jb@cimlogic.com.au>
List: port-alpha
Date: 11/20/1996 13:04:58
Curt Sampson wrote:
> Can someone out there point me to a document that describes how weak
> symbols work (or are supposed to work) in a dynamic linking environment?
> My conception of them is rather vague.
I don't know of a document, but (to my understanding at least) the concept
is really simple. 8-)
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).
e.g:
----------------------------------------------------------------
void harry_who() __attribute__ (( weak, alias ("harry") ));
int main()
{
harry_who();
}
void harry()
{
printf("Who am I?\n");
}
----------------------------------------------------------------
>
> cjs
--
John Birrell CIMlogic Pty Ltd
jb@cimlogic.com.au 119 Cecil Street
Ph +61 3 9690 6900 South Melbourne Vic 3205
Fax +61 3 9690 6650 Australia
Mob +61 18 353 137