This is the mail archive of the binutils@sources.redhat.com 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]

[PATCH] Fix MIPS gas .section parsing


Hi All,

parsing of .section statements was broken by
http://sources.redhat.com/ml/binutils/2002-08/msg00195.html
for statements like ".section .foo; .previous".

This patch fixes it.


Thiemo


2002-09-17  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>

	/gas/ChangeLog
	* config/tc-mips.c (s_change_section): Fix parsing. Code cleanup.


diff -BurpNX /bigdisk/src/gcc-exclude source-orig/gas/config/tc-mips.c source/gas/config/tc-mips.c
--- source-orig/gas/config/tc-mips.c	Tue Sep 17 11:35:47 2002
+++ source/gas/config/tc-mips.c	Tue Sep 17 11:33:06 2002
@@ -11263,8 +11356,7 @@ s_change_section (ignore)
 #ifdef OBJ_ELF
   char *section_name;
   char c;
-  char *next_c;
-  char *p;
+  char next_c;
   int section_type;
   int section_flag;
   int section_entry_size;
@@ -11275,14 +11367,13 @@ s_change_section (ignore)
 
   section_name = input_line_pointer;
   c = get_symbol_end ();
-  next_c = input_line_pointer + 1;
-  /* just after name is now '\0' */
-  p = input_line_pointer;
+  next_c = *(input_line_pointer + 1);
 
-  /* Do we have .section Name<,"flags">  */
-  if (c == '\n' || (c == ',' && *next_c == '"') || c == '"')
+  /* Do we have .section Name<,"flags">?  */
+  if (c != ',' || (c == ',' && next_c == '"'))
     {
-      *p = c;
+      /* just after name is now '\0'.  */
+      *input_line_pointer = c;
       input_line_pointer = section_name;
       obj_elf_section (ignore);
       return;


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