This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
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 16:01:29 -0700
- Subject: PATCH: Multiple sections with same name don't work
- References: <20040430221244.GA17029@lucon.org>
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.
H.J.
----
2004-04-30 H.J. Lu <hongjiu.lu@intel.com>
* config/obj-elf.c (obj_elf_change_section): Don't reset
bfdsym.
--- gas/config/obj-elf.c.same 2004-04-30 15:48:18.000000000 -0700
+++ gas/config/obj-elf.c 2004-04-30 15:47:00.000000000 -0700
@@ -661,9 +661,7 @@ obj_elf_change_section (const char *name
/* Add a symbol for this section to the symbol table. */
secsym = symbol_find (name);
- if (secsym != NULL)
- symbol_set_bfdsym (secsym, sec->symbol);
- else
+ if (secsym == NULL)
symbol_table_insert (section_symbol (sec));
}
else if (attr != 0)