diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2011-03-16 12:58:26 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2011-03-16 12:58:26 +0000 |
commit | 21be61f5885f889c05f0bc9c36125a68e4995810 (patch) | |
tree | e79dc6188b772e474de1647469f8214fff6a07a1 /gas/config | |
parent | 9a6f1302f0f4e4d12ce8fb7197d4905480eeecaa (diff) | |
download | gdb-21be61f5885f889c05f0bc9c36125a68e4995810.zip gdb-21be61f5885f889c05f0bc9c36125a68e4995810.tar.gz gdb-21be61f5885f889c05f0bc9c36125a68e4995810.tar.bz2 |
Add --size-check=[error|warning].
gas/
2011-03-16 H.J. Lu <hongjiu.lu@intel.com>
* as.c (show_usage): Add --size-check=.
(parse_args): Add and handle OPTION_SIZE_CHECK.
* as.h (flag_size_check): New.
* config/obj-elf.c (elf_frob_symbol): Use as_bad to report
bad .size directive only for --size-check=error.
* doc/as.texinfo: Document --size-check=.
gas/testsuite/
2011-03-16 H.J. Lu <hongjiu.lu@intel.com>
* gas/i386/bad-size.d: New.
* gas/i386/bad-size.s: Likewise.
* gas/i386/bad-size.warn: Likewise.
* gas/i386/i386.exp: Run bad-size for ELF targets.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/obj-elf.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c index d43409a..37a8020 100644 --- a/gas/config/obj-elf.c +++ b/gas/config/obj-elf.c @@ -1898,6 +1898,12 @@ elf_frob_symbol (symbolS *symp, int *puntp) { const char *op_name = NULL; const char *add_name = NULL; + PRINTF_LIKE ((*as_error)); + + if (flag_size_check == size_check_error) + as_error = as_bad; + else + as_error = as_warn; if (size->X_op == O_subtract) { @@ -1909,9 +1915,9 @@ elf_frob_symbol (symbolS *symp, int *puntp) add_name = NULL; if (op_name && add_name) - as_bad (_(".size expression with symbols `%s' and `%s' " - "does not evaluate to a constant"), - op_name, add_name); + as_error (_(".size expression with symbols `%s' and " + "`%s' does not evaluate to a constant"), + op_name, add_name); else { const char *name; @@ -1924,13 +1930,15 @@ elf_frob_symbol (symbolS *symp, int *puntp) name = NULL; if (name) - as_bad (_(".size expression with symbol `%s' " - "does not evaluate to a constant"), name); + as_error (_(".size expression with symbol `%s' " + "does not evaluate to a constant"), + name); } } if (!op_name && !add_name) - as_bad (_(".size expression does not evaluate to a constant")); + as_error (_(".size expression does not evaluate to a " + "constant")); } free (sy_obj->size); sy_obj->size = NULL; |