aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gas/ChangeLog10
-rw-r--r--gas/config/tc-hppa.c6
-rw-r--r--gas/frags.c9
-rw-r--r--gas/testsuite/ChangeLog5
-rw-r--r--gas/testsuite/gas/hppa/parse/block1.s2
5 files changed, 28 insertions, 4 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 4133598..86228db 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+2005-05-10 Michael Matz <matz@suse.de>
+
+ * frags.c (frag_grow): Don't be too greedy in allocating memory.
+
+ * config/tc-hppa.c (pa_block): Check arguments to .block[z].
+
2005-05-10 Hans-Peter Nilsson <hp@bitrange.com>
PR binutils/886
@@ -23,8 +29,8 @@
2005-05-09 Jan Beulich <jbeulich@novell.com>
- * config/tc-i386.c (optimize_disp): Discard displacement entirely when zero and
- not required by encoding constraints.
+ * config/tc-i386.c (optimize_disp): Discard displacement entirely
+ when zero and not required by encoding constraints.
2005-05-09 H.J. Lu <hongjiu.lu@intel.com>
diff --git a/gas/config/tc-hppa.c b/gas/config/tc-hppa.c
index 7bac1ea..57cc427 100644
--- a/gas/config/tc-hppa.c
+++ b/gas/config/tc-hppa.c
@@ -5951,6 +5951,12 @@ pa_block (z)
temp_size = get_absolute_expression ();
+ if (temp_size > 0x3FFFFFFF)
+ {
+ as_bad (_("Argument to .BLOCK/.BLOCKZ must be between 0 and 0x3fffffff"));
+ temp_size = 0;
+ }
+
/* Always fill with zeros, that's what the HP assembler does. */
temp_fill = 0;
diff --git a/gas/frags.c b/gas/frags.c
index 21fe262..6dae8bc 100644
--- a/gas/frags.c
+++ b/gas/frags.c
@@ -91,7 +91,14 @@ frag_grow (unsigned int nchars)
frag_wane (frag_now);
frag_new (0);
oldc = frchain_now->frch_obstack.chunk_size;
- frchain_now->frch_obstack.chunk_size = 2 * nchars + SIZEOF_STRUCT_FRAG;
+ /* Try to allocate a bit more than needed right now. But don't do
+ this if we would waste too much memory. Especially necessary
+ for extremely big (like 2GB initialized) frags. */
+ if (nchars < 0x10000)
+ frchain_now->frch_obstack.chunk_size = 2 * nchars;
+ else
+ frchain_now->frch_obstack.chunk_size = nchars + 0x10000;
+ frchain_now->frch_obstack.chunk_size += SIZEOF_STRUCT_FRAG;
if (frchain_now->frch_obstack.chunk_size > 0)
while ((n = obstack_room (&frchain_now->frch_obstack)) < nchars
&& (unsigned long) frchain_now->frch_obstack.chunk_size > nchars)
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 1a162c6..d221045 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2005-05-10 Michael Matz <matz@suse.de>
+
+ * gas/hppa/parse/block1.s: Use official limit (0x3fffffff) for
+ .block.
+
2005-05-10 Hans-Peter Nilsson <hp@bitrange.com>
* gas/mmix/relax2.s: Drop ":" off label definitions.
diff --git a/gas/testsuite/gas/hppa/parse/block1.s b/gas/testsuite/gas/hppa/parse/block1.s
index 4f12ab5..a3ddafe 100644
--- a/gas/testsuite/gas/hppa/parse/block1.s
+++ b/gas/testsuite/gas/hppa/parse/block1.s
@@ -4,7 +4,7 @@
foo:
.block
bar:
- .block 0x7fffffff
+ .block 0x3fffffff
com: