From patchwork Sun Jun 9 03:29:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dehao Chen X-Patchwork-Id: 250004 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 548412C008C for ; Sun, 9 Jun 2013 13:30:09 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:cc:content-type; q=dns; s=default; b=cfxGy7WN6UTMRkTHKNA1OHhU9sUSd0GfVbGRzUpar5J zFxTZWsRmctcSKEnzrSe5AX9SouJ9+YOlCcNK1JSWhxViqoyA9NKrafbnCwRCTBH V+w1HMpYvDZwuQX6VzWw8RKWYUrwZdJFSRnx+i0AVpylYVbSRZZHg+Aaqeg+Ujcw = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :mime-version:date:message-id:subject:from:to:cc:content-type; s=default; bh=xSOC8H7thE04ZeudDSQ+bHWT1DA=; b=SofUacoGKuW8TXsF+ BIsvZEEOqeuXMmsJKTspsekzWdpERRGkgIJQZLAZhO84uDqtC5p/GJE/1Cqu1mlY s4nm6M5JaHYIZeNRWCCOUrzOYtQ+zcPA6u4U3B849MhHrPEBKrmmjq/ruOZWZo1t rPUSfQGW3EBaeSvYGVLr+2HLcA= Received: (qmail 22201 invoked by alias); 9 Jun 2013 03:30:02 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 22136 invoked by uid 89); 9 Jun 2013 03:29:53 -0000 X-Spam-SWARE-Status: No, score=-3.6 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.1 Received: from mail-ee0-f48.google.com (HELO mail-ee0-f48.google.com) (74.125.83.48) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Sun, 09 Jun 2013 03:29:52 +0000 Received: by mail-ee0-f48.google.com with SMTP id b47so1588187eek.21 for ; Sat, 08 Jun 2013 20:29:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:date:message-id:subject:from:to:cc:content-type :x-gm-message-state; bh=VLBx6akf27tSe7c+dJy+B+vGPcT3ou98GGe8KYOiSII=; b=YKj/Cm6dxu29ybJ2sRgTQ2lUW/dUi9Qw0jEFm9A6KZK250mx4lGRnqwqbOEcdOmdBW wjdv5Y9fr+mS8gpoUHJBds5cJC/1rO5MzVkPu/WWOX2l8kPjWg5er9blG2Hk7JcrvR7A mp8hU/GDsox38t6L9VhYQXdMan0+EoIgf5HHeEB5RzRP0RNSKB5Gcpv/srgFK3xSw6w9 ZDeEYTQnB1Ap81MMStAAlyZ24dVMYfn6+sY7f5/++IAbDfcdvW5OttNtcfF3NhdfFZ4H qqpUda5g2ARn5sWAk06lGndNw9RdZQxnoATeW5WnrxBgpRaSC4GKd2/uGlzNZ8y+2bnD cZiQ== MIME-Version: 1.0 X-Received: by 10.14.209.5 with SMTP id r5mr5044643eeo.112.1370748590269; Sat, 08 Jun 2013 20:29:50 -0700 (PDT) Received: by 10.14.210.69 with HTTP; Sat, 8 Jun 2013 20:29:50 -0700 (PDT) Date: Sat, 8 Jun 2013 20:29:50 -0700 Message-ID: Subject: [GOOGLE] Avoid emitting duplicated weakref From: Dehao Chen To: GCC Patches Cc: David Li X-Gm-Message-State: ALoCoQmR8gQghRQ2wjaP+j3OAd7dBPNFvv9Nk7snZh9AJvBvlovwL+5l9DnHque2nloK3y6BZXavhEf2FSCqnHXwSeJsQOMebkZRd+CG8Y/aDcp4iERWy52ZUeyix1gq+Z170P6uw5Oo3Q32B9EY6WR2YwNRCEQl9qzsjJOecnTlqCG5BFXk1EeoP7iIXI4wzH0yqorzo9guD43t7G0lP2K+8d86tFKf0g== 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);