aboutsummaryrefslogtreecommitdiff
path: root/gas/as.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2011-03-16 12:58:26 +0000
committerH.J. Lu <hjl.tools@gmail.com>2011-03-16 12:58:26 +0000
commit21be61f5885f889c05f0bc9c36125a68e4995810 (patch)
treee79dc6188b772e474de1647469f8214fff6a07a1 /gas/as.c
parent9a6f1302f0f4e4d12ce8fb7197d4905480eeecaa (diff)
downloadgdb-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/as.c')
-rw-r--r--gas/as.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gas/as.c b/gas/as.c
index 2c55047..380259c 100644
--- a/gas/as.c
+++ b/gas/as.c
@@ -284,6 +284,9 @@ Options:\n\
--execstack require executable stack for this object\n"));
fprintf (stream, _("\
--noexecstack don't require executable stack for this object\n"));
+ fprintf (stream, _("\
+ --size-check=[error|warning]\n\
+ ELF .size directive check (default --size-check=error)\n"));
#endif
fprintf (stream, _("\
-f skip whitespace and comment preprocessing\n"));
@@ -443,6 +446,7 @@ parse_args (int * pargc, char *** pargv)
OPTION_TARGET_HELP,
OPTION_EXECSTACK,
OPTION_NOEXECSTACK,
+ OPTION_SIZE_CHECK,
OPTION_ALTERNATE,
OPTION_AL,
OPTION_HASH_TABLE_SIZE,
@@ -476,6 +480,7 @@ parse_args (int * pargc, char *** pargv)
#if defined OBJ_ELF || defined OBJ_MAYBE_ELF
,{"execstack", no_argument, NULL, OPTION_EXECSTACK}
,{"noexecstack", no_argument, NULL, OPTION_NOEXECSTACK}
+ ,{"size-check", required_argument, NULL, OPTION_SIZE_CHECK}
#endif
,{"fatal-warnings", no_argument, NULL, OPTION_WARN_FATAL}
,{"gdwarf-2", no_argument, NULL, OPTION_GDWARF2}
@@ -813,6 +818,15 @@ This program has absolutely no warranty.\n"));
flag_noexecstack = 1;
flag_execstack = 0;
break;
+
+ case OPTION_SIZE_CHECK:
+ if (strcasecmp (optarg, "error") == 0)
+ flag_size_check = size_check_error;
+ else if (strcasecmp (optarg, "warning") == 0)
+ flag_size_check = size_check_warning;
+ else
+ as_fatal (_("Invalid --size-check= option: `%s'"), optarg);
+ break;
#endif
case 'Z':
flag_always_generate_output = 1;