From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-2.9 required=3.0 tests=BAYES_00,BODY_8BITS, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id F176B1F910 for ; Sat, 19 Nov 2022 00:35:24 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="UvHqnm7B"; dkim-atps=neutral Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 53A73384F6E3 for ; Sat, 19 Nov 2022 00:35:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 53A73384F6E3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1668818122; bh=2dZHf1HrKl43+MGWRwvA3Vu+5k6BSUm5KIJic6DguX8=; h=Date:Subject:To:Cc:References:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=UvHqnm7B9hnkJ18yzyYnHn8kfbtzZ4fkcbCjD7GQr8lSE3xwpgyRw5ttwlLkTYbph eMx3N4Mf7KNLWDo+e6DLeLtmT2wy2QBt4maJn17msbxhtMvmdg0zlf6Ydm+H0zsfAz JK0hTkCVkO0aaI+eoJE1CT6GIT4o8lXklMlRJf/M= Received: from out2.migadu.com (out2.migadu.com [188.165.223.204]) by sourceware.org (Postfix) with ESMTPS id AEED6384F6C6 for ; Sat, 19 Nov 2022 00:35:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AEED6384F6C6 Message-ID: Date: Fri, 18 Nov 2022 16:34:55 -0800 MIME-Version: 1.0 Subject: Re: [PATCH] ARC: update definitions in elf/elf.h Content-Language: en-US To: Shahab Vahedi , libc-alpha@sourceware.org Cc: Claudiu Zissulescu , arcml References: <20221118131542.23188-1-shahab@synopsys.com> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. In-Reply-To: <20221118131542.23188-1-shahab@synopsys.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT 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: , From: Vineet Gupta via Libc-alpha Reply-To: Vineet Gupta Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org Sender: "Libc-alpha" On 11/18/22 05:15, Shahab Vahedi wrote: > While porting ARCv2 to elfutils [1], it was brought up that the > necessary changes to the project's libelf/elf.h must come from > glibc, because they sync it from glibc [2]. Therefore, this patch > is to update ARC entries in elf/elf.h. > > The majority of the update is about adding new definitions, > specially for the relocations. However, there is one rename, one > deletion, and one change: For completeness: And some cosmetic changes to uppercase hex digits. > > - R_ARC_JUMP_SLOT renamed to R_ARC_JMP_SLOT to match binutils. > - R_ARC_B26 removed because it is unused and deprecated. > - R_ARC_TLS_DTPOFF_S9 changed from 0x4a to the correct value 0x49. Technically this would be an ABI change, but is currently not being used in glibc at all (and I doubt anything outside glibc would use it anyways) so this should be non-controversial. > [1] > https://sourceware.org/pipermail/elfutils-devel/2022q4/005530.html > > [2] > https://sourceware.org/pipermail/elfutils-devel/2022q4/005548.html > > Signed-off-by: Shahab Vahedi > --- > elf/elf.h | 30 +++++++++++++++++++++++++----- > 1 file changed, 25 insertions(+), 5 deletions(-) > > diff --git a/elf/elf.h b/elf/elf.h > index 920e6891e6..dfe5f79036 100644 > --- a/elf/elf.h > +++ b/elf/elf.h > @@ -4160,13 +4160,23 @@ enum > #define R_LARCH_GNU_VTENTRY 58 > > > +/* ARC specific declarations. */ > + > +/* Processor specific flags for the Ehdr e_flags field. */ > +#define EF_ARC_MACH_MSK 0x000000ff > +#define EF_ARC_OSABI_MSK 0x00000f00 > +#define EF_ARC_ALL_MSK (EF_ARC_MACH_MSK | EF_ARC_OSABI_MSK) > + > +/* Processor specific values for the Shdr sh_type field. */ > +#define SHT_ARC_ATTRIBUTES (SHT_LOPROC + 1) /* ARC attributes section. */ > + > /* ARCompact/ARCv2 specific relocs. */ > #define R_ARC_NONE 0x0 > #define R_ARC_8 0x1 > #define R_ARC_16 0x2 > #define R_ARC_24 0x3 > #define R_ARC_32 0x4 > -#define R_ARC_B26 0x5 > + > #define R_ARC_B22_PCREL 0x6 > #define R_ARC_H30 0x7 > #define R_ARC_N8 0x8 > @@ -4206,16 +4216,23 @@ enum > #define R_ARC_SECTOFF_ME_2 0x2A > #define R_ARC_SECTOFF_1 0x2B > #define R_ARC_SECTOFF_2 0x2C > +#define R_ARC_SDA_12 0x2D > +#define R_ARC_SDA16_ST2 0x30 > +#define R_ARC_32_PCREL 0x31 OK. > #define R_ARC_PC32 0x32 > #define R_ARC_GOTPC32 0x33 > #define R_ARC_PLT32 0x34 > #define R_ARC_COPY 0x35 > #define R_ARC_GLOB_DAT 0x36 > -#define R_ARC_JUMP_SLOT 0x37 > +#define R_ARC_JMP_SLOT 0x37 Did you build glibc with this change ? There are references to old definition. git grep R_ARC_JUMP_SLOT sysdeps/arc/dl-machine.h:199:  ((((type) == R_ARC_JUMP_SLOT                                     \ sysdeps/arc/dl-machine.h:206:#define ELF_MACHINE_JMP_SLOT R_ARC_JUMP_SLOT sysdeps/arc/dl-machine.h:277:        case R_ARC_JUMP_SLOT: sysdeps/arc/dl-machine.h:337:  if (r_type == R_ARC_JUMP_SLOT) > #define R_ARC_RELATIVE 0x38 > #define R_ARC_GOTOFF 0x39 > #define R_ARC_GOTPC 0x3A > #define R_ARC_GOT32 0x3B > +#define R_ARC_S21W_PCREL_PLT 0x3C > +#define R_ARC_S25H_PCREL_PLT 0x3D > + > +#define R_ARC_JLI_SECTOFF 0x3F OK. > #define R_ARC_TLS_DTPMOD 0x42 > #define R_ARC_TLS_DTPOFF 0x43 > @@ -4224,9 +4241,12 @@ enum > #define R_ARC_TLS_GD_LD 0x46 > #define R_ARC_TLS_GD_CALL 0x47 > #define R_ARC_TLS_IE_GOT 0x48 > -#define R_ARC_TLS_DTPOFF_S9 0x4a > -#define R_ARC_TLS_LE_S9 0x4a > -#define R_ARC_TLS_LE_32 0x4b > +#define R_ARC_TLS_DTPOFF_S9 0x49 Value change, but not used currently so no ABI implications. > +#define R_ARC_TLS_LE_S9 0x4A cosmetic. OK > +#define R_ARC_TLS_LE_32 0x4B Ditto. > +#define R_ARC_S25W_PCREL_PLT 0x4C > +#define R_ARC_S21H_PCREL_PLT 0x4D > +#define R_ARC_NPS_CMEM16 0x4E OK.