This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
gas segfault in files with groups and some error
- From: Alan Modra <amodra at gmail dot com>
- To: binutils at sourceware dot org
- Date: Thu, 4 Aug 2011 19:54:07 +0930
- Subject: 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
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49972
/tmp/ccMQV8TI.s:105: Error: invalid operands (.text.unlikely and .text.startup sections) for `-'
/home/amodra/gnu/powerpc-linux/bin/as: BFD (GNU Binutils) 2.21.52.20110621
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
errors.
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 ();
#endif
+ set_symtab ();
+
/* Stop if there is an error. */
if (had_errors ())
return;
/* 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