This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] gas: don't get confused by .asci{i,z} after .struct


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=35c1a4396497a4009c99e5587aa908bb6df4e1e6

commit 35c1a4396497a4009c99e5587aa908bb6df4e1e6
Author: Jan Beulich <jbeulich@novell.com>
Date:   Tue Dec 8 10:12:54 2015 +0100

    gas: don't get confused by .asci{i,z} after .struct
    
    While not allowed, this certainly shouldn't result in confusing the
    programmer (by skipping lines in unexpected ways): Without returning,
    demand_empty_rest_of_line() (at the end of the function) will demand
    the _next_ line to be empty, and without the conditional we would
    ignore the next line.

Diff:
---
 gas/ChangeLog |  5 +++++
 gas/read.c    | 17 +++++++++--------
 2 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/gas/ChangeLog b/gas/ChangeLog
index 53a618d..69e1061 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,10 @@
 2015-12-08  Jan Beulich  <jbeulich@suse.com>
 
+	* read.c (stringer): Move absolute section check up. Return
+	right away.
+
+2015-12-08  Jan Beulich  <jbeulich@suse.com>
+
 	* config/obj-elf.c (elf_file_symbol): Tighten condition for
 	moving BSF_FILE symbols.
 
diff --git a/gas/read.c b/gas/read.c
index 1718aaa..172d75f 100644
--- a/gas/read.c
+++ b/gas/read.c
@@ -5310,6 +5310,15 @@ stringer (int bits_appendzero)
   md_cons_align (1);
 #endif
 
+  /* If we have been switched into the abs_section then we
+     will not have an obstack onto which we can hang strings.  */
+  if (now_seg == absolute_section)
+    {
+      as_bad (_("strings must be placed into a section"));
+      ignore_rest_of_line ();
+      return;
+    }
+
   /* The following awkward logic is to parse ZERO or more strings,
      comma separated. Recall a string expression includes spaces
      before the opening '\"' and spaces after the closing '\"'.
@@ -5324,14 +5333,6 @@ stringer (int bits_appendzero)
     {
       c = ',';			/* Do loop.  */
     }
-  /* If we have been switched into the abs_section then we
-     will not have an obstack onto which we can hang strings.  */
-  if (now_seg == absolute_section)
-    {
-      as_bad (_("strings must be placed into a section"));
-      c = 0;
-      ignore_rest_of_line ();
-    }
 
   while (c == ',' || c == '<' || c == '"')
     {


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]