OSDN Git Service

PR gas/12011
authoramodra <amodra>
Thu, 16 Sep 2010 23:55:08 +0000 (23:55 +0000)
committeramodra <amodra>
Thu, 16 Sep 2010 23:55:08 +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 f230efc..f8fb4f4 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 e9ae4ea..43820f5 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 3cfca20..bd0a44f 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 ee3470e..cc08efb 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 73e31aa..95f953f 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 ae2463e..3a6bd6a 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 976dff4..2bd1bec 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 04f2749..e6f5f05 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"
 }