From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-sender-0.a4lg.com (mail-sender.a4lg.com [153.120.152.154]) by sourceware.org (Postfix) with ESMTPS id 130573858406 for ; Wed, 21 Sep 2022 10:14:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 130573858406 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=irq.a4lg.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=irq.a4lg.com Received: from [127.0.0.1] (localhost [127.0.0.1]) by mail-sender-0.a4lg.com (Postfix) with ESMTPSA id 93908300089; Wed, 21 Sep 2022 10:14:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=irq.a4lg.com; s=2017s01; t=1663755265; bh=nr6G2KKTvVJPGm3OfXYJLxkvpno1aBjRQZsGTOKxtx8=; h=Message-ID:Date:Mime-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=HqKkrQ13S8ylQ2nAyIDBaCZO4e12UoBeU5m1U07FHPJFIwcPu5Bds6zrBcWlm79dI 97J0ryv+Qb0FeZLNuX5xvDh/0DRwuEom1VIkMw7WwBIA5Fvx7TdCvxIsD50b8R4PPo JQa1PykUSlI8bqO7O4gJJRr+c/aqnMTOqvHpBKfE= Message-ID: Date: Wed, 21 Sep 2022 19:14:24 +0900 Mime-Version: 1.0 Subject: Re: [PATCH 0/1] RISC-V: Minor fix to the 'Ztso' extension support Content-Language: en-US To: shihua@iscas.ac.cn Cc: Nelson Chu , binutils@sourceware.org References: <5f6cebd7.98e3.1835f77a59d.Coremail.shihua@iscas.ac.cn> From: Tsukasa OI In-Reply-To: <5f6cebd7.98e3.1835f77a59d.Coremail.shihua@iscas.ac.cn> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,SPF_PASS,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: On 2022/09/21 18:53, shihua@iscas.ac.cn wrote: > Hi,Tsukasa OI > In patch V4 ( https://sourceware.org/pipermail/binutils/2022-September/122962.html ), I removed support tso for the .option directive. So I think it's not necessary to add this. > Thanks, > Shihua I don't agree that theory. riscv_set_options.tso might not be absolutely necessary (as Nelson pointed out) but EF_RISCV_TSO handling should remain. The option variable for RVC (riscv_set_options.rvc) is necessary because the assembler needs some decisions based on the "current" status of whether the 'C' extension is enabled. That's different from riscv_set_options.tso (that is removed). However, for ELF flags, things are a bit different. If RVC ('C' extension) is used *somewhere* in the object file, the whole object file must depend on RVC in some way. Likewise, if TSO ('Ztso' extension) is used *somewhere* in the object file, the whole object file must depend on TSO in some way. In either cases, we should check whether related extension is enabled somewhere in the object file and set corresponding ELF flags. There are two cases: 1. When we parse "initial" architecture ('C' and 'Ztso') 2. When the architecture is changed via ".option arch" ('C' only!?) So, my conclusion is, riscv_set_options.tso handling can be removed but EF_RISCV_TSO handling in ".option arch" cannot (as long as we support TSO). Regards, Tsukasa > > > > -----原始邮件----- > > 发件人: "Tsukasa OI" > > 发送时间: 2022-09-21 14:40:42 (星期三) > > 收件人: "Tsukasa OI" , "Nelson Chu" , "Shihua LIAO" > > 抄送: binutils@sourceware.org > > 主题: [PATCH 0/1] RISC-V: Minor fix to the 'Ztso' extension support > > > > Hi all, > > > > I think Shihua could have missed my review 2: > > > > (see near the end of my e-mail starting with "Other than that,"). > > > > Currently, it sets EF_RISCV_TSO ELF flag when initial ISA string contains > > the 'Ztso' extension. However, GAS has a way to update the ISA string: > > ".option arch". > > > > When the architecture is updated by ".option arch", EF_RISCV_RVC ELF flag > > is set when the 'C' extension is detected. Analogously, this patchset sets > > the EF_RISCV_TSO when the 'Ztso' extension is detected. > > > > With this patch, the 'Ztso' extension support will be complete. > > > > Thanks, > > > > > > > > > > Tsukasa OI (1): > > RISC-V: Set EF_RISCV_TSO also on .option arch > > > > gas/config/tc-riscv.c | 3 +++ > > 1 file changed, 3 insertions(+) > > > > > > base-commit: e472ec9fad6d7b0da914da606430e249d1bd99e4 > > -- > > 2.34.1 >