From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16070 invoked by alias); 1 May 2004 05:50:10 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 16058 invoked from network); 1 May 2004 05:50:09 -0000 Received: from unknown (HELO rwcrmhc11.comcast.net) (204.127.198.35) by sources.redhat.com with SMTP; 1 May 2004 05:50:09 -0000 Received: from lucon.org ([24.6.43.109]) by comcast.net (rwcrmhc11) with ESMTP id <2004050105500801300hvsike>; Sat, 1 May 2004 05:50:09 +0000 Received: by lucon.org (Postfix, from userid 1000) id 7B6BF64CFF; Fri, 30 Apr 2004 22:50:08 -0700 (PDT) Date: Sat, 01 May 2004 05:50:00 -0000 From: "H. J. Lu" To: Zack Weinberg Cc: binutils@sources.redhat.com Subject: Re: PATCH: Multiple sections with same name don't work Message-ID: <20040501055008.GA24493@lucon.org> References: <20040430221244.GA17029@lucon.org> <20040430230129.GA17907@lucon.org> <20040501003636.GA19527@lucon.org> <20040501023136.GQ2565@bubble.modra.org> <20040501025913.GR2565@bubble.modra.org> <20040501034300.GA22385@lucon.org> <20040501042506.GS2565@bubble.modra.org> <87d65obuji.fsf@egil.codesourcery.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="EeQfGwPcQSOJBaQU" Content-Disposition: inline In-Reply-To: <87d65obuji.fsf@egil.codesourcery.com> User-Agent: Mutt/1.4.1i X-SW-Source: 2004-05/txt/msg00007.txt.bz2 --EeQfGwPcQSOJBaQU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 1095 On Fri, Apr 30, 2004 at 10:12:01PM -0700, Zack Weinberg wrote: > Alan Modra writes: > > > On Fri, Apr 30, 2004 at 08:43:00PM -0700, H. J. Lu wrote: > >> On Sat, May 01, 2004 at 12:29:13PM +0930, Alan Modra wrote: > >> > Actually, it is probably a mistake to try to support multiple sections > >> > of the same name in gas. For instance, if you have two .text sections, > >> > how is gas supposed to evaluate ".long .text" ? > >> > >> Will that be generated by compiler? If not, we can issue an error. > > > > The real question is: Do we need multiple sections of the same name > > in assembly files? I don't think we do. > > I need them in order to generate COMDAT sections compatible with the > HPUX linker. gcc might emit e.g. > > .section .text > # non-COMDAT code ... > > .section .text,"G",symbol_name,comdat > # code for symbol_name ... > > .section .eh_frame > # non-COMDAT unwind info ... > > .section .eh_frame,"G",symbol_name,comdat > # unwind info for symbol_name ... > I am testing this patch now. H.J. --EeQfGwPcQSOJBaQU Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="gas-elf-same-2.patch" Content-length: 502 2004-04-30 H.J. Lu * symbols.c (symbol_set_bfdsym): Don't reset BFD section symbol. --- gas/symbols.c.same 2003-12-04 10:43:25.000000000 -0800 +++ gas/symbols.c 2004-04-30 22:45:18.000000000 -0700 @@ -2260,7 +2260,8 @@ symbol_set_bfdsym (symbolS *s, asymbol * { if (LOCAL_SYMBOL_CHECK (s)) s = local_symbol_convert ((struct local_symbol *) s); - s->bsym = bsym; + if ((s->bsym->flags & BSF_SECTION_SYM) == 0) + s->bsym = bsym; } #endif /* BFD_ASSEMBLER */ --EeQfGwPcQSOJBaQU--