From 0ce50fc900a53f32ed09c49ddc8cf26b517b33d1 Mon Sep 17 00:00:00 2001 From: Nelson Chu Date: Sat, 29 Oct 2022 11:34:10 +0800 Subject: [PATCH] RISC-V: Always generate mapping symbols at the start of the sections. Before figuring out the suppress rule of mapping symbol with architecture (changed back to $x), always generate them at the start of the sections. gas/ * config/tc-riscv.c (need_arch_map_symbol): Removed. (riscv_mapping_state): Updated. (riscv_check_mapping_symbols): Updated. * testsuite/gas/riscv/mapping-non-arch.d: Removed. * testsuite/gas/riscv/mapping-non-arch.s: Likewise. --- gas/config/tc-riscv.c | 13 ------------- gas/testsuite/gas/riscv/mapping-non-arch.d | 17 ----------------- gas/testsuite/gas/riscv/mapping-non-arch.s | 11 ----------- 3 files changed, 41 deletions(-) delete mode 100644 gas/testsuite/gas/riscv/mapping-non-arch.d delete mode 100644 gas/testsuite/gas/riscv/mapping-non-arch.s diff --git a/gas/config/tc-riscv.c b/gas/config/tc-riscv.c index 3237369f11f..b664116af6d 100644 --- a/gas/config/tc-riscv.c +++ b/gas/config/tc-riscv.c @@ -470,11 +470,6 @@ static char *expr_end; #define OPCODE_MATCHES(OPCODE, OP) \ (((OPCODE) & MASK_##OP) == MATCH_##OP) -/* Indicate if .option directives do affect instructions. Set to true means - we need to add $x+arch at somewhere; Otherwise just add $x for instructions - should be enough. */ -static bool need_arch_map_symbol = false; - /* Create a new mapping symbol for the transition to STATE. */ static void @@ -579,7 +574,6 @@ riscv_mapping_state (enum riscv_seg_mstate to_state, S_GET_NAME (seg_arch_symbol) + 2) != 0) { reset_seg_arch_str = true; - need_arch_map_symbol = true; } else if (from_state == to_state) return; @@ -634,13 +628,6 @@ riscv_check_mapping_symbols (bfd *abfd ATTRIBUTE_UNUSED, if (seginfo == NULL || seginfo->frchainP == NULL) return; - /* If we don't set any .option arch directive, then the arch_map_symbol - in each segment must be the first instruction, and we don't need to - add $x+arch for them. */ - if (!need_arch_map_symbol - && seginfo->tc_segment_info_data.arch_map_symbol != 0) - S_SET_NAME (seginfo->tc_segment_info_data.arch_map_symbol, "$x"); - for (fragp = seginfo->frchainP->frch_root; fragp != NULL; fragp = fragp->fr_next) diff --git a/gas/testsuite/gas/riscv/mapping-non-arch.d b/gas/testsuite/gas/riscv/mapping-non-arch.d deleted file mode 100644 index f69e719ff30..00000000000 --- a/gas/testsuite/gas/riscv/mapping-non-arch.d +++ /dev/null @@ -1,17 +0,0 @@ -#as: -#source: mapping-non-arch.s -#objdump: --syms --special-syms - -.*file format.*riscv.* - -SYMBOL TABLE: -00+00 l d .text 00+00 .text -00+00 l d .data 00+00 .data -00+00 l d .bss 00+00 .bss -00+00 l .text 00+00 \$x -00+08 l .text 00+00 \$d -00+0c l .text 00+00 \$x -00+00 l d text.A 00+00 text.A -00+00 l text.A 00+00 \$x -00+02 l text.A 00+00 \$d -00+00 l d .riscv.attributes 00+00 .riscv.attributes diff --git a/gas/testsuite/gas/riscv/mapping-non-arch.s b/gas/testsuite/gas/riscv/mapping-non-arch.s deleted file mode 100644 index 03b2d75a5dd..00000000000 --- a/gas/testsuite/gas/riscv/mapping-non-arch.s +++ /dev/null @@ -1,11 +0,0 @@ -.attribute arch, "rv32i" -.option arch, +c -.text -addi a0, zero, 1 -.align 3 -.word 0x1 -addi a0, zero, 2 - -.section text.A, "ax" -addi a0, zero, 3 -.word 0x2 -- 2.30.2