[committed] MSP430: gas: Ignore -md option required for GCC backward compatibility
Jozef Lawrynowicz
jozef.l@mittosystems.com
Thu Nov 12 19:37:19 GMT 2020
The redundant -md option was removed in e4ae357fe8, but it is required
for backwards compatibility with GCC 10, which passes it to the
assembler implicitly in certain situations.
It is now silently ignored.
Committed as obvious.
-------------- next part --------------
>From 1de037a0c526a3e034ca11020cf4dd89785487c3 Mon Sep 17 00:00:00 2001
From: Jozef Lawrynowicz <jozef.l@mittosystems.com>
Date: Thu, 12 Nov 2020 19:10:18 +0000
Subject: [PATCH] MSP430: gas: Ignore -md option required for GCC backward
compatibility
The redundant -md option was removed in e4ae357fe8, but it is required
for backwards compatibility with GCC 10, which passes it to the
assembler implicitly in certain situations.
It is now silently ignored.
gas/ChangeLog:
* config/tc-msp430.c (OPTION_MOVE_DATA): Define.
(md_parse_option): Ignore OPTION_MOVE_DATA.
(md_longopts): Handle -md option.
* testsuite/gas/msp430/msp430.exp: Run new test.
* testsuite/gas/msp430/empty.s: New test.
* testsuite/gas/msp430/ignore-md.d: New test.
---
gas/ChangeLog | 9 +++++++++
gas/config/tc-msp430.c | 8 ++++++++
gas/testsuite/gas/msp430/empty.s | 4 ++++
gas/testsuite/gas/msp430/ignore-md.d | 8 ++++++++
gas/testsuite/gas/msp430/msp430.exp | 1 +
5 files changed, 30 insertions(+)
create mode 100644 gas/testsuite/gas/msp430/empty.s
create mode 100644 gas/testsuite/gas/msp430/ignore-md.d
diff --git a/gas/ChangeLog b/gas/ChangeLog
index f412f9d27e..8976025a46 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,12 @@
+2020-11-12 Jozef Lawrynowicz <jozef.l@mittosystems.com>
+
+ * config/tc-msp430.c (OPTION_MOVE_DATA): Define.
+ (md_parse_option): Ignore OPTION_MOVE_DATA.
+ (md_longopts): Handle -md option.
+ * testsuite/gas/msp430/msp430.exp: Run new test.
+ * testsuite/gas/msp430/empty.s: New test.
+ * testsuite/gas/msp430/ignore-md.d: New test.
+
2020-11-12 Nick Clifton <nickc@redhat.com>
PR 26850
diff --git a/gas/config/tc-msp430.c b/gas/config/tc-msp430.c
index 6d1803202c..322ad7c7a4 100644
--- a/gas/config/tc-msp430.c
+++ b/gas/config/tc-msp430.c
@@ -690,6 +690,9 @@ static bfd_boolean upper_data_region_in_use = FALSE;
/* The default is to use the lower region only. */
static bfd_boolean lower_data_region_only = TRUE;
+/* Deprecated option, silently ignore it for compatibility with GCC <= 10. */
+#define OPTION_MOVE_DATA 'd'
+
enum
{
OPTION_SILICON_ERRATA = OPTION_MD_BASE,
@@ -1465,6 +1468,10 @@ md_parse_option (int c, const char * arg)
do_unknown_interrupt_nops = FALSE;
return 1;
+ case OPTION_MOVE_DATA:
+ /* Silently ignored. */
+ return 1;
+
case OPTION_DATA_REGION:
if (strcmp (arg, "upper") == 0
|| strcmp (arg, "either") == 0)
@@ -1750,6 +1757,7 @@ struct option md_longopts[] =
{"my", no_argument, NULL, OPTION_WARN_INTR_NOPS},
{"mu", no_argument, NULL, OPTION_UNKNOWN_INTR_NOPS},
{"mU", no_argument, NULL, OPTION_NO_UNKNOWN_INTR_NOPS},
+ {"md", no_argument, NULL, OPTION_MOVE_DATA},
{"mdata-region", required_argument, NULL, OPTION_DATA_REGION},
{NULL, no_argument, NULL, 0}
};
diff --git a/gas/testsuite/gas/msp430/empty.s b/gas/testsuite/gas/msp430/empty.s
new file mode 100644
index 0000000000..910559d64d
--- /dev/null
+++ b/gas/testsuite/gas/msp430/empty.s
@@ -0,0 +1,4 @@
+.text
+.global foo
+foo:
+.word 0
diff --git a/gas/testsuite/gas/msp430/ignore-md.d b/gas/testsuite/gas/msp430/ignore-md.d
new file mode 100644
index 0000000000..2e55f22e8e
--- /dev/null
+++ b/gas/testsuite/gas/msp430/ignore-md.d
@@ -0,0 +1,8 @@
+#name: Silently Ignore -md Option
+#source: empty.s
+#as: -md --fatal-warnings
+#DUMPPROG: nm
+
+#...
+.*foo.*
+#pass
diff --git a/gas/testsuite/gas/msp430/msp430.exp b/gas/testsuite/gas/msp430/msp430.exp
index 624867f33b..ae9499cd61 100644
--- a/gas/testsuite/gas/msp430/msp430.exp
+++ b/gas/testsuite/gas/msp430/msp430.exp
@@ -53,4 +53,5 @@ if [expr [istarget "msp430-*-*"]] then {
run_dump_test "attr-430x-large-any-bad"
run_dump_test "attr-430x-large-any-good"
run_dump_test "reloc-lo-430x"
+ run_dump_test "ignore-md"
}
--
2.29.2
More information about the Binutils
mailing list