summaryrefslogtreecommitdiff
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
commitb24364b06aebeeedde9d7265e9b45ac4fa6e7a79 (patch)
treee93f3e4fc8d297d0ae91cc50a0944f1e1f216dbe /gas/symbols.c
parentf94bbb24ddd90054820a7ac8c5457a805ba5fe1c (diff)
downloadbinutils-redhat-b24364b06aebeeedde9d7265e9b45ac4fa6e7a79.tar.gz
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 761a020851..136227ddef 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 */