]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
PR gas/12011
authorAlan Modra <amodra@gmail.com>
Thu, 16 Sep 2010 23:55:10 +0000 (23:55 +0000)
committerAlan Modra <amodra@gmail.com>
Thu, 16 Sep 2010 23:55:10 +0000 (23:55 +0000)
* config/obj-elf.c (obj_elf_parse_section_letters): Correct test
for error return from md_elf_section_letter.
* config/tc-alpha.c (alpha_elf_section_letter): Correct error message.
* config/tc-i386.c (x86_64_section_letter): Likewise.
* config/tc-ia64.c (ia64_elf_section_letter): Likewise.
* config/tc-mep.c (mep_elf_section_letter): Likewise.
* gas/elf/bad-section-flag.d, * gas/elf/bad-section-flag.err,
* gas/elf/bad-section-flag.s: New test.
* gas/elf/elf.exp: Run it.

gas/ChangeLog
gas/config/obj-elf.c
gas/config/tc-alpha.c
gas/config/tc-i386.c
gas/config/tc-ia64.c
gas/config/tc-mep.c
gas/testsuite/ChangeLog
gas/testsuite/gas/elf/bad-section-flag.d [new file with mode: 0644]
gas/testsuite/gas/elf/bad-section-flag.err [new file with mode: 0644]
gas/testsuite/gas/elf/bad-section-flag.s [new file with mode: 0644]
gas/testsuite/gas/elf/elf.exp

index f230efc35004d78fb3c20a3b621b12c7750d5ae3..f8fb4f45685e5d81e807bd34c99a778d728f9f81 100644 (file)
@@ -1,3 +1,13 @@
+2010-09-17  Andrew Burgess  <aburgess@broadcom.com>
+
+       PR gas/12011
+       * config/obj-elf.c (obj_elf_parse_section_letters): Correct test
+       for error return from md_elf_section_letter.
+       * config/tc-alpha.c (alpha_elf_section_letter): Correct error message.
+       * config/tc-i386.c (x86_64_section_letter): Likewise.
+       * config/tc-ia64.c (ia64_elf_section_letter): Likewise.
+       * config/tc-mep.c (mep_elf_section_letter): Likewise.
+
 2010-09-15  Kai Tietz  <kai.tietz@onevision.com>
 
        * config/obj-coff-seh.c (seh_validate_seg): New funtion.
index e9ae4ea9e9481861abeffa8d4fe89107b9be3cfe..43820f51e0056ffa40ebaafbf1e0b86c8998bdcd 100644 (file)
@@ -794,7 +794,7 @@ obj_elf_parse_section_letters (char *str, size_t len, bfd_boolean *clone)
            char *bad_msg = _("unrecognized .section attribute: want a,e,w,x,M,S,G,T");
 #ifdef md_elf_section_letter
            bfd_vma md_attr = md_elf_section_letter (*str, &bad_msg);
-           if (md_attr > 0)
+           if (md_attr != (bfd_vma) -1)
              attr |= md_attr;
            else
 #endif
index 3cfca209ade28593fac46dfda9452018ea26d986..bd0a44f6980c783e6752bdd417412b62d01c3118 100644 (file)
@@ -5364,7 +5364,7 @@ alpha_elf_section_letter (int letter, char **ptr_msg)
   if (letter == 's')
     return SHF_ALPHA_GPREL;
 
-  *ptr_msg = _("Bad .section directive: want a,s,w,x,M,S,G,T in string");
+  *ptr_msg = _("bad .section directive: want a,s,w,x,M,S,G,T in string");
   return -1;
 }
 
index ee3470e48a2c22c5615debeba5c35fbbdcb8f6f9..cc08efb97df8ca2142fa4ddd5241bd5364ab20ad 100644 (file)
@@ -8949,10 +8949,10 @@ x86_64_section_letter (int letter, char **ptr_msg)
       if (letter == 'l')
        return SHF_X86_64_LARGE;
 
-      *ptr_msg = _("Bad .section directive: want a,l,w,x,M,S,G,T in string");
+      *ptr_msg = _("bad .section directive: want a,l,w,x,M,S,G,T in string");
     }
   else
-    *ptr_msg = _("Bad .section directive: want a,w,x,M,S,G,T in string");
+    *ptr_msg = _("bad .section directive: want a,w,x,M,S,G,T in string");
   return -1;
 }
 
index 73e31aaffdcbf6a9165b6737dc3e1ff91cecdedb..95f953fa2af867d81f28420c4d77bd056b003291 100644 (file)
@@ -861,7 +861,7 @@ ia64_elf_section_letter (int letter, char **ptr_msg)
     return SHF_IA_64_VMS_GLOBAL;
 #endif
 
-  *ptr_msg = _("Bad .section directive: want a,o,s,w,x,M,S,G,T in string");
+  *ptr_msg = _("bad .section directive: want a,o,s,w,x,M,S,G,T in string");
   return -1;
 }
 
index ae2463e019819602b14ee419f0854efeb530d48b..3a6bd6a7d465014412f4bc69ebca83305e2e2132 100644 (file)
@@ -2086,8 +2086,8 @@ mep_elf_section_letter (int letter, char **ptrmsg)
   if (letter == 'v')
     return SHF_MEP_VLIW;
 
-  *ptrmsg = _("Bad .section directive: want a,v,w,x,M,S in string");
-  return 0;
+  *ptrmsg = _("bad .section directive: want a,v,w,x,M,S in string");
+  return -1;
 }
 
 flagword
index 976dff4cf34871e2f101a52d586ff1cd57a28061..2bd1becf4abc36bb716f7c2691f099cd768676e1 100644 (file)
@@ -1,3 +1,10 @@
+2010-09-17  Andrew Burgess  <aburgess@broadcom.com>
+
+       PR gas/12011
+       * gas/elf/bad-section-flag.d, * gas/elf/bad-section-flag.err,
+       * gas/elf/bad-section-flag.s: New test.
+       * gas/elf/elf.exp: Run it.
+
 2010-09-16  Alan Modra  <amodra@gmail.com>
 
        * gas/all/redef3.d: Don't run on arc.
diff --git a/gas/testsuite/gas/elf/bad-section-flag.d b/gas/testsuite/gas/elf/bad-section-flag.d
new file mode 100644 (file)
index 0000000..98cbac8
--- /dev/null
@@ -0,0 +1,2 @@
+#name: Check bad section flag
+#error-output: bad-section-flag.err
diff --git a/gas/testsuite/gas/elf/bad-section-flag.err b/gas/testsuite/gas/elf/bad-section-flag.err
new file mode 100644 (file)
index 0000000..0af9b69
--- /dev/null
@@ -0,0 +1,2 @@
+.*bad-section-flag\.s: Assembler messages:
+.*bad-section-flag\.s:1: Fatal error: .*
diff --git a/gas/testsuite/gas/elf/bad-section-flag.s b/gas/testsuite/gas/elf/bad-section-flag.s
new file mode 100644 (file)
index 0000000..35496bd
--- /dev/null
@@ -0,0 +1 @@
+ .section ".rodata", "z~&q"
index 04f2749865abfffc05616293568fdf0bc1d6a641..e6f5f05733ab5dbbc70e78ce1c1b850368a75363 100644 (file)
@@ -167,4 +167,5 @@ if { ([istarget "*-*-*elf*"]
     run_dump_test "dwarf2-1"
     run_dump_test "dwarf2-2"
     run_dump_test "dwarf2-3"
+    run_dump_test "bad-section-flag"
 }