[PATCH 3/8] BFD: Remove unused BFD pointer member of `struct orl'

Jan Beulich jbeulich@suse.com
Mon Oct 20 05:26:40 GMT 2025


On 17.10.2025 21:48, Maciej W. Rozycki wrote:
> On Fri, 17 Oct 2025, Jan Beulich wrote:
> 
>>> The `abfd' member of `struct orl' has never been used.  Remove it along 
>>> with the enclosing union so as not to propagate clutter with the next 
>>> change, which adds that union as a distinct type.  No functional change.
>>> ---
>>>  bfd/archive.c     |   20 ++++++++------------
>>>  bfd/archive64.c   |    2 +-
>>>  bfd/coff-rs6000.c |   12 ++++++------
>>>  bfd/ecoff.c       |    4 ++--
>>>  bfd/libbfd.h      |    6 +-----
>>>  5 files changed, 18 insertions(+), 26 deletions(-)
>>>
>>> --- binutils-gdb.orig/bfd/archive.c
>>> +++ binutils-gdb/bfd/archive.c
>>> @@ -168,11 +168,7 @@ INTERNAL
>>>  .struct orl		{* Output ranlib.  *}
>>>  .{
>>>  .  char **name;		{* Symbol name.  *}
>>> -.  union
>>> -.  {
>>> -.    file_ptr pos;
>>> -.    bfd *abfd;
>>> -.  } u;			{* bfd* or file position.  *}
>>> +.  bfd *abfd;		{* Containing BFD.  *}
>>>  .  int namidx;		{* Index into string table.  *}
>>>  .};
>>
>> Seeing this change and ...
>>
>>> @@ -2434,7 +2430,7 @@ _bfd_compute_and_write_armap (bfd *arch,
>>>  		      if (*(map[orl_count].name) == NULL)
>>>  			goto error_return;
>>>  		      strcpy (*(map[orl_count].name), syms[src_count]->name);
>>> -		      map[orl_count].u.abfd = current;
>>> +		      map[orl_count].abfd = current;
>>
>> ... use of the "abfd" member here, do you perhaps mean the "pos" member in
>> title and description? Otherwise I fear I'm confused.
> 
>  And right you are!  It seems like a mental slip of mine.  Oh well, I'll 
> repost with the required corrections applied.  Thanks for catching.

No real need to re-post though - the patch is okay with that adjustment.

Jan


More information about the Binutils mailing list