aboutsummaryrefslogtreecommitdiff
path: root/gas/read.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2012-05-29 16:32:11 +0000
committerRoland McGrath <roland@gnu.org>2012-05-29 16:32:11 +0000
commitd416e51da0f5e79c66f1d609068e83fff4add35a (patch)
tree99554506bbc79f81aa1a8eeed32237f98579886e /gas/read.c
parentacf89cab13c1826d83dce1c7ae8ea805bc034bda (diff)
downloadgdb-d416e51da0f5e79c66f1d609068e83fff4add35a.zip
gdb-d416e51da0f5e79c66f1d609068e83fff4add35a.tar.gz
gdb-d416e51da0f5e79c66f1d609068e83fff4add35a.tar.bz2
gas/
* read.c [HANDLE_BUNDLE] (bundle_lock_depth): New variable. (read_a_source_file) [HANDLE_BUNDLE]: Reset it. [HANDLE_BUNDLE] (s_bundle_lock, s_bundle_unlock): Allow nested pairs. gas/testsuite/ * gas/i386/bundle-bad.s: Remove nested .bundle_lock case. * gas/i386/bundle-bad.l: Remove expected error line. * gas/i386/bundle-lock.s: Add nested .bundle_lock case. * gas/i386/bundle-lock.d: Update expectations.
Diffstat (limited to 'gas/read.c')
-rw-r--r--gas/read.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/gas/read.c b/gas/read.c
index cf7f752..2b7f4ff 100644
--- a/gas/read.c
+++ b/gas/read.c
@@ -233,6 +233,10 @@ static unsigned int bundle_align_p2;
we are expecting to see .bundle_unlock. */
static fragS *bundle_lock_frag;
static frchainS *bundle_lock_frchain;
+
+/* This is incremented by .bundle_lock and decremented by .bundle_unlock,
+ to allow nesting. */
+static unsigned int bundle_lock_depth;
#endif
static void do_s_func (int end_p, const char *default_prefix);
@@ -1288,6 +1292,7 @@ read_a_source_file (char *name)
_(".bundle_lock with no matching .bundle_unlock"));
bundle_lock_frag = NULL;
bundle_lock_frchain = NULL;
+ bundle_lock_depth = 0;
}
#endif
@@ -6096,14 +6101,12 @@ s_bundle_lock (int arg ATTRIBUTE_UNUSED)
return;
}
- if (bundle_lock_frag != NULL)
+ if (bundle_lock_depth == 0)
{
- as_bad (_("second .bundle_lock without .bundle_unlock"));
- return;
+ bundle_lock_frchain = frchain_now;
+ bundle_lock_frag = start_bundle ();
}
-
- bundle_lock_frchain = frchain_now;
- bundle_lock_frag = start_bundle ();
+ ++bundle_lock_depth;
}
void
@@ -6121,6 +6124,10 @@ s_bundle_unlock (int arg ATTRIBUTE_UNUSED)
gas_assert (bundle_align_p2 > 0);
+ gas_assert (bundle_lock_depth > 0);
+ if (--bundle_lock_depth > 0)
+ return;
+
size = pending_bundle_size (bundle_lock_frag);
if (size > (1U << bundle_align_p2))