> On 9 June 2013 05:31, Xinliang David Li <davi...@google.com> wrote:
> > Guard also with L_IPO_COMP_MODE as this is lipo specific.
> 
> Sounds like this is the LIPO incarnation of http://gcc.gnu.org/PR31537
> 
> See the patch at http://gcc.gnu.org/PR31537#c9 for not adding the
> alias in the first place (back then, honza may have changed that
> recently on trunk).
> 
> Honza, Joseph,
> Are there rules for handling weakrefs in some standard? If so, which ones?

Not that I would know of. It is an extension engineered for glibc pthreads.  in
mainline I quite changed way weakrefs are handled and I still plan to do more.
What LTO does now is to  handle weakref symbol as static symbol despite it has
DECL_EXTERNAL on it.  (I have patch in queue to really make it static).
This is because the symbol never hits the exported symbol table anyhow.

I.e. you can have:
 cat f1.i
static __gthrw_pthread_once __attribute__ ((__weakref__ ("pthread_once")));
$ cat f2.i
static __gthrw_pthread_once __attribute__ ((__weakref__ 
("comething_completely_else")));

that will break with your do_assemble_alias change. with LTO you will now get
__gthrw_pthread_once.1 and __gthrw_pthread_once.2 with proper weakref targets.

Honza

Reply via email to