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]

Re: Broken .loc directive in GAS


On Tue, Jul 15, 2003 at 05:19:53PM +0200, Michal Ludvig wrote:
> and compare results. You will see that temp-rh9 and temp-sl82 have 
> overlapping sequences in temp.cc entry.
> At least I hope you'll see it!

Yes, I see it.  It's a gas bug, caused by a patch of mine..  :-(
This one:  http://sources.redhat.com/ml/binutils/2001-11/msg00414.html

It's quite wrong to align sizes, of course.  The thing is that addresses
aren't available at the stage dwarf2_finish runs..  I'm reverting the
patch, and applying a warning fix.

	* dwarf2dbg.c (get_frag_fix): Revert 2001-11-15 change.
	(generic_dwarf2_emit_offset): Don't define function when
	TC__DWARF2_EMIT_OFFSET is defined.

Index: gas/dwarf2dbg.c
===================================================================
RCS file: /cvs/src/src/gas/dwarf2dbg.c,v
retrieving revision 1.63
diff -u -p -r1.63 dwarf2dbg.c
--- gas/dwarf2dbg.c	27 May 2003 16:00:04 -0000	1.63
+++ gas/dwarf2dbg.c	16 Jul 2003 03:02:12 -0000
@@ -52,10 +52,6 @@
 # define DWARF2_ADDR_SIZE(bfd) (bfd_arch_bits_per_address (bfd) / 8);
 #endif
 
-#ifndef TC_DWARF2_EMIT_OFFSET
-# define TC_DWARF2_EMIT_OFFSET  generic_dwarf2_emit_offset
-#endif
-
 #ifdef BFD_ASSEMBLER
 
 #include "subsegs.h"
@@ -160,7 +156,6 @@ static struct dwarf2_line_info current;
 /* The size of an address on the target.  */
 static unsigned int sizeof_address;
 
-static void generic_dwarf2_emit_offset PARAMS((symbolS *, unsigned int));
 static struct line_subseg *get_line_subseg PARAMS ((segT, subsegT));
 static unsigned int get_filenum PARAMS ((const char *, unsigned int));
 static struct frag *first_frag_for_seg PARAMS ((segT));
@@ -185,6 +180,10 @@ static void out_debug_aranges PARAMS ((s
 static void out_debug_abbrev PARAMS ((segT));
 static void out_debug_info PARAMS ((segT, segT, segT));
 
+#ifndef TC_DWARF2_EMIT_OFFSET
+# define TC_DWARF2_EMIT_OFFSET  generic_dwarf2_emit_offset
+static void generic_dwarf2_emit_offset PARAMS ((symbolS *, unsigned int));
+
 /* Create an offset to .dwarf2_*.  */
 
 static void
@@ -199,6 +198,7 @@ generic_dwarf2_emit_offset (symbol, size
   expr.X_add_number = 0;
   emit_expr (&expr, size);
 }
+#endif
 
 /* Find or create an entry for SEG+SUBSEG in ALL_SEGS.  */
 
@@ -632,11 +632,7 @@ get_frag_fix (frag)
      on some subsegment chain.  */
   for (fr = frchain_root; fr; fr = fr->frch_next)
     if (fr->frch_last == frag)
-      {
-	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;
-      }
+      return (char *) obstack_next_free (&fr->frch_obstack) - frag->fr_literal;
 
   abort ();
 }

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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