summaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorMichael Matz <matz@suse.de>2005-05-10 15:10:08 +0000
committerMichael Matz <matz@suse.de>2005-05-10 15:10:08 +0000
commitee1923668e008fbe81cd81b3213f81eb097cfccf (patch)
treed3f196451c3374ac19e8ff3b0b1e578152c97558 /gas
parentb0ded00b3ffade930e4617b01d5c8241e3f404da (diff)
downloadbinutils-gdb-ee1923668e008fbe81cd81b3213f81eb097cfccf.tar.gz
gas/
* frags.c (frag_grow): Don't be too greedy in allocating memory. * config/tc-hppa.c (pa_block): Check arguments to .block[z]. gas/testsuite/ * gas/hppa/parse/block1.s: Use official limit (0x3fffffff) for .block.
Diffstat (limited to 'gas')
-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 41335983f4e..86228db6f02 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 7bac1eac3ce..57cc427ccb5 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 21fe26287d7..6dae8bc9c22 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 1a162c61c68..d2210458f0e 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 4f12ab58952..a3ddafe3c5b 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: