This is the mail archive of the 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]

gas segfault in files with groups and some error

This avoids an assertion closely followed by a segfault when an input
file containing section groups has some other error as in

/tmp/ccMQV8TI.s:105: Error: invalid operands (.text.unlikely and .text.startup sections) for `-'
/home/amodra/gnu/powerpc-linux/bin/as: BFD (GNU Binutils)
assertion fail /home/amodra/src/binutils-current/bfd/elf.c:2826
g++: internal compiler error: Segmentation fault (program as)

	* write.c (write_object_file): Call set_symtab even if we had

Index: gas/write.c
RCS file: /cvs/src/src/gas/write.c,v
retrieving revision 1.142
diff -u -p -r1.142 write.c
--- gas/write.c	1 Aug 2011 09:05:40 -0000	1.142
+++ gas/write.c	4 Aug 2011 10:16:11 -0000
@@ -2073,13 +2073,14 @@ write_object_file (void)
   obj_adjust_symtab ();
+  set_symtab ();
   /* Stop if there is an error.  */
   if (had_errors ())
   /* Now that all the sizes are known, and contents correct, we can
      start writing to the file.  */
-  set_symtab ();
   /* If *_frob_file changes the symbol value at this point, it is
      responsible for moving the changed value into symp->bsym->value

Alan Modra
Australia Development Lab, IBM

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