aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2025-03-07 11:27:58 +0100
committerJan Beulich <jbeulich@suse.com>2025-03-07 11:27:58 +0100
commit757c681fc2e4a53b1a27c8770b8eb3d5881f731d (patch)
tree837ae0fd437725a01d0d87b5ee665638aac24a58 /gas
parent898f38f5867aa7e4eea3c349224744e9732763a3 (diff)
downloadbinutils-757c681fc2e4a53b1a27c8770b8eb3d5881f731d.zip
binutils-757c681fc2e4a53b1a27c8770b8eb3d5881f731d.tar.gz
binutils-757c681fc2e4a53b1a27c8770b8eb3d5881f731d.tar.bz2
gas: don't permit "repeat" expressions with .cfi_{escape,fde_data}
Repeat counts greater than 1 will emit data directly into the current (sub-)section. That's wrong with .cfi_*, which defer data emission until much later: N-1 instances of the specified data would not end up in .eh_frame (or whatever the section that CFI data was specified to go into). Simply disallow "repeat" expressions in such cases.
Diffstat (limited to 'gas')
-rw-r--r--gas/read.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/gas/read.c b/gas/read.c
index 171182d..12b6d30 100644
--- a/gas/read.c
+++ b/gas/read.c
@@ -4179,6 +4179,20 @@ static void
parse_mri_cons (expressionS *exp, unsigned int nbytes);
#endif
+/* This function is used by .cfi_* directive handling, and hence must not
+ invoke parse_repeat_cons(). */
+
+void
+do_parse_cons_expression (expressionS *exp,
+ int nbytes ATTRIBUTE_UNUSED)
+{
+#ifdef TC_PARSE_CONS_EXPRESSION
+ (void) TC_PARSE_CONS_EXPRESSION (exp, nbytes);
+#else
+ expression (exp);
+#endif
+}
+
#ifndef TC_PARSE_CONS_EXPRESSION
#ifdef REPEAT_CONS_EXPRESSIONS
#define TC_PARSE_CONS_EXPRESSION(EXP, NBYTES) \
@@ -4194,14 +4208,6 @@ parse_repeat_cons (expressionS *exp, unsigned int nbytes);
#endif
#endif
-void
-do_parse_cons_expression (expressionS *exp,
- int nbytes ATTRIBUTE_UNUSED)
-{
- (void) TC_PARSE_CONS_EXPRESSION (exp, nbytes);
-}
-
-
/* Worker to do .byte etc statements.
Clobbers input_line_pointer and checks end-of-line. */