Subject: Re: When is ELF coming?
To: John Birrell <jb@cimlogic.com.au>
From: Chris G Demetriou <Chris_G_Demetriou@ux2.sp.cs.cmu.edu>
List: port-alpha
Date: 11/19/1996 10:06:37
> > One example of this is /usr/bin/pr: it defines a global FILE * named
> > 'err'. That gets confused with the libc (function) definition of
> > 'err'. SEGV.
>
> So you need _every_ libc function that is in the programmer's name space
> to have a name outside that space and a weak alias back to the original
> name?
Right.
I'm not really sure, but i'd guess that if you want to support a 'gcc
-traditional' programming model, i.e. where ANSI's notion of user- and
standard-namespace symbols doesn't apply, you'd have to do it for
_every_ function that you might reasonably expect the user to use..
> And the modified libc code has to work on ports where no weak alias
> support exists and/or with a K & R compiler?!! (rhetorical 8-).
>
> Does this mean you need a macro like HIDENAME() and code things like:
>
> int
> HIDENAME(sigpause)(mask)
> int mask;
> {
> return (HIDENAME(sigsuspend)((sigset_t *)&mask));
> }
I don't really know; J.T.'s the guy doing this work, and i'm not
really capable of describing what he's done.
> Now I see a problem... if I had done such a thing to libc it would
> suit both your ELF requirements and mine, but I would end up with the
> ELF shared library problem occurring in libpthread. libpthread would
> need non-weak symbols to override the weak ones in libc - then
> libpthread wouldn't work shared under ELF. There are no degress of
> "weakness". Hmmm. Any suggestions?
I don't know how that sort of thing works, unfortunately. All i
really know is why (i'm told 8-) i need weak references, and why i
get a SEGV from some programs if i don't have them... 8-)
chris