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.
This commit is contained in:
Alan Modra
2011-02-25 13:45:54 +00:00
parent eba5cfbc38
commit e1e9003466
5 changed files with 18 additions and 20 deletions
gas
ld/testsuite
ChangeLog
ld-mn10300
ld-sh/sh64

@ -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> 2011-02-21 Maciej W. Rozycki <macro@codesourcery.com>
* config/tc-mips.c (mips_ip) <'o'>: Remove duplicate * config/tc-mips.c (mips_ip) <'o'>: Remove duplicate

@ -1,6 +1,6 @@
/* ELF object file format /* ELF object file format
Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 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. Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler. 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) if (sy_obj->size != NULL)
{ {
switch (sy_obj->size->X_op) if (resolve_expression (sy_obj->size)
{ && sy_obj->size->X_op == O_constant)
case O_subtract: S_SET_SIZE (symp, sy_obj->size->X_add_number);
S_SET_SIZE (symp, else
(S_GET_VALUE (sy_obj->size->X_add_symbol) as_bad (_(".size expression does not evaluate to a constant"));
+ 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;
}
free (sy_obj->size); free (sy_obj->size);
sy_obj->size = NULL; sy_obj->size = NULL;
} }

@ -1,3 +1,8 @@
2011-02-25 Alan Modra <amodra@gmail.com>
* ld-mn10300/i135409-3.s: Correct .size label reference.
* ld-sh/sh64/stolib.s: Likewise.
2011-02-23 H.J. Lu <hongjiu.lu@intel.com> 2011-02-23 H.J. Lu <hongjiu.lu@intel.com>
* ld-elf/new.cc: Don't include <exception_defines.h>. * ld-elf/new.cc: Don't include <exception_defines.h>.

@ -10,7 +10,7 @@ A:
BOTTOM: BOTTOM:
.balign 0x8 .balign 0x8
add D0,D1 add D0,D1
.size _func, .-func .size _func, .-_func
.data .data
L001: L001:

@ -4,4 +4,4 @@
bar: bar:
ptabs r18, tr0 ptabs r18, tr0
blink tr0, r63 blink tr0, r63
.Lfe_bar: .size bar,.Lfe_bar-X .Lfe_bar: .size bar,.Lfe_bar-bar