* dwarf2dbg.c (scale_addr_delta): New.
authorDJ Delorie <dj@redhat.com>
Tue, 26 Nov 2002 21:55:15 +0000 (21:55 +0000)
committerDJ Delorie <dj@redhat.com>
Tue, 26 Nov 2002 21:55:15 +0000 (21:55 +0000)
(size_inc_line_addr): Use it.
(emit_inc_line_addr): Use it.

gas/ChangeLog
gas/dwarf2dbg.c

index 6ca492de2866466661086e4304203ccdfe695552..cdf5c9efe017f840ad8a9f2a2ed1988b63486c7e 100644 (file)
@@ -1,3 +1,9 @@
+2002-11-26  DJ Delorie  <dj@redhat.com.
+
+       * dwarf2dbg.c (scale_addr_delta): New.
+       (size_inc_line_addr): Use it.
+       (emit_inc_line_addr): Use it.
+
 2002-11-26  Hans-Peter Nilsson  <hp@axis.com>
 
        * config/tc-cris.c (cris_relax_frag): Fix typo in comment.
index ff1624b01aaf1d6e4c3661e3f69b08c237706479..578b3ac226a0198c34d16f7ae6f258aaa9b62a09 100644 (file)
@@ -174,6 +174,7 @@ static void out_debug_line PARAMS ((segT));
 static void out_debug_aranges PARAMS ((segT, segT));
 static void out_debug_abbrev PARAMS ((segT));
 static void out_debug_info PARAMS ((segT, segT, segT));
+static void scale_addr_delta PARAMS ((int *));
 \f
 /* Find or create an entry for SEG+SUBSEG in ALL_SEGS.  */
 
@@ -596,6 +597,24 @@ out_set_addr (seg, frag, ofs)
   emit_expr (&expr, sizeof_address);
 }
 
+#if DWARF2_LINE_MIN_INSN_LENGTH > 1
+static void
+scale_addr_delta (addr_delta)
+     int *addr_delta;
+{
+  static int printed_this = 0;
+  if (*addr_delta % DWARF2_LINE_MIN_INSN_LENGTH != 0)
+    {
+      if (!printed_this)
+       as_bad("unaligned opcodes detected in executable segment");
+      printed_this = 1;
+    }
+  *addr_delta /= DWARF2_LINE_MIN_INSN_LENGTH;
+}
+#else
+#define scale_addr_delta(A)
+#endif
+
 /* Encode a pair of line and address skips as efficiently as possible.
    Note that the line skip is signed, whereas the address skip is unsigned.
 
@@ -612,10 +631,7 @@ size_inc_line_addr (line_delta, addr_delta)
   int len = 0;
 
   /* Scale the address delta by the minimum instruction length.  */
-#if DWARF2_LINE_MIN_INSN_LENGTH > 1
-  assert (addr_delta % DWARF2_LINE_MIN_INSN_LENGTH == 0);
-  addr_delta /= DWARF2_LINE_MIN_INSN_LENGTH;
-#endif
+  scale_addr_delta (&addr_delta);
 
   /* INT_MAX is a signal that this is actually a DW_LNE_end_sequence.
      We cannot use special opcodes here, since we want the end_sequence
@@ -678,11 +694,9 @@ emit_inc_line_addr (line_delta, addr_delta, p, len)
   int need_copy = 0;
   char *end = p + len;
 
-#if DWARF2_LINE_MIN_INSN_LENGTH > 1
   /* Scale the address delta by the minimum instruction length.  */
-  assert (addr_delta % DWARF2_LINE_MIN_INSN_LENGTH == 0);
-  addr_delta /= DWARF2_LINE_MIN_INSN_LENGTH;
-#endif
+  scale_addr_delta (&addr_delta);
+
   /* INT_MAX is a signal that this is actually a DW_LNE_end_sequence.
      We cannot use special opcodes here, since we want the end_sequence
      to emit the matrix entry.  */
This page took 0.046984 seconds and 4 git commands to generate.