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]

Fix dwarf2dbg assertion failure


This fixes "Assertion failure in size_inc_line_addr at gas/dwarf2dbg.c
line 574." when running the gas testsuite on powerpc64-linux.  The reason
is that gcc/config/rs6000/rs6000.c:output_epilog fails to emit an align
after the traceback table, which has byte sized data, while
DWARF2_LINE_MIN_INSN_LENGTH is 4.  OK, it's easy to fix gcc, but gas
shouldn't crash here when the section will be padded out later according
to its alignment.

gas/ChangeLog
	* dwarf2dbg.c (get_frag_fix): Align last frag size.

-- 
Alan Modra

Index: gas/dwarf2dbg.c
===================================================================
RCS file: /cvs/src/src/gas/dwarf2dbg.c,v
retrieving revision 1.42
diff -u -p -r1.42 dwarf2dbg.c
--- dwarf2dbg.c	2001/09/18 10:08:14	1.42
+++ dwarf2dbg.c	2001/11/15 04:55:56
@@ -524,8 +524,9 @@ get_frag_fix (frag)
   for (fr = frchain_root; fr; fr = fr->frch_next)
     if (fr->frch_last == frag)
       {
-	return ((char *) obstack_next_free (&fr->frch_obstack)
-		- frag->fr_literal);
+	long align_mask = -1 << get_recorded_alignment (fr->frch_seg);
+	return (((char *) obstack_next_free (&fr->frch_obstack)
+		 - frag->fr_literal) + ~align_mask) & align_mask;
       }
 
   abort ();


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