* defs.h (streq): Add prototype.
[deliverable/binutils-gdb.git] / gas / frags.c
index f5a9d9e5e59889c5a83e219a7afcfda882010c3c..8d7ed2f58ab455b9aa8a19f7666fd4dcf0fe2c48 100644 (file)
@@ -1,5 +1,6 @@
 /* frags.c - manage frags -
-   Copyright (C) 1987, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
+   Copyright 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+   1999, 2000
    Free Software Foundation, Inc.
 
    This file is part of GAS, the GNU Assembler.
@@ -83,7 +84,7 @@ frag_grow (nchars)
       frchain_now->frch_obstack.chunk_size = oldc;
     }
   if (obstack_room (&frchain_now->frch_obstack) < nchars)
-    as_fatal (_("Can't extend frag %d. chars"), nchars);
+    as_fatal (_("can't extend frag %u chars"), nchars);
 }
 \f
 /* Call this to close off a completed frag, and start up a new (empty)
@@ -322,6 +323,39 @@ frag_align_pattern (alignment, fill_pattern, n_fill, max)
   memcpy (p, fill_pattern, n_fill);
 }
 
+/* The NOP_OPCODE is for the alignment fill value.  Fill it with a nop
+   instruction so that the disassembler does not choke on it.  */
+#ifndef NOP_OPCODE
+#define NOP_OPCODE 0x00
+#endif
+
+/* Use this to restrict the amount of memory allocated for representing
+   the alignment code.  Needs to be large enough to hold any fixed sized
+   prologue plus the replicating portion.  */
+#ifndef MAX_MEM_FOR_RS_ALIGN_CODE
+  /* Assume that if HANDLE_ALIGN is not defined then no special action
+     is required to code fill, which means that we get just repeat the
+     one NOP_OPCODE byte.  */
+# ifndef HANDLE_ALIGN
+#  define MAX_MEM_FOR_RS_ALIGN_CODE  1
+# else
+#  define MAX_MEM_FOR_RS_ALIGN_CODE  ((1 << alignment) - 1)
+# endif
+#endif
+
+void
+frag_align_code (alignment, max)
+     int alignment;
+     int max;
+{
+  char *p;
+
+  p = frag_var (rs_align_code, MAX_MEM_FOR_RS_ALIGN_CODE, 1,
+               (relax_substateT) max, (symbolS *) 0,
+               (offsetT) alignment, (char *) 0);
+  *p = NOP_OPCODE;
+}
+
 addressT
 frag_now_fix_octets ()
 {
This page took 0.038656 seconds and 4 git commands to generate.