aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2024-02-02 08:26:22 +0100
committerJan Beulich <jbeulich@suse.com>2024-02-02 08:26:22 +0100
commit1e7dd4a0348c5985df1a3e9765fc49da19663527 (patch)
treee87f409ff6c27dd0062083d54b9b3d144cb4a2ef /gas/config
parente4d85860c26f210ca1a8ea1a0da767d77dbd95ac (diff)
downloadbinutils-1e7dd4a0348c5985df1a3e9765fc49da19663527.zip
binutils-1e7dd4a0348c5985df1a3e9765fc49da19663527.tar.gz
binutils-1e7dd4a0348c5985df1a3e9765fc49da19663527.tar.bz2
x86: actually implement .noopt
For quite some time we've had support for -O command line options. With that ignoring at least .noopt isn't really a good idea. Re-purpose the optimize-3 test for testing this directive's effect as well. As to the doc addition - this uses the same text as is there for the {nooptimize} pseudo-prefix, despite me not being convinced of the "size" part being fully accurate there (and hence also here).
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-i386.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 2e578e2..e091b86 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -140,6 +140,7 @@ arch_entry;
static void update_code_flag (int, int);
static void s_insn (int);
+static void s_noopt (int);
static void set_code_flag (int);
static void set_16bit_gcc_code_flag (int);
static void set_intel_syntax (int);
@@ -1232,7 +1233,7 @@ const pseudo_typeS md_pseudo_table[] =
{"value", cons, 2},
{"slong", signed_cons, 4},
{"insn", s_insn, 0},
- {"noopt", s_ignore, 0},
+ {"noopt", s_noopt, 0},
{"optim", s_ignore, 0},
{"code16gcc", set_16bit_gcc_code_flag, CODE_16BIT},
{"code16", set_code_flag, CODE_16BIT},
@@ -4999,6 +5000,18 @@ optimize_encoding (void)
}
}
+static void
+s_noopt (int dummy ATTRIBUTE_UNUSED)
+{
+ if (!is_it_end_of_statement ())
+ as_warn (_("`.noopt' arguments ignored"));
+
+ optimize = 0;
+ optimize_for_space = 0;
+
+ ignore_rest_of_line ();
+}
+
/* Return non-zero for load instruction. */
static int