public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Nick Clifton <nickc@redhat.com>
To: Fangrui Song <i@maskray.me>
Cc: binutils@sourceware.org
Subject: Re: Commit: readelf: Improve display of RELR relocations
Date: Wed, 24 Apr 2024 12:25:05 +0100	[thread overview]
Message-ID: <f8060b4b-7622-4cc1-b5ab-65455f951581@redhat.com> (raw)
In-Reply-To: <MN0PR12MB5761E8D41391C97D0666D300CB112@MN0PR12MB5761.namprd12.prod.outlook.com>

Hi Fangrui,

> I've only got two nits:
> 
> Perhaps PRId64 should be changed to PRIu64 as num_rela is unsigned?

Good point.  In fact there are several places where this change would
be appropriate.

> At /* It is theoretically possible for nentries to be 1.  */ , `if
> (nentries == 0` does not free `relrs`.
> Can `if (nentries == 0` be removed since the for loop handles the
> zero-entry case?

I could do that.  But since we know that the number of entries is zero,
why bother loading the relr data at all ?  It makes more sense to move
the check for (nentries == 0) to before the call the get_data() and thus
eliminating the need to load - and free - the section contents.

I am just running some last minute checks on the revised patch and then
I will check it in shortly.

Cheers
   Nick



      parent reply	other threads:[~2024-04-24 11:25 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-11 15:56 Nick Clifton
2024-04-12 18:44 ` Fangrui Song
     [not found] ` <CAN30aBFj+_Yfs8+WrC7aM0ZWQihGoZ8nMk2DHO7Xkxzw6PgqSA@mail.gmail.com>
2024-04-12 22:04   ` Fangrui Song
     [not found]   ` <DS7PR12MB576532E4BB26A2211E7A75AACB042@DS7PR12MB5765.namprd12.prod.outlook.com>
2024-04-16 12:22     ` Nick Clifton
2024-04-18  2:28       ` Fangrui Song
     [not found]       ` <DS7PR12MB57659F007C5FA3B3CE38A2ECCB0E2@DS7PR12MB5765.namprd12.prod.outlook.com>
2024-04-19 10:55         ` Nick Clifton
2024-04-23 19:37           ` Fangrui Song
     [not found]           ` <MN0PR12MB5761E8D41391C97D0666D300CB112@MN0PR12MB5761.namprd12.prod.outlook.com>
2024-04-24 11:25             ` Nick Clifton [this message]

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=f8060b4b-7622-4cc1-b5ab-65455f951581@redhat.com \
    --to=nickc@redhat.com \
    --cc=binutils@sourceware.org \
    --cc=i@maskray.me \
    /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).