This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH bfin] Call as_fatal for bad -mcpu option


Since we have already reported to user on bad -mcpu option in Blackfin md_parse_option, we could just call as_fatal instead of error, otherwise, gas generic option parse code will report the error again. The worse is that code is not suitable for reporting error for long option, the index of long option will be printed out as a bogus char. Like this:

$ bfin-uclinux-as -mcpu=
Assembler messages:
Error: -mcpu= is not valid
Error: unrecognized option -?

$ bfin-uclinux-as -mcpu=bf516-0.11
Error: -mcpu=bf516-0.11 has invalid silicon revision
Error: unrecognized option -?bf516-0.11

With this patch

$ ./as-new -mcpu=
Assembler messages:
Fatal error: -mcpu= is not valid
$ ./as-new -mcpu=bf516-0.11Assembler messages:
Fatal error: -mcpu=bf516-0.11 has invalid silicon revision


Committed.



Jie
	* config/tc-bfin.c (md_parse_option): Call as_fatal for bad
	-mcpu= option.

Index: config/tc-bfin.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-bfin.c,v
retrieving revision 1.29
diff -u -p -r1.29 tc-bfin.c
--- config/tc-bfin.c	3 Sep 2009 17:42:52 -0000	1.29
+++ config/tc-bfin.c	3 Sep 2009 18:01:11 -0000
@@ -351,10 +351,7 @@ md_parse_option (int c ATTRIBUTE_UNUSED,
 	  }
 
 	if (p == NULL)
-	  {
-	    error ("-mcpu=%s is not valid", arg);
-	    return 0;
-	  }
+	  as_fatal ("-mcpu=%s is not valid", arg);
 
 	bfin_cpu_type = bfin_cpus[i].type;
 
@@ -388,8 +385,7 @@ md_parse_option (int c ATTRIBUTE_UNUSED,
 		|| si_major > 0xff || si_minor > 0xff)
 	      {
 	      invalid_silicon_revision:
-		error ("-mcpu=%s has invalid silicon revision", arg);
-		return 0;
+		as_fatal ("-mcpu=%s has invalid silicon revision", arg);
 	      }
 
 	    bfin_si_revision = (si_major << 8) | si_minor;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]