From: Maciej W. Rozycki Date: Wed, 5 Nov 2025 19:02:55 +0000 (+0000) Subject: BFD: Remove unused file position member of `struct orl' X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2ae26cd86339888aa04461b775290080b8058818;p=thirdparty%2Fbinutils-gdb.git BFD: Remove unused file position member of `struct orl' The `pos' member of `struct orl' has never been used. Remove it along with the enclosing union so as not to propagate clutter with a later change, which adds that union as a distinct type. No functional change. --- diff --git a/bfd/archive.c b/bfd/archive.c index d2a9fd171a7..b9fea5bcc00 100644 --- a/bfd/archive.c +++ b/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. *} .}; . @@ -2434,7 +2430,7 @@ _bfd_compute_and_write_armap (bfd *arch, unsigned int elength) 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; map[orl_count].namidx = stridx; stridx += namelen + 1; @@ -2500,7 +2496,7 @@ _bfd_bsd_write_armap (bfd *arch, { unsigned int offset; - if (map[count].u.abfd != last_elt) + if (map[count].abfd != last_elt) { do { @@ -2511,7 +2507,7 @@ _bfd_bsd_write_armap (bfd *arch, firstreal += firstreal % 2; current = current->archive_next; } - while (current != map[count].u.abfd); + while (current != map[count].abfd); } /* The archive file format only has 4 bytes to store the offset @@ -2576,7 +2572,7 @@ _bfd_bsd_write_armap (bfd *arch, unsigned int offset; bfd_byte buf[BSD_SYMDEF_SIZE]; - if (map[count].u.abfd != last_elt) + if (map[count].abfd != last_elt) { do { @@ -2587,7 +2583,7 @@ _bfd_bsd_write_armap (bfd *arch, firstreal += firstreal % 2; current = current->archive_next; } - while (current != map[count].u.abfd); + while (current != map[count].abfd); } /* The archive file format only has 4 bytes to store the offset @@ -2744,7 +2740,7 @@ _bfd_coff_write_armap (bfd *arch, /* For each symbol which is used defined in this object, write out the object file's address in the archive. */ - while (count < symbol_count && map[count].u.abfd == current) + while (count < symbol_count && map[count].abfd == current) { unsigned int offset = (unsigned int) archive_member_file_ptr; @@ -2802,7 +2798,7 @@ _bfd_coff_write_armap (bfd *arch, /* For each symbol which is used defined in this object, write out the object file's address in the archive. */ - while (count < symbol_count && map[count].u.abfd == current) + while (count < symbol_count && map[count].abfd == current) { unsigned int offset = (unsigned int) archive_member_file_ptr; diff --git a/bfd/archive64.c b/bfd/archive64.c index 5f2713b8c92..064e989edc5 100644 --- a/bfd/archive64.c +++ b/bfd/archive64.c @@ -226,7 +226,7 @@ _bfd_archive_64_bit_write_armap (bfd *arch, the object file's address in the archive. */ for (; - count < symbol_count && map[count].u.abfd == current; + count < symbol_count && map[count].abfd == current; count++) { bfd_putb64 ((bfd_vma) archive_member_file_ptr, buf); diff --git a/bfd/coff-rs6000.c b/bfd/coff-rs6000.c index fc065d7095d..46a2c613b69 100644 --- a/bfd/coff-rs6000.c +++ b/bfd/coff-rs6000.c @@ -1929,7 +1929,7 @@ xcoff_write_armap_old (bfd *abfd, unsigned int elength ATTRIBUTE_UNUSED, i = 0; archive_iterator_begin (&iterator, abfd); while (i < orl_count && archive_iterator_next (&iterator)) - while (map[i].u.abfd == iterator.current.member) + while (map[i].abfd == iterator.current.member) { H_PUT_32 (abfd, iterator.current.offset, buf); if (bfd_write (buf, 4, abfd) != 4) @@ -2054,7 +2054,7 @@ xcoff_write_armap_big (bfd *abfd, unsigned int elength ATTRIBUTE_UNUSED, current_bfd = current_bfd->archive_next) { arch_info = bfd_get_arch_info (current_bfd); - while (map[i].u.abfd == current_bfd) + while (map[i].abfd == current_bfd) { string_length = strlen (*map[i].name) + 1; if (arch_info->bits_per_address == 64) @@ -2151,7 +2151,7 @@ xcoff_write_armap_big (bfd *abfd, unsigned int elength ATTRIBUTE_UNUSED, while (i < orl_count && archive_iterator_next (&iterator)) { arch_info = bfd_get_arch_info (iterator.current.member); - while (map[i].u.abfd == iterator.current.member) + while (map[i].abfd == iterator.current.member) { if (arch_info->bits_per_address == 32) { @@ -2169,7 +2169,7 @@ xcoff_write_armap_big (bfd *abfd, unsigned int elength ATTRIBUTE_UNUSED, current_bfd = current_bfd->archive_next) { arch_info = bfd_get_arch_info (current_bfd); - while (map[i].u.abfd == current_bfd) + while (map[i].abfd == current_bfd) { if (arch_info->bits_per_address == 32) { @@ -2235,7 +2235,7 @@ xcoff_write_armap_big (bfd *abfd, unsigned int elength ATTRIBUTE_UNUSED, while (i < orl_count && archive_iterator_next (&iterator)) { arch_info = bfd_get_arch_info (iterator.current.member); - while (map[i].u.abfd == iterator.current.member) + while (map[i].abfd == iterator.current.member) { if (arch_info->bits_per_address == 64) { @@ -2253,7 +2253,7 @@ xcoff_write_armap_big (bfd *abfd, unsigned int elength ATTRIBUTE_UNUSED, current_bfd = current_bfd->archive_next) { arch_info = bfd_get_arch_info (current_bfd); - while (map[i].u.abfd == current_bfd) + while (map[i].abfd == current_bfd) { if (arch_info->bits_per_address == 64) { diff --git a/bfd/ecoff.c b/bfd/ecoff.c index 4f305ebad8b..d22a9145f72 100644 --- a/bfd/ecoff.c +++ b/bfd/ecoff.c @@ -3174,7 +3174,7 @@ _bfd_ecoff_write_armap (bfd *abfd, /* Advance firstreal to the file position of this archive element. */ - if (map[i].u.abfd != last_elt) + if (map[i].abfd != last_elt) { do { @@ -3182,7 +3182,7 @@ _bfd_ecoff_write_armap (bfd *abfd, firstreal += firstreal % 2; current = current->archive_next; } - while (current != map[i].u.abfd); + while (current != map[i].abfd); } last_elt = current; diff --git a/bfd/libbfd.h b/bfd/libbfd.h index 193c01ef50a..5f1239ecb43 100644 --- a/bfd/libbfd.h +++ b/bfd/libbfd.h @@ -1014,11 +1014,7 @@ extern const struct bfd_iovec _bfd_memory_iovec; 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. */ };