From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by sourceware.org (Postfix) with ESMTPS id 3C2BA3835825 for ; Thu, 12 May 2022 20:41:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3C2BA3835825 Received: by mail-pj1-x1035.google.com with SMTP id cq17-20020a17090af99100b001dc0386cd8fso5905206pjb.5 for ; Thu, 12 May 2022 13:41:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=BqE1NjsHA329UJ3JLlqgOvmtQ4KZQdVtMg9i+0xFE0M=; b=ZZxtDS/1g/x4dQUyD1KQUhZOKM8PcaZHKzTWSnDg1KdApJlaHFvJcbKPRHQ4ackmPQ fMvOm3rUKnl9rRy82AzuKi2AC5RtACXyDAZuowIhBzd/KaLs9uTkclNnMR030cRfiQHU b2WlI0ZADQOMFYJMjE0AvkwCCpP9jLoOlCGReYU5JwSxTyTWU4OHuyL8DWmapovnyZiZ a7qgan7ZnovIEptYRr167x3KIVizj3xGzysWVkzX5zJtcjMnLwylhI5NU55Xer78bjZi zpXY4UUo0/xUAoRa3FDnY58sJRZWoIZyQlMZxG8hNAxqV6zufNSeo/UUOqchOwnJER3/ gjqg== X-Gm-Message-State: AOAM533r4xiEr9cn6Ox3kuSMF+oiR11itxrdXr7GcOvM3NzslPZV6A7i iWQ220eWZvykxTsr8RQs2fh5D+Cild8VUg== X-Google-Smtp-Source: ABdhPJxIAsNJsOJiHemkjxnKZURY1PAw598Sm/pAKKaMdm+gyjwoq3YNGDxjQ5Of/3c6y5+iBqu5cQ== X-Received: by 2002:a17:902:f54a:b0:15e:a95a:c0a7 with SMTP id h10-20020a170902f54a00b0015ea95ac0a7mr1586296plf.134.1652388087155; Thu, 12 May 2022 13:41:27 -0700 (PDT) Received: from google.com ([2620:15c:2ce:200:e892:f9c7:57f5:14db]) by smtp.gmail.com with ESMTPSA id t4-20020a170902e84400b0015eb690bee9sm310869plg.196.2022.05.12.13.41.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 May 2022 13:41:26 -0700 (PDT) Date: Thu, 12 May 2022 13:41:24 -0700 From: Fangrui Song To: Andreas Schwab Cc: libc-alpha@sourceware.org Subject: Re: [PATCH] Update RISC-V specific ELF definitions Message-ID: <20220512204124.az75xwoxqxazj6rf@google.com> References: <87czgubqc4.fsf@igel.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <87czgubqc4.fsf@igel.home> X-Spam-Status: No, score=-27.4 required=5.0 tests=BAYES_00, DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL, USER_IN_DEF_SPF_WL 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: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 May 2022 20:41:29 -0000 On 2022-05-03, Andreas Schwab wrote: >The definitions are taken from the 1.0-rc2 version of the ELF psABI. >--- > elf/elf.h | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > >diff --git a/elf/elf.h b/elf/elf.h >index 0195029188..648bf66c7d 100644 >--- a/elf/elf.h >+++ b/elf/elf.h >@@ -3927,6 +3927,8 @@ enum > #define EF_RISCV_FLOAT_ABI_SINGLE 0x0002 > #define EF_RISCV_FLOAT_ABI_DOUBLE 0x0004 > #define EF_RISCV_FLOAT_ABI_QUAD 0x0006 >+#define EF_RISCV_RVE 0x0008 >+#define EF_RISCV_TSO 0x0010 > > /* RISC-V relocations. */ > #define R_RISCV_NONE 0 >@@ -3987,6 +3989,18 @@ enum > > #define R_RISCV_NUM 59 > >+/* RISC-V specific values for the st_other field. */ >+#define STO_RISCV_VARIANT_CC 0x80 I see that there is a precedent that STO_AARCH64_VARIANT_PCS calls this "AArch64 specific values for the st_other field", but a descriptive comment may be more useful, e.g. "Mark functions that do not follow the standard calling convention for the ABI in use." "RISC-V specific" can probably be removed as "RISCV" in the macro name self explains. >+/* RISC-V specific values for the sh_type field. */ >+#define SHT_RISCV_ATTRIBUTES (SHT_LOPROC + 3) >+ >+/* RISC-V specific values for the p_type field. */ >+#define PT_RISCV_ATTRIBUTES (PT_LOPROC + 3) >+ >+/* RISC-V specific values for the d_tag field. */ >+#define DT_RISCV_VARIANT_CC (DT_LOPROC + 1) >+ > /* BPF specific declarations. */ > > #define R_BPF_NONE 0 /* No reloc */ >-- >2.35.2 I have verified these values match https://github.com/riscv-non-isa/riscv-elf-psabi-doc/releases/download/v1.0-rc2/riscv-abi.pdf Reviewed-by: Fangrui Song