This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: PATCH: Multiple sections with same name don't work
- From: "H. J. Lu" <hjl at lucon dot org>
- To: binutils at sources dot redhat dot com
- Date: Fri, 30 Apr 2004 17:36:37 -0700
- Subject: Re: PATCH: Multiple sections with same name don't work
- References: <20040430221244.GA17029@lucon.org> <20040430230129.GA17907@lucon.org>
On Fri, Apr 30, 2004 at 04:01:29PM -0700, H. J. Lu wrote:
> On Fri, Apr 30, 2004 at 03:12:44PM -0700, H. J. Lu wrote:
> > The current assembler still doesn't support multiple section with
> > the same section name:
> >
> > [hjl@gnu comdat-1]$ cat foo.s
> > .text
> > .L1:
> > .align 4
> > .L2:
> > .L3:
> > .section .data,"",@progbits
> > .long .L3-.L1
> > .section .text,"axG",@progbits,foo,comdat
> > [hjl@gnu comdat-1]$ gcc -c foo.s
> > foo.s: Assembler messages:
> > foo.s:7: Error: can't resolve `.text' {.text section} - `.L1' {.text section}
> >
> >
>
> This patch seems to work for me. I don't quite understand why we call
> symbol_set_bfdsym here if we only want to add the symbol to the
> symbol table.
>
>
It is not enough. Now I got
[hjl@gnu-psc comdat-2]$ gcc -c bar.s
bar.s: Assembler messages:
bar.s:14: Error: can't resolve `.text' {.text section} - `.LFB359' {.text
section}
[hjl@gnu-psc comdat-2]$ cat bar.s
.section .text,"axG",@progbits,foo,comdat
.LFB359:
.L46:
jbe .L46
.LFE359:
.section .text,"axG",@progbits,bar,comdat
.LFB401:
.L514:
jmp .L514
.LFE401:
.section .eh_frame,"a",@progbits
.Lframe1:
.LSCIE1:
.long .LFE359-.LFB359
.LASFDE101:
.long .LFE401-.LFB401
.LEFDE101:
.section .data,"awG",@progbits,foobar,comdat
H.J.