From 9632a526cae4cb10276e39d8c4bd1f649d13f8e8 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Wed, 8 May 2019 09:26:36 +0930 Subject: [PATCH] xtensa ignores option --no-link-relax md_begin happens after md_parse_option. * config/tc-xtensa.c (opt_linkrelax): New variable. (md_parse_option): Set it here. (md_begin): Copy opt_linkrelax to linkrelax. --- gas/ChangeLog | 6 ++++++ gas/config/tc-xtensa.c | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 9ba89180744..72346053d04 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2019-05-08 Alan Modra + + * config/tc-xtensa.c (opt_linkrelax): New variable. + (md_parse_option): Set it here. + (md_begin): Copy opt_linkrelax to linkrelax. + 2019-05-07 Alexandre Oliva * testsuite/gas/elf/dwarf2-18.d: Xfail mep-*. diff --git a/gas/config/tc-xtensa.c b/gas/config/tc-xtensa.c index 9350beb4951..320e7afca50 100644 --- a/gas/config/tc-xtensa.c +++ b/gas/config/tc-xtensa.c @@ -628,6 +628,7 @@ static bfd_boolean maybe_has_short_loop = FALSE; static bfd_boolean workaround_close_loop_end = FALSE; static bfd_boolean maybe_has_close_loop_end = FALSE; static bfd_boolean enforce_three_byte_loop_align = FALSE; +static bfd_boolean opt_linkrelax = TRUE; /* When workaround_short_loops is TRUE, all loops with early exits must have at least 3 instructions. workaround_all_short_loops is a modifier @@ -827,10 +828,10 @@ md_parse_option (int c, const char *arg) as_warn (_("--no-density option is ignored")); return 1; case option_link_relax: - linkrelax = 1; + opt_linkrelax = TRUE; return 1; case option_no_link_relax: - linkrelax = 0; + opt_linkrelax = FALSE; return 1; case option_flix: produce_flix = FLIX_ALL; @@ -5258,7 +5259,7 @@ md_begin (void) xtensa_default_isa = xtensa_isa_init (0, 0); isa = xtensa_default_isa; - linkrelax = 1; + linkrelax = opt_linkrelax; /* Set up the literal sections. */ memset (&default_lit_sections, 0, sizeof (default_lit_sections));