aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2010-09-16 23:55:10 +0000
committerAlan Modra <amodra@gmail.com>2010-09-16 23:55:10 +0000
commit8f3bae45202d47cc88273b0060a458841cd46282 (patch)
treed4787efeb6e0b9decb4271af7a13af17c121d598 /gas
parent1558ab4ce71d8db60e2897fc2ea8a963ded878dd (diff)
downloadgdb-8f3bae45202d47cc88273b0060a458841cd46282.zip
gdb-8f3bae45202d47cc88273b0060a458841cd46282.tar.gz
gdb-8f3bae45202d47cc88273b0060a458841cd46282.tar.bz2
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. * 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.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog10
-rw-r--r--gas/config/obj-elf.c2
-rw-r--r--gas/config/tc-alpha.c2
-rw-r--r--gas/config/tc-i386.c4
-rw-r--r--gas/config/tc-ia64.c2
-rw-r--r--gas/config/tc-mep.c4
-rw-r--r--gas/testsuite/ChangeLog7
-rw-r--r--gas/testsuite/gas/elf/bad-section-flag.d2
-rw-r--r--gas/testsuite/gas/elf/bad-section-flag.err2
-rw-r--r--gas/testsuite/gas/elf/bad-section-flag.s1
-rw-r--r--gas/testsuite/gas/elf/elf.exp1
11 files changed, 30 insertions, 7 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index f230efc..f8fb4f4 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -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.
diff --git a/gas/config/obj-elf.c b/gas/config/obj-elf.c
index e9ae4ea..43820f5 100644
--- a/gas/config/obj-elf.c
+++ b/gas/config/obj-elf.c
@@ -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
diff --git a/gas/config/tc-alpha.c b/gas/config/tc-alpha.c
index 3cfca20..bd0a44f 100644
--- a/gas/config/tc-alpha.c
+++ b/gas/config/tc-alpha.c
@@ -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;
}
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index ee3470e..cc08efb 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -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;
}
diff --git a/gas/config/tc-ia64.c b/gas/config/tc-ia64.c
index 73e31aa..95f953f 100644
--- a/gas/config/tc-ia64.c
+++ b/gas/config/tc-ia64.c
@@ -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;
}
diff --git a/gas/config/tc-mep.c b/gas/config/tc-mep.c
index ae2463e..3a6bd6a 100644
--- a/gas/config/tc-mep.c
+++ b/gas/config/tc-mep.c
@@ -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
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 976dff4..2bd1bec 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -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
index 0000000..98cbac8
--- /dev/null
+++ b/gas/testsuite/gas/elf/bad-section-flag.d
@@ -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
index 0000000..0af9b69
--- /dev/null
+++ b/gas/testsuite/gas/elf/bad-section-flag.err
@@ -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
index 0000000..35496bd
--- /dev/null
+++ b/gas/testsuite/gas/elf/bad-section-flag.s
@@ -0,0 +1 @@
+ .section ".rodata", "z~&q"
diff --git a/gas/testsuite/gas/elf/elf.exp b/gas/testsuite/gas/elf/elf.exp
index 04f2749..e6f5f05 100644
--- a/gas/testsuite/gas/elf/elf.exp
+++ b/gas/testsuite/gas/elf/elf.exp
@@ -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"
}