From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8947 invoked by alias); 22 Oct 2010 04:33:28 -0000 Received: (qmail 8937 invoked by uid 22791); 22 Oct 2010 04:33:27 -0000 X-SWARE-Spam-Status: No, hits=-1.0 required=5.0 tests=AWL,BAYES_40,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mail-pv0-f169.google.com (HELO mail-pv0-f169.google.com) (74.125.83.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 22 Oct 2010 04:33:21 +0000 Received: by pvc21 with SMTP id 21so127502pvc.0 for ; Thu, 21 Oct 2010 21:33:20 -0700 (PDT) Received: by 10.142.144.18 with SMTP id r18mr1730079wfd.88.1287721999968; Thu, 21 Oct 2010 21:33:19 -0700 (PDT) Received: from bubble.grove.modra.org ([115.187.252.19]) by mx.google.com with ESMTPS id v19sm3682228wfh.12.2010.10.21.21.33.17 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 21 Oct 2010 21:33:19 -0700 (PDT) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id EC1BD170C206; Fri, 22 Oct 2010 15:03:13 +1030 (CST) Date: Fri, 22 Oct 2010 04:33:00 -0000 From: Alan Modra To: Mark Mitchell Cc: Ian Lance Taylor , binutils@sourceware.org Subject: Re: RFC: COMDAT group names become anonymouse local symbols Message-ID: <20101022043313.GD26553@bubble.grove.modra.org> Mail-Followup-To: Mark Mitchell , Ian Lance Taylor , binutils@sourceware.org References: <4CBFC470.5060202@codesourcery.com> <20101021062426.GU26553@bubble.grove.modra.org> <4CC06D28.5070900@codesourcery.com> <20101021185044.GA19120@caradoc.them.org> <4CC0A0E7.9090803@codesourcery.com> <20101021221944.GX26553@bubble.grove.modra.org> <4CC0C1AF.4050100@codesourcery.com> <20101021231110.GY26553@bubble.grove.modra.org> <4CC103C0.8010801@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4CC103C0.8010801@codesourcery.com> User-Agent: Mutt/1.5.20 (2009-06-14) 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/msg00364.txt.bz2 On Thu, Oct 21, 2010 at 08:23:44PM -0700, Mark Mitchell wrote: > ! /* Make the SHT_GROUP sections that describe each section group. We > ! can't set up the section contents here yet, because elf section > ! indices have yet to be calculated. elf.c:set_group_contents does > ! the rest of the work. */ Keep this comment, please. > ! sec_name = ".group"; > sy = symbol_find_exact (group_name); > ! if (!sy > ! || (sy != symbol_lastP > ! && (sy->sy_next == NULL > ! || sy->sy_next->sy_previous != sy))) > { > ! /* Create the symbol now. */ > ! sy = symbol_new (group_name, now_seg, (valueT) 0, frag_now); > ! symbol_get_obj (sy)->local = 1; > ! symbol_table_insert (sy); > } > s = subseg_force_new (sec_name, 0); > if (s == NULL > || !bfd_set_section_flags (stdoutput, s, flags) > || !bfd_set_section_alignment (stdoutput, s, 2)) Create symbol after this point, so that now_seg and frag_now are in the group section. It doesn't really matter which section you use for the symbol, but the way you have it you'll get some random section. In fact, you may as well move the sym check and create to.. > ! elf_group_id (s) = sy->bsym; ..just before here. Which reminds me, use symbol_get_bfdsym here since we are before set_symtab. -- Alan Modra Australia Development Lab, IBM