From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-il1-x12f.google.com (mail-il1-x12f.google.com [IPv6:2607:f8b0:4864:20::12f]) by sourceware.org (Postfix) with ESMTPS id 9BDDA3858D35 for ; Tue, 23 May 2023 20:43:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9BDDA3858D35 Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=google.com Received: by mail-il1-x12f.google.com with SMTP id e9e14a558f8ab-33828a86ee2so39065ab.0 for ; Tue, 23 May 2023 13:43:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1684874637; x=1687466637; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=pDQMlbe0Q/hf8BEEvfVTgvfT9dUl/lhWbOVrogn8aFQ=; b=iC5DzGfv3AgzZggepF2RGZ5B7CWpnjuGdMFktNylnpiJWIiODX7EZt56BXuhxpSvEp t2rjKXALSXAP98R8xiVFfAggTf7+Q6RlNi3Pu8KFiKV3xLDnHfGy847VkjRHLs8NcNdW V+VZyKUOZ7hI6FAS4NcH0chLafxZaB3dBPEnyCulpKrGqHv6BB3/welW1V2zyLsYT54D CfGBR3aTaqTXhT6S9NOd929l0TXrqe2lTxUnYuskRX576AaSHZBZ9iEveJfpU2+w2ooo 6b7aiTSH3TTlmZ+F2LK+alJozS+be4cmwWiLB/x2R+ghhWyxx8c+Rf00nTwYFkUn/4nS 0hvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684874637; x=1687466637; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pDQMlbe0Q/hf8BEEvfVTgvfT9dUl/lhWbOVrogn8aFQ=; b=JqVJxK5tzSbDtDnaAKB3tl9FYXd6Y6jrndgdzVjfj27TMa+eZRHgrokN9Dut9pKVJX 7egwonGxgPSA2yt2MwtyKGkvgI36u4S/OLaa1MpgUpfUb2ut78IsbBfgODeRcU5zCT6C 576otLPgUOk/pwkoSHIIYdB2BS01S9iRuKTiAUXSkEs+eooj13KEoqn+k1vf/hxpNc37 iVkQfToQoRLD5t5JHNQCwNljhmygSJNmYWrMh3WPG0vSXjB5x06q4bhKXTDDxS+lyW6Y kPCjaFogmOpWyzo/d+du7G7oy0FM7wmb7STQ3m+RSWBsOA/P/XwVwBAfV0o1iBNbKo6Z gTGw== X-Gm-Message-State: AC+VfDz181icbJFCmuF/hCAP2pQBJstzk2KpoHDexGfiEGXafsP1WgEj ahXaRY1uzjaMnXD/mk7M47qdYw8mQ+kvpDq8iBl9fQ== X-Google-Smtp-Source: ACHHUZ7btcgU3co5U4dZq5BhjWti2lJEMJPhjG3iAjIULtvgleK7Dk4WDV/B3+JvUeo4hRj/+rdnJOkCZsrMrYiYCq8= X-Received: by 2002:a05:6e02:20c7:b0:32a:f2a9:d1b7 with SMTP id 7-20020a056e0220c700b0032af2a9d1b7mr58249ilq.10.1684874637639; Tue, 23 May 2023 13:43:57 -0700 (PDT) MIME-Version: 1.0 References: <8c5df1b6-8575-ad1b-668c-a34c8f7b60b8@suse.com> In-Reply-To: From: Fangrui Song Date: Tue, 23 May 2023 13:43:46 -0700 Message-ID: Subject: Re: ELF's DT_ENCODING To: Alan Modra Cc: Jan Beulich , Binutils , Nick Clifton , Cary Coutant Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-23.7 required=5.0 tests=BAYES_00,BODY_8BITS,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 List-Id: On Mon, May 22, 2023 at 1:03=E2=80=AFAM Alan Modra wrote= : > > On Mon, May 22, 2023 at 08:57:00AM +0200, Jan Beulich wrote: > > I think that part of the change wants reverting > > Yes, I think it was probably bumped without consulting the spec. ;-) > ie. it was changed just for readelf. I'm going to commit the > following after running my normal regression tests. > > include/ > * elf/common.h (DT_ENCODING): Set back to 32. > binutils/ > * readelf.c (struct filedata): Don't size dynamic_info array > using DT_ENCODING. > > diff --git a/binutils/readelf.c b/binutils/readelf.c > index b872876a8b6..d8ad58b15dc 100644 > --- a/binutils/readelf.c > +++ b/binutils/readelf.c > @@ -304,7 +304,7 @@ typedef struct filedata > uint64_t * mipsxlat; > uint64_t gnusymidx; > char * program_interpreter; > - uint64_t dynamic_info[DT_ENCODING]; > + uint64_t dynamic_info[DT_RELRENT + 1]; > uint64_t dynamic_info_DT_GNU_HASH; > uint64_t dynamic_info_DT_MIPS_XHASH; > elf_section_list * symtab_shndx_list; > diff --git a/include/elf/common.h b/include/elf/common.h > index 6f64f05890c..ffa6b60bd2b 100644 > --- a/include/elf/common.h > +++ b/include/elf/common.h > @@ -1135,13 +1135,16 @@ > #define DT_FINI_ARRAYSZ 28 > #define DT_RUNPATH 29 > #define DT_FLAGS 30 > + > +/* Values in the range [DT_ENCODING, DT_LOOS) use d_un.d_ptr if the > + value is even, d_un.d_val if odd. */ > +#define DT_ENCODING 32 > #define DT_PREINIT_ARRAY 32 > #define DT_PREINIT_ARRAYSZ 33 > #define DT_SYMTAB_SHNDX 34 > #define DT_RELRSZ 35 > #define DT_RELR 36 > #define DT_RELRENT 37 > -#define DT_ENCODING 38 > > /* Note, the Oct 4, 1999 draft of the ELF ABI changed the values > for DT_LOOS and DT_HIOS. Some implementations however, use > > -- > Alan Modra > Australia Development Lab, IBM Thanks to Jan for spotting my mistake and Alan for fixing the issue in commit bc227f4ccb0778a56ca3d9f27652fd9e5e2747ea (Re: readelf: Support SHT_RELR/DT_RELR for -r). Apologies for not taking a closer look at the spec that DT_ENCODING is defined, when that RELR patch was prepared. --=20 =E5=AE=8B=E6=96=B9=E7=9D=BF