aboutsummaryrefslogtreecommitdiff
path: root/gas/symbols.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2004-05-11 15:53:47 +0000
committerNick Clifton <nickc@redhat.com>2004-05-11 15:53:47 +0000
commit22fe14ad41ac9f7b8fd61bc25e08e51094dcb116 (patch)
tree30b9b33fb64957ef4f0ebbf61820a56e1a86a8ca /gas/symbols.c
parentd0b57c3ab13c612490eedcf66de5e3826d0fc16c (diff)
downloadgdb-22fe14ad41ac9f7b8fd61bc25e08e51094dcb116.zip
gdb-22fe14ad41ac9f7b8fd61bc25e08e51094dcb116.tar.gz
gdb-22fe14ad41ac9f7b8fd61bc25e08e51094dcb116.tar.bz2
Apply H.J.'s patch to fix label arithmetic when multiple same-name sections are involved
Diffstat (limited to 'gas/symbols.c')
-rw-r--r--gas/symbols.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/gas/symbols.c b/gas/symbols.c
index 761a020..136227d 100644
--- a/gas/symbols.c
+++ b/gas/symbols.c
@@ -1,6 +1,6 @@
/* symbols.c -symbol table-
Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003
+ 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -2260,7 +2260,16 @@ symbol_set_bfdsym (symbolS *s, asymbol *bsym)
{
if (LOCAL_SYMBOL_CHECK (s))
s = local_symbol_convert ((struct local_symbol *) s);
- s->bsym = bsym;
+ /* Usually, it is harmless to reset a symbol to a BFD section
+ symbol. For example, obj_elf_change_section sets the BFD symbol
+ of an old symbol with the newly created section symbol. But when
+ we have multiple sections with the same name, the newly created
+ section may have the same name as an old section. We check if the
+ old symbol has been already marked as a section symbol before
+ resetting it. */
+ if ((s->bsym->flags & BSF_SECTION_SYM) == 0)
+ s->bsym = bsym;
+ /* else XXX - What do we do now ? */
}
#endif /* BFD_ASSEMBLER */