diff --git a/binutils/readelf.c b/binutils/readelf.c index 55faf83..0471e73 100644 --- a/binutils/readelf.c +++ b/binutils/readelf.c @@ -13196,7 +13196,8 @@ display_sparc_gnu_attribute (unsigned char * p, static void print_mips_fp_abi_value (int val) { - switch (val) + /* Mask out the compatibility value, if any. */ + switch (val & ~Val_GNU_MIPS_ABI_FP_NAN2008) { case Val_GNU_MIPS_ABI_FP_ANY: printf (_("Hard or soft float\n")); @@ -13222,9 +13223,6 @@ print_mips_fp_abi_value (int val) case Val_GNU_MIPS_ABI_FP_64A: printf (_("Hard float compat (32-bit CPU, 64-bit FPU)\n")); break; - case Val_GNU_MIPS_ABI_FP_NAN2008: - printf (_("NaN 2008 compatibility\n")); - break; default: printf ("??? (%d)\n", val); break; diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index f67fbd0..17f1b96 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -3740,7 +3740,8 @@ fpabi_requires (int fpabi, const char *what) static void check_fpabi (int fpabi) { - switch (fpabi) + /* Mask out the compatibility value, if any. */ + switch (fpabi & ~Val_GNU_MIPS_ABI_FP_NAN2008) { case Val_GNU_MIPS_ABI_FP_DOUBLE: if (file_mips_opts.soft_float) @@ -3797,10 +3798,6 @@ check_fpabi (int fpabi) Tag_GNU_MIPS_ABI_FP, fpabi); break; - case Val_GNU_MIPS_ABI_FP_NAN2008: - /* Silently ignore compatibility value. */ - break; - default: as_warn (_(".gnu_attribute %d,%d is not a recognized" " floating-point ABI"), Tag_GNU_MIPS_ABI_FP, fpabi); diff --git a/include/elf/mips.h b/include/elf/mips.h index 57de3bc..a3db0b6 100644 --- a/include/elf/mips.h +++ b/include/elf/mips.h @@ -1302,6 +1302,9 @@ enum implementation of the MIPS NaN2008 functionality. */ Val_GNU_MIPS_ABI_FP_NAN2008 = 8, + /* The Values 9 through 15 are reserved. If additions are made to + this enumeration, the next value should be 16. */ + /* Values defined for Tag_GNU_MIPS_ABI_MSA. */ /* Not tagged or not using any ABIs affected by the differences. */ diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-4-0-16.d b/ld/testsuite/ld-mips-elf/attr-gnu-4-0-16.d new file mode 100644 index 0000000..718ee1b --- /dev/null +++ b/ld/testsuite/ld-mips-elf/attr-gnu-4-0-16.d @@ -0,0 +1,21 @@ +#source: attr-gnu-4-0.s +#source: attr-gnu-4-16.s -W +#ld: -r +#readelf: -A + +Attribute Section: gnu +File Attributes + Tag_GNU_MIPS_ABI_FP: \?\?\? \(16\) + +MIPS ABI Flags Version: 0 + +ISA: MIPS.* +GPR size: .* +CPR1 size: .* +CPR2 size: 0 +FP ABI: \?\?\? \(16\) +ISA Extension: .* +ASEs: + None +FLAGS 1: 0000000. +FLAGS 2: 00000000 diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-4-08.d b/ld/testsuite/ld-mips-elf/attr-gnu-4-08.d index 82215b0..9a17b5f 100644 --- a/ld/testsuite/ld-mips-elf/attr-gnu-4-08.d +++ b/ld/testsuite/ld-mips-elf/attr-gnu-4-08.d @@ -5,7 +5,7 @@ Attribute Section: gnu File Attributes - Tag_GNU_MIPS_ABI_FP: NaN 2008 compatibility + Tag_GNU_MIPS_ABI_FP: Hard or soft float MIPS ABI Flags Version: 0 @@ -13,9 +13,10 @@ ISA: MIPS.* GPR size: .* CPR1 size: .* CPR2 size: 0 -FP ABI: NaN 2008 compatibility +FP ABI: Hard or soft float ISA Extension: .* ASEs: None FLAGS 1: 0000000. FLAGS 2: 00000000 + diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-4-09.d b/ld/testsuite/ld-mips-elf/attr-gnu-4-09.d deleted file mode 100644 index 20c0eba..0000000 --- a/ld/testsuite/ld-mips-elf/attr-gnu-4-09.d +++ /dev/null @@ -1,21 +0,0 @@ -#source: attr-gnu-4-0.s -#source: attr-gnu-4-9.s -W -#ld: -r -#readelf: -A - -Attribute Section: gnu -File Attributes - Tag_GNU_MIPS_ABI_FP: \?\?\? \(9\) - -MIPS ABI Flags Version: 0 - -ISA: MIPS.* -GPR size: .* -CPR1 size: .* -CPR2 size: 0 -FP ABI: \?\?\? \(9\) -ISA Extension: .* -ASEs: - None -FLAGS 1: 0000000. -FLAGS 2: 00000000 diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-4-16.s b/ld/testsuite/ld-mips-elf/attr-gnu-4-16.s new file mode 100644 index 0000000..a810148 --- /dev/null +++ b/ld/testsuite/ld-mips-elf/attr-gnu-4-16.s @@ -0,0 +1 @@ +.gnu_attribute 4,16 diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-4-19.d b/ld/testsuite/ld-mips-elf/attr-gnu-4-19.d deleted file mode 100644 index 008dcc1..0000000 --- a/ld/testsuite/ld-mips-elf/attr-gnu-4-19.d +++ /dev/null @@ -1,22 +0,0 @@ -#source: attr-gnu-4-1.s -#source: attr-gnu-4-9.s -W -#ld: -r -#readelf: -A -#warning: Warning: .* uses -mdouble-float \(set by .*\), .* uses unknown floating point ABI 9 - -Attribute Section: gnu -File Attributes - Tag_GNU_MIPS_ABI_FP: Hard float \(double precision\) - -MIPS ABI Flags Version: 0 - -ISA: MIPS.* -GPR size: .* -CPR1 size: .* -CPR2 size: 0 -FP ABI: Hard float \(double precision\) -ISA Extension: .* -ASEs: - None -FLAGS 1: 0000000. -FLAGS 2: 00000000 diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-4-29.d b/ld/testsuite/ld-mips-elf/attr-gnu-4-29.d deleted file mode 100644 index dd460e5..0000000 --- a/ld/testsuite/ld-mips-elf/attr-gnu-4-29.d +++ /dev/null @@ -1,22 +0,0 @@ -#source: attr-gnu-4-2.s -#source: attr-gnu-4-9.s -W -#ld: -r -#readelf: -A -#warning: Warning: .* uses -msingle-float \(set by .*\), .* uses unknown floating point ABI 9 - -Attribute Section: gnu -File Attributes - Tag_GNU_MIPS_ABI_FP: Hard float \(single precision\) - -MIPS ABI Flags Version: 0 - -ISA: MIPS.* -GPR size: .* -CPR1 size: .* -CPR2 size: 0 -FP ABI: Hard float \(single precision\) -ISA Extension: .* -ASEs: - None -FLAGS 1: 0000000. -FLAGS 2: 00000000 diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-4-39.d b/ld/testsuite/ld-mips-elf/attr-gnu-4-39.d deleted file mode 100644 index 458c129..0000000 --- a/ld/testsuite/ld-mips-elf/attr-gnu-4-39.d +++ /dev/null @@ -1,22 +0,0 @@ -#source: attr-gnu-4-3.s -#source: attr-gnu-4-9.s -W -#ld: -r -#readelf: -A -#warning: Warning: .* uses -msoft-float \(set by .*\), .* uses unknown floating point ABI 9 - -Attribute Section: gnu -File Attributes - Tag_GNU_MIPS_ABI_FP: Soft float - -MIPS ABI Flags Version: 0 - -ISA: MIPS.* -GPR size: .* -CPR1 size: .* -CPR2 size: 0 -FP ABI: Soft float -ISA Extension: .* -ASEs: - None -FLAGS 1: 0000000. -FLAGS 2: 00000000 diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-4-49.d b/ld/testsuite/ld-mips-elf/attr-gnu-4-49.d deleted file mode 100644 index d03074e..0000000 --- a/ld/testsuite/ld-mips-elf/attr-gnu-4-49.d +++ /dev/null @@ -1,6 +0,0 @@ -#source: attr-gnu-4-4.s -W -#source: attr-gnu-4-9.s -W -#ld: -r -#error: \A[^\n]*: Warning: .* uses -mips32r2 -mfp64 \(12 callee-saved\) \(set by .*\), .* uses unknown floating point ABI 9\n -#error: [^\n]*: [^\n]* linking -mfp32 module with previous -mfp64 modules\n -#error: [^\n]*: failed to merge target specific data of file [^\n]*\.o\Z diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-4-59.d b/ld/testsuite/ld-mips-elf/attr-gnu-4-59.d deleted file mode 100644 index 59516ce..0000000 --- a/ld/testsuite/ld-mips-elf/attr-gnu-4-59.d +++ /dev/null @@ -1,4 +0,0 @@ -#source: attr-gnu-4-5.s -#source: attr-gnu-4-9.s -W -mips32r2 -#ld: -r -#warning: Warning: .* uses -mfpxx \(set by .*\), .* uses unknown floating point ABI 9 diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-4-69.d b/ld/testsuite/ld-mips-elf/attr-gnu-4-69.d deleted file mode 100644 index abf8e3e..0000000 --- a/ld/testsuite/ld-mips-elf/attr-gnu-4-69.d +++ /dev/null @@ -1,4 +0,0 @@ -#source: attr-gnu-4-6.s -#source: attr-gnu-4-9.s -W -mips32r2 -#ld: -r -#warning: Warning: .* uses -mgp32 -mfp64 \(set by .*\), .* uses unknown floating point ABI 9 diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-4-79.d b/ld/testsuite/ld-mips-elf/attr-gnu-4-79.d deleted file mode 100644 index a70a22f..0000000 --- a/ld/testsuite/ld-mips-elf/attr-gnu-4-79.d +++ /dev/null @@ -1,4 +0,0 @@ -#source: attr-gnu-4-7.s -#source: attr-gnu-4-9.s -W -mips32r2 -#ld: -r -#warning: Warning: .* uses -mgp32 -mfp64 -mno-odd-spreg \(set by .*\), .* uses unknown floating point ABI 9 diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-4-89.d b/ld/testsuite/ld-mips-elf/attr-gnu-4-89.d deleted file mode 100644 index 331a3ef..0000000 --- a/ld/testsuite/ld-mips-elf/attr-gnu-4-89.d +++ /dev/null @@ -1,4 +0,0 @@ -#source: attr-gnu-4-8.s -#source: attr-gnu-4-9.s -W -mips32r2 -#ld: -r -#warning: Warning: .* uses -mgp32 -mfp64 -mno-odd-spreg \(set by .*\), .* uses unknown floating point ABI 8 diff --git a/ld/testsuite/ld-mips-elf/attr-gnu-4-9.s b/ld/testsuite/ld-mips-elf/attr-gnu-4-9.s deleted file mode 100644 index 49c7a87..0000000 --- a/ld/testsuite/ld-mips-elf/attr-gnu-4-9.s +++ /dev/null @@ -1 +0,0 @@ -.gnu_attribute 4,9 diff --git a/ld/testsuite/ld-mips-elf/mips-elf.exp b/ld/testsuite/ld-mips-elf/mips-elf.exp index dd8b228..dd469d2 100644 --- a/ld/testsuite/ld-mips-elf/mips-elf.exp +++ b/ld/testsuite/ld-mips-elf/mips-elf.exp @@ -674,17 +674,18 @@ foreach firstfpabi [list 0 1 2 3 4 5 6 7 ] { } } foreach firstfpabi [list 4 5 6 7 ] { - foreach secondfpabi [list 0 1 2 3 8 9] { + foreach secondfpabi [list 0 1 2 3 8 ] { run_dump_test "attr-gnu-4-${firstfpabi}${secondfpabi}" $o32flagslist } } foreach firstfpabi [list 0 1 2 3 ] { - foreach secondfpabi [list 0 1 2 3 8 9] { + foreach secondfpabi [list 0 1 2 3 8 ] { run_dump_test "attr-gnu-4-${firstfpabi}${secondfpabi}" } } run_dump_test "attr-gnu-4-81" +run_dump_test "attr-gnu-4-0-16" run_dump_test "attr-gnu-8-00" run_dump_test "attr-gnu-8-01"