This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Replace __attribute__((visibility("protected")))
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Andreas Schwab <schwab at linux-m68k dot org>
- Cc: "H.J. Lu" <hongjiu dot lu at intel dot com>, GNU C Library <libc-alpha at sourceware dot org>, "H.J. Lu" <hjl dot tools at gmail dot com>
- Date: Fri, 6 Mar 2015 22:25:00 +0000
- Subject: Re: [PATCH] Replace __attribute__((visibility("protected")))
- Authentication-results: sourceware.org; auth=none
- References: <20150306194153 dot GA30470 at intel dot com> <87pp8lnax0 dot fsf at igel dot home>
On Fri, 6 Mar 2015, Andreas Schwab wrote:
> "H.J. Lu" <hongjiu.lu@intel.com> writes:
>
> > diff --git a/elf/ifuncdep2.c b/elf/ifuncdep2.c
> > index 99d1926..599eba7 100644
> > --- a/elf/ifuncdep2.c
> > +++ b/elf/ifuncdep2.c
> > @@ -2,7 +2,8 @@
> >
> > #include "ifunc-sel.h"
> >
> > -int global __attribute__ ((visibility ("protected"))) = -1;
> > +int global = -1;
> > +asm (".protected global");
>
> Some architectures use a symbol prefix.
No such architectures are currently supported by glibc, and I expect lots
of places would need fixing if support were to be added for any such
architecture. (Using symbol prefixes with ELF also violates the gABI,
which says "External C symbols have the same names in C and object files'
symbol tables.".)
--
Joseph S. Myers
joseph@codesourcery.com