From patchwork Sat Oct 29 03:44:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nelson Chu X-Patchwork-Id: 12627 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1166635wru; Fri, 28 Oct 2022 20:44:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5YdGZ1eYIGIZGWLvJq1KcSOeHkd/SpPNbf+OVonHnxkSms7lRPwn+94OtLtOCuXPIGYC28 X-Received: by 2002:a17:907:728c:b0:78e:2856:7fed with SMTP id dt12-20020a170907728c00b0078e28567fedmr2280780ejc.2.1667015085187; Fri, 28 Oct 2022 20:44:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667015085; cv=none; d=google.com; s=arc-20160816; b=HNTlAiUh+aJtGLPTMG2GIdurqN9cAm6icCkn1q4EZtgSjR9qS/QKDc85gv4YV/OH1Z MU/wJDySXn7JydEKnAKknIFX4/W74EVV7F2/nCn0nYo/27RiavcfRLK25/47LFX+t9At Inny4ohMpo0SfJbr7G0KinE8tGdw4gENV50pozogqtyJqXpiNNXekxFSz+sVXb4nMGbh PPWvPyNBo0RY08x2ogsCkaAvJMAv1dP3A31KlA3afpnNOSxDT+3gBc/B4s6urQ3cv77I 30zJ3h8CVoQxYs5chMI6T7YEGoRU8/cf1i4C56dwGDKcdR2fJCcbBe5Ulq5E11VOrvyz DDeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dmarc-filter :delivered-to; bh=hJGv98k9+g04Euh0zrXcC8OFIVfrlg/rAq81wwOBSpg=; b=iI4W4G95HyI1mIyY+LdXh4xWxq00EmRFd4xvi14c6qGE8jLZUtlP2UXPFOg/r2QFJr GSzMGoaEhP1Vqf9Z9q1RJxXHPkl2rIfyp5N7aUzk5lPs3ehcHzxMz4Os93HczOoZX7Jr ut7DzjTKpdA6kxq5D9w9I8DrJEy3BT78nTGUfjNf8Fds9ld0lAWY7dN58scdKHiW5Wm5 ZhiZw9lb+MQNlumCvQYHh9r7P0XZ5vDnSghU9LggnmfrYZsrkBwrs6J/wYQNhwSSuiSm owPub/CjyYPyzb6FshvScFoV9YqVeQFZsek8nsBN2uEq8n1317K/D4jEQ77GAWEbSZ2U lfrw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id f7-20020a1709063f4700b0077fd6028710si576374ejj.670.2022.10.28.20.44.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Oct 2022 20:44:45 -0700 (PDT) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 37026385800C for ; Sat, 29 Oct 2022 03:44:44 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org 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 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 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 X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747992010209111795?= X-GMAIL-MSGID: =?utf-8?q?1747992010209111795?= 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