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.
This commit is contained in:
Jozef Lawrynowicz
2020-11-12 19:10:18 +00:00
parent 10c19fadfd
commit 1de037a0c5
5 changed files with 30 additions and 0 deletions

View File

@ -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

View File

@ -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}
};

View File

@ -0,0 +1,4 @@
.text
.global foo
foo:
.word 0

View File

@ -0,0 +1,8 @@
#name: Silently Ignore -md Option
#source: empty.s
#as: -md --fatal-warnings
#DUMPPROG: nm
#...
.*foo.*
#pass

View File

@ -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"
}