From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NelsondeMBP.localdomain (114-25-54-207.dynamic-ip.hinet.net [114.25.54.207]) by sourceware.org (Postfix) with ESMTP id 5DDFB385840B for ; Sat, 29 Oct 2022 03:44:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5DDFB385840B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=NelsondeMBP.localdomain Received: by NelsondeMBP.localdomain (Postfix, from userid 501) id AC73B39B514; Sat, 29 Oct 2022 11:44:33 +0800 (CST) From: Nelson Chu To: binutils@sourceware.org, kito.cheng@sifive.com, research_trasio@irq.a4lg.com Cc: Nelson Chu Subject: [committed] RISC-V: Always generate mapping symbols at the start of the sections. Date: Sat, 29 Oct 2022 11:44:32 +0800 Message-Id: <20221029034432.49859-1-nelson@rivosinc.com> X-Mailer: git-send-email 2.37.0 (Apple Git-136) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,GIT_PATCH_0,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,KAM_LAZY_DOMAIN_SECURITY,KHOP_HELO_FCRDNS,NO_DNS_FOR_FROM,PDS_RDNS_DYNAMIC_FP,RCVD_IN_BARRACUDACENTRAL,RCVD_IN_PBL,RCVD_IN_SORBS_DUL,RDNS_DYNAMIC,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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.37.0 (Apple Git-136)