This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [GOOGLE] Avoid emitting duplicated weakref
- From: Xinliang David Li <davidxl at google dot com>
- To: Dehao Chen <dehao at google dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 8 Jun 2013 20:31:30 -0700
- Subject: Re: [GOOGLE] Avoid emitting duplicated weakref
- References: <CAO2gOZUpcpdSSaaXU4zUAV2WOzE3A18zzQe858MnQeBWEXagjA at mail dot gmail dot com>
Guard also with L_IPO_COMP_MODE as this is lipo specific.
David
On Sat, Jun 8, 2013 at 8:29 PM, Dehao Chen <dehao@google.com> wrote:
> This patch fixes a bug when two weakref symbols are mapped to a same
> assembler name.
>
> Testing on going.
>
> OK for google branches if test is fine?
>
> Thanks,
> Dehao
>
> Index: gcc/varasm.c
> ===================================================================
> --- gcc/varasm.c (revision 199844)
> +++ gcc/varasm.c (working copy)
> @@ -5502,6 +5502,10 @@ do_assemble_alias (tree decl, tree target)
> if (TREE_ASM_WRITTEN (decl))
> return;
>
> + if (lookup_attribute ("weakref", DECL_ATTRIBUTES (decl))
> + && TREE_ASM_WRITTEN (DECL_ASSEMBLER_NAME (decl)))
> + return;
> +
> /* We must force creation of DECL_RTL for debug info generation, even though
> we don't use it here. */
> make_decl_rtl (decl);