From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by sourceware.org (Postfix) with ESMTPS id 1F2A43858C53 for ; Thu, 24 Aug 2023 20:41:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1F2A43858C53 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=osandov.com Authentication-Results: sourceware.org; spf=none smtp.mailfrom=osandov.com Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1bba48b0bd2so2702985ad.3 for ; Thu, 24 Aug 2023 13:41:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osandov-com.20221208.gappssmtp.com; s=20221208; t=1692909704; x=1693514504; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=gHE8aGx4bJWc7TbjB6URfhyFv6zanDCpVs3jiJQmJj0=; b=n//Ugr2NDaYQlHsUrbMbmW83pCF5uGEnDlmWxelLFwhoTD+8m1/csNEb2Dh/qxGite KK1NkvODxXt6W4gRptO9jj2leZACg37Kbu8XSlW1PgBlXO9853YWFr/cMe86kBoxjU+D +peo8SlWDNWWoeOM8u+tQG163aXmkRCjGQYcpabjQ3QAVTDjVtmcGoRRMK005gRa2A4z K4kVvBVWkJnTbNjLFkJK4VooTbR8Ds4KvdlyBkpZNxwTesuPGUTKVMZgG2XGd+zWPvW7 8QBML6MxKOlkZPKZ8e7R4FLBZdecBINfmuViwDofzDFHrB/NaWk7lQA0C0jX3T4CFbOC Lkyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692909704; x=1693514504; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=gHE8aGx4bJWc7TbjB6URfhyFv6zanDCpVs3jiJQmJj0=; b=MEiw7jPcKAO942nIXxL1TFewUVGV92vsrgXv6PZ3esFsFL8V//FQiyLhg4xZ319cZJ FmMOB+dQwUFOMl/W9FOsLoGjwMCnLOhgw9FkoEiXV3gIFVFqicxxIwQbtL6syS67Yk/A ybjDaGFu9kZOu89MmIKXiO5YSxNDU57TmEN2jcbVPYNAxKF249xssdFqXanefiwN5kph tZIY+H+plI/3ddVASH30eq+sZO+fje2e6zGwsFSwjUYN+SMQDaUC51gEMrdayq12PAhk jf0/eZtVjZuzPBgJh+79qCbXL1szBTFkBxNBP8BeAicSjkpG0COyY/2x/Lqp1PvtSKMi k2Fg== X-Gm-Message-State: AOJu0YwgdEeRnnYNXnyXjvo0R7zmT2hl1nii1A4pFeTbh6exKN4HZJyV XRlGWvLhg5kQ42KET6tZ+jl3B1UiiKL3RB/oWzY= X-Google-Smtp-Source: AGHT+IHkX64fmP06S8+vERxXjBTnX8GLlG9ZANRNMvTIcP+XLf3qEXTU4O8+qkxtuIYuHDokqlBZCg== X-Received: by 2002:a17:902:db10:b0:1c0:b3d1:5826 with SMTP id m16-20020a170902db1000b001c0b3d15826mr6384124plx.53.1692909704140; Thu, 24 Aug 2023 13:41:44 -0700 (PDT) Received: from telecaster ([2601:602:a300:3bc0::2928]) by smtp.gmail.com with ESMTPSA id h10-20020a170902f7ca00b001bba669a7eesm83609plw.52.2023.08.24.13.41.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Aug 2023 13:41:43 -0700 (PDT) Date: Thu, 24 Aug 2023 13:41:42 -0700 From: Omar Sandoval To: Mark Wielaard Cc: elfutils-devel@sourceware.org Subject: Re: [PATCH] libelf, readelf, elflint: Add RELR support Message-ID: 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: <20230824195154.GA14128@gnu.wildebeest.org> X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,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: On Thu, Aug 24, 2023 at 09:51:54PM +0200, Mark Wielaard wrote: > Hi Omar, > > On Thu, Aug 24, 2023 at 12:40:19PM -0700, Omar Sandoval wrote: > > On Thu, Aug 24, 2023 at 12:02:11AM +0200, Mark Wielaard wrote: > > > > > > * libelf/gelf.h (Gelf_Relr): New typedef for Elf64_Relr. > > > > > > +/* Relative relocation entry (in section of type SHT_RELR). */ > > > +typedef Elf64_Relr Gelf_Relr; > > > > Should this be GElf_Relr (with an uppercase E in GElf like the other > > typedefs)? > > Oops. Yes, it should. Thanks for spotting that. 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?