public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Omar Sandoval <osandov@osandov.com>
To: Mark Wielaard <mark@klomp.org>
Cc: elfutils-devel@sourceware.org
Subject: Re: [PATCH] libelf, readelf, elflint: Add RELR support
Date: Thu, 24 Aug 2023 13:41:42 -0700	[thread overview]
Message-ID: <ZOfAhqmRlj4++eUR@telecaster> (raw)
In-Reply-To: <20230824195154.GA14128@gnu.wildebeest.org>

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?

  reply	other threads:[~2023-08-24 20:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-23 22:02 Mark Wielaard
2023-08-24 19:40 ` Omar Sandoval
2023-08-24 19:51   ` Mark Wielaard
2023-08-24 20:41     ` Omar Sandoval [this message]
2023-08-24 21:24       ` Mark Wielaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZOfAhqmRlj4++eUR@telecaster \
    --to=osandov@osandov.com \
    --cc=elfutils-devel@sourceware.org \
    --cc=mark@klomp.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).