This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: Binary compatibility loss regarding errno
- From: Roland McGrath <roland at redhat dot com>
- To: "H. J. Lu" <hjl at lucon dot org>
- Cc: Daniel Jacobowitz <drow at mvista dot com>,libc-alpha at sources dot redhat dot com
- Date: Mon, 30 Dec 2002 13:39:30 -0800
- Subject: Re: Binary compatibility loss regarding errno
> I believe ld works as expected.
That is barely meaningful to say, since the behavior of these cases is so
undocumented and ill-specified. It sure isn't what I expect.
> Basically
>
> int foo() { return x; }
>
> will use the definition of `x', which is the original symbol, not the
> versioned one.
That's a reasonable interpretation in the abstract, but it's unworkable.
> Please try
>
> extern int x;
> int _x __attribute__((section (".bss")));
> asm(".symver _x,x@VERS_1");
> int foo() { return x; }
That produces an undefined reference to unversioned `x'.
> When you use `.symver NAME,NAME2@NODENAME', NAME should be different
> from NAME2. Otherwise, you will get many surprises.
A specification of "expect surprises" is just not useful. If it doesn't
work in a consistent, well-defined way, then it must be disallowed.