This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[PATCH] MIPS/BFD: Correct/clean up ELF FP attribute warning messages
- From: "Maciej W. Rozycki" <macro at codesourcery dot com>
- To: <binutils at sourceware dot org>
- Cc: Richard Sandiford <rdsandiford at googlemail dot com>
- Date: Tue, 13 Nov 2012 00:11:17 +0000
- Subject: [PATCH] MIPS/BFD: Correct/clean up ELF FP attribute warning messages
Hi,
While working on MIPS BFD ELF attribute code I have noticed that the
double- and single-float cases are swapped in warning messages -- the
former is denoted with "1" and the latter is denoted with "2" and the
messages interpret them in the opposite manner. I guess that is an
unfortunate consequence of using magic numbers everywhere rather than
meaningful names and then a human error. I have a follow-up change that
will correct this approach, however here is an independent essential
update to put the messages straight.
While working on this I have also noticed the messages are inconsistent
in that some report the name and the attribute of the output file first,
followed by the offending input file and its attribute, while the others
use the opposite order. This only adds to the overall confusion, so I
have decided to take the opportunity and make the structure of all the
messages consistent, with the output file first -- this way the left-hand
side is going to stay the same across all the messages, if multiple are
produced.
I had to adjust some test cases accordingly; other than that there have
been no regressions across the usual MIPS targets. OK to apply?
2012-11-13 Maciej W. Rozycki <macro@codesourcery.com>
bfd/
* elfxx-mips.c (mips_elf_merge_obj_attributes): Correct messages
for the -mdouble-float and -msingle-float cases throughout; make
all the messages report the output file consistently on the
left-hand side.
ld/testsuite/
* ld-mips-elf/attr-gnu-4-12.d: Adjust the warning expected
according to changes to BFD.
* ld-mips-elf/attr-gnu-4-14.d: Likewise.
* ld-mips-elf/attr-gnu-4-31.d: Likewise.
* ld-mips-elf/attr-gnu-4-32.d: Likewise.
* ld-mips-elf/attr-gnu-4-34.d: Likewise.
* ld-mips-elf/attr-gnu-4-41.d: Likewise.
Maciej
binutils-mips-bfd-attr-mesg.diff
Index: binutils-fsf-trunk-quilt/bfd/elfxx-mips.c
===================================================================
--- binutils-fsf-trunk-quilt.orig/bfd/elfxx-mips.c 2012-10-23 00:21:27.000000000 +0100
+++ binutils-fsf-trunk-quilt/bfd/elfxx-mips.c 2012-11-10 01:41:15.831177486 +0000
@@ -13789,7 +13789,7 @@ mips_elf_merge_obj_attributes (bfd *ibfd
{
case 2:
_bfd_error_handler
- (_("Warning: %B uses -msingle-float, %B uses -mdouble-float"),
+ (_("Warning: %B uses -mdouble-float, %B uses -msingle-float"),
obfd, ibfd);
break;
@@ -13801,7 +13801,7 @@ mips_elf_merge_obj_attributes (bfd *ibfd
case 4:
_bfd_error_handler
- (_("Warning: %B uses -msingle-float, %B uses -mips32r2 -mfp64"),
+ (_("Warning: %B uses -mdouble-float, %B uses -mips32r2 -mfp64"),
obfd, ibfd);
break;
@@ -13816,7 +13816,7 @@ mips_elf_merge_obj_attributes (bfd *ibfd
case 1:
_bfd_error_handler
(_("Warning: %B uses -msingle-float, %B uses -mdouble-float"),
- ibfd, obfd);
+ obfd, ibfd);
break;
case 3:
@@ -13827,7 +13827,7 @@ mips_elf_merge_obj_attributes (bfd *ibfd
case 4:
_bfd_error_handler
- (_("Warning: %B uses -mdouble-float, %B uses -mips32r2 -mfp64"),
+ (_("Warning: %B uses -msingle-float, %B uses -mips32r2 -mfp64"),
obfd, ibfd);
break;
@@ -13843,8 +13843,8 @@ mips_elf_merge_obj_attributes (bfd *ibfd
case 2:
case 4:
_bfd_error_handler
- (_("Warning: %B uses hard float, %B uses soft float"),
- ibfd, obfd);
+ (_("Warning: %B uses soft float, %B uses hard float"),
+ obfd, ibfd);
break;
default:
@@ -13857,14 +13857,14 @@ mips_elf_merge_obj_attributes (bfd *ibfd
{
case 1:
_bfd_error_handler
- (_("Warning: %B uses -msingle-float, %B uses -mips32r2 -mfp64"),
- ibfd, obfd);
+ (_("Warning: %B uses -mips32r2 -mfp64, %B uses -mdouble-float"),
+ obfd, ibfd);
break;
case 2:
_bfd_error_handler
- (_("Warning: %B uses -mdouble-float, %B uses -mips32r2 -mfp64"),
- ibfd, obfd);
+ (_("Warning: %B uses -mips32r2 -mfp64, %B uses -msingle-float"),
+ obfd, ibfd);
break;
case 3:
Index: binutils-fsf-trunk-quilt/ld/testsuite/ld-mips-elf/attr-gnu-4-12.d
===================================================================
--- binutils-fsf-trunk-quilt.orig/ld/testsuite/ld-mips-elf/attr-gnu-4-12.d 2012-07-04 12:07:12.000000000 +0100
+++ binutils-fsf-trunk-quilt/ld/testsuite/ld-mips-elf/attr-gnu-4-12.d 2012-11-10 01:58:27.130851789 +0000
@@ -1,5 +1,5 @@
#source: attr-gnu-4-1.s
#source: attr-gnu-4-2.s
#ld: -r
-#warning: Warning: .* uses -msingle-float, .* uses -mdouble-float
+#warning: Warning: .* uses -mdouble-float, .* uses -msingle-float
#target: mips*-*-*
Index: binutils-fsf-trunk-quilt/ld/testsuite/ld-mips-elf/attr-gnu-4-14.d
===================================================================
--- binutils-fsf-trunk-quilt.orig/ld/testsuite/ld-mips-elf/attr-gnu-4-14.d 2012-07-04 12:07:12.000000000 +0100
+++ binutils-fsf-trunk-quilt/ld/testsuite/ld-mips-elf/attr-gnu-4-14.d 2012-11-10 01:59:17.321561620 +0000
@@ -1,5 +1,5 @@
#source: attr-gnu-4-1.s
#source: attr-gnu-4-4.s
#ld: -r
-#warning: Warning: .* uses -msingle-float, .* uses -mips32r2 -mfp64
+#warning: Warning: .* uses -mdouble-float, .* uses -mips32r2 -mfp64
#target: mips*-*-*
Index: binutils-fsf-trunk-quilt/ld/testsuite/ld-mips-elf/attr-gnu-4-31.d
===================================================================
--- binutils-fsf-trunk-quilt.orig/ld/testsuite/ld-mips-elf/attr-gnu-4-31.d 2012-07-04 12:07:12.000000000 +0100
+++ binutils-fsf-trunk-quilt/ld/testsuite/ld-mips-elf/attr-gnu-4-31.d 2012-11-10 02:00:13.621487837 +0000
@@ -1,5 +1,5 @@
#source: attr-gnu-4-3.s
#source: attr-gnu-4-1.s
#ld: -r
-#warning: Warning: .* uses hard float, .* uses soft float
+#warning: Warning: .* uses soft float, .* uses hard float
#target: mips*-*-*
Index: binutils-fsf-trunk-quilt/ld/testsuite/ld-mips-elf/attr-gnu-4-32.d
===================================================================
--- binutils-fsf-trunk-quilt.orig/ld/testsuite/ld-mips-elf/attr-gnu-4-32.d 2012-07-04 12:07:12.000000000 +0100
+++ binutils-fsf-trunk-quilt/ld/testsuite/ld-mips-elf/attr-gnu-4-32.d 2012-11-10 02:00:34.430698406 +0000
@@ -1,5 +1,5 @@
#source: attr-gnu-4-3.s
#source: attr-gnu-4-2.s
#ld: -r
-#warning: Warning: .* uses hard float, .* uses soft float
+#warning: Warning: .* uses soft float, .* uses hard float
#target: mips*-*-*
Index: binutils-fsf-trunk-quilt/ld/testsuite/ld-mips-elf/attr-gnu-4-34.d
===================================================================
--- binutils-fsf-trunk-quilt.orig/ld/testsuite/ld-mips-elf/attr-gnu-4-34.d 2012-07-04 12:07:12.000000000 +0100
+++ binutils-fsf-trunk-quilt/ld/testsuite/ld-mips-elf/attr-gnu-4-34.d 2012-11-10 02:00:53.050511765 +0000
@@ -1,5 +1,5 @@
#source: attr-gnu-4-3.s
#source: attr-gnu-4-4.s
#ld: -r
-#warning: Warning: .* uses hard float, .* uses soft float
+#warning: Warning: .* uses soft float, .* uses hard float
#target: mips*-*-*
Index: binutils-fsf-trunk-quilt/ld/testsuite/ld-mips-elf/attr-gnu-4-41.d
===================================================================
--- binutils-fsf-trunk-quilt.orig/ld/testsuite/ld-mips-elf/attr-gnu-4-41.d 2012-07-04 12:07:12.000000000 +0100
+++ binutils-fsf-trunk-quilt/ld/testsuite/ld-mips-elf/attr-gnu-4-41.d 2012-11-10 02:01:26.850513797 +0000
@@ -1,5 +1,5 @@
#source: attr-gnu-4-4.s
#source: attr-gnu-4-1.s
#ld: -r
-#warning: Warning: .* uses -msingle-float, .* uses -mips32r2 -mfp64
+#warning: Warning: .* uses -mips32r2 -mfp64, .* uses -mdouble-float
#target: mips*-*-*