aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2004-01-23 12:52:20 +0000
committerRichard Sandiford <rdsandiford@googlemail.com>2004-01-23 12:52:20 +0000
commit0530d30a58dd8ba07c9f0b9ab30d11835d3fb7c3 (patch)
treef8c0b67aa01f5e2102d31fbcb037756c19da9d86 /gas
parentfe3a9bc403bf629169b1ada02b8783e310037921 (diff)
downloadgdb-0530d30a58dd8ba07c9f0b9ab30d11835d3fb7c3.zip
gdb-0530d30a58dd8ba07c9f0b9ab30d11835d3fb7c3.tar.gz
gdb-0530d30a58dd8ba07c9f0b9ab30d11835d3fb7c3.tar.bz2
* frags.h (frag_room): Declare.
* frags.c (frag_room): New function. * doc/internals.texi: Document it.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/doc/internals.texi7
-rw-r--r--gas/frags.c8
-rw-r--r--gas/frags.h1
4 files changed, 19 insertions, 3 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 438ea36..9133f7c 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+2004-01-23 Richard Sandiford <rsandifo@redhat.com>
+
+ * frags.h (frag_room): Declare.
+ * frags.c (frag_room): New function.
+ * doc/internals.texi: Document it.
+
2004-01-22 Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
* config/tc-mips.c (append_insn): Don't do r3900 interlock
diff --git a/gas/doc/internals.texi b/gas/doc/internals.texi
index 3d94f43..c62f829 100644
--- a/gas/doc/internals.texi
+++ b/gas/doc/internals.texi
@@ -704,9 +704,10 @@ processing. After this point, it is safe to operate on one chain per section.
The assembler always has a current frag, named @code{frag_now}. More space is
allocated for the current frag using the @code{frag_more} function; this
-returns a pointer to the amount of requested space. Relaxing is done using
-variant frags allocated by @code{frag_var} or @code{frag_variant}
-(@pxref{Relaxation}).
+returns a pointer to the amount of requested space. The function
+@code{frag_room} says by how much the current frag can be extended.
+Relaxing is done using variant frags allocated by @code{frag_var}
+or @code{frag_variant} (@pxref{Relaxation}).
@node GAS processing
@section What GAS does when it runs
diff --git a/gas/frags.c b/gas/frags.c
index 1521d4b..83625d7 100644
--- a/gas/frags.c
+++ b/gas/frags.c
@@ -262,6 +262,14 @@ frag_wane (register fragS *fragP)
fragP->fr_var = 0;
}
+/* Return the number of bytes by which the current frag can be grown. */
+
+int
+frag_room (void)
+{
+ return obstack_room (&frchain_now->frch_obstack);
+}
+
/* Make an alignment frag. The size of this frag will be adjusted to
force the next frag to have the appropriate alignment. ALIGNMENT
is the power of two to which to align. FILL_CHARACTER is the
diff --git a/gas/frags.h b/gas/frags.h
index 73b7182..52a6cfe 100644
--- a/gas/frags.h
+++ b/gas/frags.h
@@ -141,6 +141,7 @@ void frag_align_pattern (int alignment, const char *fill_pattern,
void frag_align_code (int alignment, int max);
void frag_new (int old_frags_var_max_size);
void frag_wane (fragS * fragP);
+int frag_room (void);
char *frag_variant (relax_stateT type,
int max_chars,