From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22115 invoked by alias); 21 Oct 2010 06:12:21 -0000 Received: (qmail 22104 invoked by uid 22791); 21 Oct 2010 06:12:20 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.35) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 21 Oct 2010 06:12:15 +0000 Received: from hpaq6.eem.corp.google.com (hpaq6.eem.corp.google.com [172.25.149.6]) by smtp-out.google.com with ESMTP id o9L6CCSr015867 for ; Wed, 20 Oct 2010 23:12:12 -0700 Received: from qyk10 (qyk10.prod.google.com [10.241.83.138]) by hpaq6.eem.corp.google.com with ESMTP id o9L6C5tk027179 for ; Wed, 20 Oct 2010 23:12:11 -0700 Received: by qyk10 with SMTP id 10so1781019qyk.6 for ; Wed, 20 Oct 2010 23:12:11 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.224.137 with SMTP id io9mr348048qcb.206.1287641531064; Wed, 20 Oct 2010 23:12:11 -0700 (PDT) Received: by 10.229.141.15 with HTTP; Wed, 20 Oct 2010 23:12:11 -0700 (PDT) In-Reply-To: <4CBF32BC.4030100@codesourcery.com> References: <20101019200838.8A9725664F9@henry1.codesourcery.com> <4CBF32BC.4030100@codesourcery.com> Date: Thu, 21 Oct 2010 06:12:00 -0000 Message-ID: Subject: Re: RFC: COMDAT group names become anonymouse local symbols From: Cary Coutant To: Mark Mitchell Cc: binutils@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2010-10/txt/msg00342.txt.bz2 >>> On the other hand, perhaps GCC shouldn't generate code like this. > >> If gcc were to generate the local symbol, it looks like gas will do >> the right thing and set the name of the SHT_GROUP section to ".group" >> with a link field pointing to the key symbol. > > So, do you consider this a GCC bug? =A0Or a GAS bug? > > I think we can fix the end-user C++ behavior in either way, but I guess > I feel like this is a GAS bug. =A0Why should someone writing assembly code > have to define "B"? =A0Telling the assembler that "B" is the signature of > the group seems like it should be enough. =A0What do you think? Judging by the responses so far, it sounds like the GAS behavior to leave the section symbol's name blank is intended behavior, even if not completely legal according to the ELF spec. But the real issue is whether using the section symbol as the comdat key is the right thing to do, rather than creating a local symbol for the purpose. For consistency, I'd argue that SHT_GROUP sections ought to be named independently of whether or not a symbol for the comdat key exists, and that GAS ought to simply generate a new local symbol if necessary. Since no one has offered any support for my wild guess about this being an artifact of support for the old HP comdat design, I think it's safe to discount that and just change GAS. On the other hand, I wouldn't object to changing both GCC and GAS: change GCC to generate the symbol in all cases, and change GAS to complain about a reference to an undefined symbol for the example you gave. -cary