Commit: readelf: Improve display of RELR relocations

Nick Clifton nickc@redhat.com
Wed Apr 24 11:25:05 GMT 2024


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




More information about the Binutils mailing list