aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2011-02-25 13:45:54 +0000
committerAlan Modra <amodra@gmail.com>2011-02-25 13:45:54 +0000
commite1e9003466dcc4d2c77362fad3817c35179cd5b6 (patch)
tree32cb225770e31b013ed099f44ba00ceaa37b17fb /gas
parenteba5cfbc38107d45b945c41b4e2c51957e3790bd (diff)
downloadgdb-e1e9003466dcc4d2c77362fad3817c35179cd5b6.zip
gdb-e1e9003466dcc4d2c77362fad3817c35179cd5b6.tar.gz
gdb-e1e9003466dcc4d2c77362fad3817c35179cd5b6.tar.bz2
PR gas/12519
* config/obj-elf.c (elf_frob_symbol): Properly handle size expression. * ld-mn10300/i135409-3.s: Correct .size label reference. * ld-sh/sh64/stolib.s: Likewise.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/config/obj-elf.c24
2 files changed, 11 insertions, 18 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 73ee82a..b90e75f 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2011-02-25 Alan Modra <amodra@gmail.com>
+
+ PR gas/12519
+ * config/obj-elf.c (elf_frob_symbol): Properly handle size expression.
+
2011-02-21 Maciej W. Rozycki <macro@codesourcery.com>
* config/tc-mips.c (mips_ip) <'o'>: Remove duplicate
diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c
index c6dc8d6..969a509 100644
--- a/gas/config/obj-elf.c
+++ b/gas/config/obj-elf.c
@@ -1,6 +1,6 @@
/* ELF object file format
Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
@@ -1889,23 +1889,11 @@ elf_frob_symbol (symbolS *symp, int *puntp)
if (sy_obj->size != NULL)
{
- switch (sy_obj->size->X_op)
- {
- case O_subtract:
- S_SET_SIZE (symp,
- (S_GET_VALUE (sy_obj->size->X_add_symbol)
- + sy_obj->size->X_add_number
- - S_GET_VALUE (sy_obj->size->X_op_symbol)));
- break;
- case O_constant:
- S_SET_SIZE (symp,
- (S_GET_VALUE (sy_obj->size->X_add_symbol)
- + sy_obj->size->X_add_number));
- break;
- default:
- as_bad (_(".size expression too complicated to fix up"));
- break;
- }
+ if (resolve_expression (sy_obj->size)
+ && sy_obj->size->X_op == O_constant)
+ S_SET_SIZE (symp, sy_obj->size->X_add_number);
+ else
+ as_bad (_(".size expression does not evaluate to a constant"));
free (sy_obj->size);
sy_obj->size = NULL;
}