From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id d6LgFisC6GCPEgAAWB0awg (envelope-from ) for ; Fri, 09 Jul 2021 04:00:43 -0400 Received: by simark.ca (Postfix, from userid 112) id 4C4171F1F2; Fri, 9 Jul 2021 04:00:43 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=DKIM_SIGNED, MAILING_LIST_MULTI,RDNS_DYNAMIC,T_DKIM_INVALID,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id F18FC1E01F for ; Fri, 9 Jul 2021 04:00:40 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 66E56385EC59 for ; Fri, 9 Jul 2021 08:00:40 +0000 (GMT) Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by sourceware.org (Postfix) with ESMTPS id 084AF3858D39 for ; Fri, 9 Jul 2021 08:00:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 084AF3858D39 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=sifive.com Received: by mail-lj1-x22a.google.com with SMTP id s18so6692827ljg.7 for ; Fri, 09 Jul 2021 01:00:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lWXp9FdKwh3ccB2uXN0TV2OtKBgzsSW9qTwB+CxiTGw=; b=kRTN4fmyVRGmCbjBpuz4CvyyavixRfmoLGmf5AA0VrFqBdMw8mz69rrbXka+iU6pzN ULareYVoCE88a+votSGjeV+xBAn5QTzArTLzHRwIZTSi1XMM9hSQBOFPRFJn15cJAN3Q waaWcKYX7FBKfJkG+C/KS8qtaZRm847VZEbkMFTMso/W1kQXJc5WGtfZMnByYkRaCJhN hHe7JGwzvVS0+LWJATOiWSvhdxctLry89VI4Ptd03cunus6MdpXpkdL/41+qL65Ml7M3 BAbhZGhQ9LFgUpGHCI+9y3WhVMGGQ0xOEgKoEfNVvUxvDMyBrH21QYPRQGQwtgr1N0RI EOTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lWXp9FdKwh3ccB2uXN0TV2OtKBgzsSW9qTwB+CxiTGw=; b=gvvuiRqnwWe/k1zXlQPLS+aOJmGk6iRPX1LW0ppLyjINtuAUebQmKXwn4dDFwKiS11 4fuf0qQju16ttpowQng9q5W1CJUQnBkd/BeUJP6iOR452RA4ssZLpoKI9z2RwoOTdgpU SQBfPW8Z3c/bxuM7k+l9ue/Z9f14CryGR6fQT+vgqDIazCUJwE7O6S8nikvehBhzEP/J Q58il7nBaB8cGBLtxRgH9qcSARqkbnXMxiSNBh8LF1766MjdhOO39auZVGNbJiAyzltK r1JDLz273A0B8p22Rkam2ruyOWGkDNM0pWsTnFvyBqqbqFNevUNB/E4eXl8Xstz2usnV eAQg== X-Gm-Message-State: AOAM530CcfEXexd4+fZinUWDOig0qCRj4205S7fxdDUFTZZAeMQzee+Y 1dX1nkELEBD7Z2sSNZmz2LkKZiFUb0Byvrc7OVKZzA== X-Google-Smtp-Source: ABdhPJx5r5XgAri6jd63q4D4IHbuwQpmnwdbB65rn4H4ZSiycPD4dKPcGZjNT1SqhhPxTAJY9uerrcgPYVCXD/MC8W0= X-Received: by 2002:a2e:97d1:: with SMTP id m17mr15007448ljj.168.1625817623752; Fri, 09 Jul 2021 01:00:23 -0700 (PDT) MIME-Version: 1.0 References: <20210709072825.13709-1-nelson.chu@sifive.com> <20210709072825.13709-2-nelson.chu@sifive.com> In-Reply-To: <20210709072825.13709-2-nelson.chu@sifive.com> From: Kito Cheng Date: Fri, 9 Jul 2021 16:00:13 +0800 Message-ID: Subject: Re: [PATCH v2 1/3] RISC-V: Enable elf attributes when default configure option isn't set. To: Nelson Chu Content-Type: text/plain; charset="UTF-8" X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew Waterman , Binutils , gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" I would suggest this patch could be a standalone patch from the mapping symbol patch set. On Fri, Jul 9, 2021 at 3:28 PM Nelson Chu wrote: > > Since gcc commit, 3c70b3ca1ef58f302bf8c16d9e7c7bb8626408bf, we now enable > elf attributes for all riscv targets by default in gcc. Therefore, I > think binutils should have the same behavior, in case users are writing > assembly files. > > ChangLog: > > binutils/ > > * testsuite/binutils-all/readelf.s: Add comments for riscv. > * testsuite/binutils-all/readelf.s-64: Likewise. > * testsuite/binutils-all/readelf.s-64-unused: Likewise. > * testsuite/binutils-all/readelf.ss: Likewise. > * testsuite/binutils-all/readelf.ss-64: Likewise. > * testsuite/binutils-all/readelf.ss-64-unused: Likewise. > > gas/ > > * configure.ac: If --enable-default-riscv-attribute isn't set, > then we enable the elf attributes for all riscv targets by > default. > * configure: Regenerated. > --- > binutils/testsuite/binutils-all/readelf.s | 3 ++- > binutils/testsuite/binutils-all/readelf.s-64 | 2 ++ > binutils/testsuite/binutils-all/readelf.s-64-unused | 2 ++ > binutils/testsuite/binutils-all/readelf.ss | 1 + > binutils/testsuite/binutils-all/readelf.ss-64 | 1 + > binutils/testsuite/binutils-all/readelf.ss-64-unused | 1 + > gas/configure | 9 +-------- > gas/configure.ac | 9 +-------- > 8 files changed, 11 insertions(+), 17 deletions(-) > > diff --git a/binutils/testsuite/binutils-all/readelf.s b/binutils/testsuite/binutils-all/readelf.s > index 6ae4dc756b9..ff37acb4da8 100644 > --- a/binutils/testsuite/binutils-all/readelf.s > +++ b/binutils/testsuite/binutils-all/readelf.s > @@ -11,9 +11,10 @@ Section Headers: > #... > +\[ .\] .* +PROGBITS +00000000 0000(3c|40|44|48|50) 0000(04|10) 00 +WA +0 +0 +(.|..) > +\[ .\] .* +NOBITS +00000000 0000(40|44|48|4c|60) 000000 00 +WA +0 +0 +(.|..) > -# ARM targets put .ARM.attributes here > +# ARM targets put .ARM.attributes here. > # MIPS targets put .reginfo, .mdebug, .MIPS.abiflags and .gnu.attributes here. > # v850 targets put .call_table_data and .call_table_text here. > +# riscv targets put .riscv.attributes here. > #... > +\[..\] .symtab +SYMTAB +00000000 0+.* 0+.* 10 +.. +.+ +4 > +\[..\] .strtab +STRTAB +00000000 0+.* 0+.* 00 .* +0 +0 +1 > diff --git a/binutils/testsuite/binutils-all/readelf.s-64 b/binutils/testsuite/binutils-all/readelf.s-64 > index 92ec05f0376..4c957f7a938 100644 > --- a/binutils/testsuite/binutils-all/readelf.s-64 > +++ b/binutils/testsuite/binutils-all/readelf.s-64 > @@ -14,10 +14,12 @@ Section Headers: > +\[ 4\] .bss +NOBITS +0000000000000000 +000000(4c|50|54|58|68) > +0000000000000000 +0000000000000000 +WA +0 +0 +.* > # x86 targets may put .note.gnu.property here. > +# riscv targets put .riscv.attributes here. > #... > +\[ .\] .symtab +SYMTAB +0000000000000000 +0+.* > # aarch64-elf targets have one more data symbol. > # x86 targets may have .note.gnu.property. > +# riscv targets have .riscv.attributes. > +0+.* +0000000000000018 +(6|7) +(3|4) +8 > +\[ .\] .strtab +STRTAB +0000000000000000 +0+.* > +0+.* +0000000000000000 .* +0 +0 +1 > diff --git a/binutils/testsuite/binutils-all/readelf.s-64-unused b/binutils/testsuite/binutils-all/readelf.s-64-unused > index a1e6cd1bbd8..771439411a0 100644 > --- a/binutils/testsuite/binutils-all/readelf.s-64-unused > +++ b/binutils/testsuite/binutils-all/readelf.s-64-unused > @@ -14,10 +14,12 @@ Section Headers: > +\[ 4\] .bss +NOBITS +0000000000000000 +000000(4c|50|54|58) > +0000000000000000 +0000000000000000 +WA +0 +0 +.* > # x86 targets may put .note.gnu.property here. > +# riscv targets put .riscv.attributes here. > #... > +\[ .\] .symtab +SYMTAB +0000000000000000 +0+.* > # aarch64-elf targets have one more data symbol. > # x86 targets may have .note.gnu.property. > +# riscv targets have .riscv.attributes. > +0+.* +0000000000000018 +(6|7) +(6|7) +8 > +\[ .\] .strtab +STRTAB +0000000000000000 +0+.* > +0+.* +0000000000000000 .* +0 +0 +1 > diff --git a/binutils/testsuite/binutils-all/readelf.ss b/binutils/testsuite/binutils-all/readelf.ss > index 5fbb5d002e3..b81c016e9e7 100644 > --- a/binutils/testsuite/binutils-all/readelf.ss > +++ b/binutils/testsuite/binutils-all/readelf.ss > @@ -9,6 +9,7 @@ Symbol table '.symtab' contains .* entries: > +.: 00000000 +0 +NOTYPE +LOCAL +DEFAULT +[34] static_data_symbol > # v850 targets include extra SECTION symbols here for the .call_table_data > # and .call_table_text sections. > +# riscv targets add .riscv.attribute symbol here... > #... > +[0-9]+: 00000000 +0 +NOTYPE +GLOBAL +DEFAULT +1 text_symbol > +[0-9]+: 00000000 +0 +NOTYPE +GLOBAL +DEFAULT +UND external_symbol > diff --git a/binutils/testsuite/binutils-all/readelf.ss-64 b/binutils/testsuite/binutils-all/readelf.ss-64 > index 99a732f71f5..c6ffb0fc523 100644 > --- a/binutils/testsuite/binutils-all/readelf.ss-64 > +++ b/binutils/testsuite/binutils-all/readelf.ss-64 > @@ -7,6 +7,7 @@ Symbol table '.symtab' contains .* entries: > #... > +.: 0000000000000000 +0 +NOTYPE +LOCAL +DEFAULT +3 static_data_symbol > # ... or here ... > +# riscv targets add .riscv.attribute symbol here... > #... > .* +.: 0000000000000000 +0 +NOTYPE +GLOBAL +DEFAULT +1 text_symbol > +.: 0000000000000000 +0 +NOTYPE +GLOBAL +DEFAULT +UND external_symbol > diff --git a/binutils/testsuite/binutils-all/readelf.ss-64-unused b/binutils/testsuite/binutils-all/readelf.ss-64-unused > index f48a4b2bbd2..cf515aa60d0 100644 > --- a/binutils/testsuite/binutils-all/readelf.ss-64-unused > +++ b/binutils/testsuite/binutils-all/readelf.ss-64-unused > @@ -10,6 +10,7 @@ Symbol table '.symtab' contains .* entries: > #... > +.: 0000000000000000 +0 +NOTYPE +LOCAL +DEFAULT +3 static_data_symbol > # ... or here ... > +# riscv targets add .riscv.attribute symbol here... > #... > .* +.: 0000000000000000 +0 +NOTYPE +GLOBAL +DEFAULT +1 text_symbol > +.: 0000000000000000 +0 +NOTYPE +GLOBAL +DEFAULT +UND external_symbol > diff --git a/gas/configure b/gas/configure > index 110d707f079..7a528fd485e 100755 > --- a/gas/configure > +++ b/gas/configure > @@ -12550,14 +12550,7 @@ _ACEOF > > > if test ${ac_default_generate_riscv_attr} = unset; then > - case ${target_os} in > - elf) > - ac_default_generate_riscv_attr=1 > - ;; > - *) > - ac_default_generate_riscv_attr=0 > - ;; > - esac > + ac_default_generate_riscv_attr=1 > fi > > > diff --git a/gas/configure.ac b/gas/configure.ac > index 78efba88e23..e2374268c56 100644 > --- a/gas/configure.ac > +++ b/gas/configure.ac > @@ -727,14 +727,7 @@ AC_DEFINE_UNQUOTED(DEFAULT_X86_USED_NOTE, > properties by default.]) > > if test ${ac_default_generate_riscv_attr} = unset; then > - case ${target_os} in > - elf) > - ac_default_generate_riscv_attr=1 > - ;; > - *) > - ac_default_generate_riscv_attr=0 > - ;; > - esac > + ac_default_generate_riscv_attr=1 > fi > > AC_DEFINE_UNQUOTED(DEFAULT_RISCV_ATTR, > -- > 2.30.2 >