From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id 5BA723858401 for ; Thu, 24 Aug 2023 21:24:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5BA723858401 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org Received: by gnu.wildebeest.org (Postfix, from userid 1000) id 49231302BBEC; Thu, 24 Aug 2023 23:24:46 +0200 (CEST) Date: Thu, 24 Aug 2023 23:24:46 +0200 From: Mark Wielaard To: Omar Sandoval Cc: elfutils-devel@sourceware.org Subject: Re: [PATCH] libelf, readelf, elflint: Add RELR support Message-ID: <20230824212446.GB14128@gnu.wildebeest.org> References: <20230823220211.1942430-1-mark@klomp.org> <20230824195154.GA14128@gnu.wildebeest.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-3029.4 required=5.0 tests=BAYES_00,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,RCVD_IN_DNSWL_LOW,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: Hi Omar, On Thu, Aug 24, 2023 at 01:41:42PM -0700, Omar Sandoval wrote: > One more thing, if someone installs a newer elfutils with this change > but their glibc is older and doesn't define Elf64_Relr (which was > apparently added in glibc 2.36), then gelf.h will be unusable: > > /usr/include/gelf.h:86:9: error: unknown type name 'Elf64_Relr' > 86 | typedef Elf64_Relr Gelf_Relr; > | ^~~~~~~~~~ > > (A Koji build of drgn for Fedora 40 ran into this: > https://koji.fedoraproject.org/koji/taskinfo?taskID=105242437, except > that in my case it's because I was vendoring an old version of elf.h. I > fixed it by not vendoring elf.h anymore: > https://github.com/osandov/drgn/commit/3d07cb1682045a4ac90e1977bcbd5b4864911e32, > but this same issue can come up in more legitimate situations like the > one I mentioned.) > > Maybe this can be wrapped in an #ifdef DT_RELR or something like that? Another good point. Yes, we should do that, we did the same when SHF_COMPRESSED and ELFCOMPRESS_ZSTD were introduced. I'll also update rawhide asap with your suggested fixes. Thanks, Mark