]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
BFD: Remove unused file position member of `struct orl'
authorMaciej W. Rozycki <macro@redhat.com>
Wed, 5 Nov 2025 19:02:55 +0000 (19:02 +0000)
committerMaciej W. Rozycki <macro@redhat.com>
Wed, 5 Nov 2025 19:02:55 +0000 (19:02 +0000)
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.

bfd/archive.c
bfd/archive64.c
bfd/coff-rs6000.c
bfd/ecoff.c
bfd/libbfd.h

index d2a9fd171a7e76c9a063e1d805bd950fb3f370dc..b9fea5bcc00dbdbd715a8a02d32269ede5378fa4 100644 (file)
@@ -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;
 
index 5f2713b8c9288cdd4873a6963c7c986750cf0561..064e989edc515cb83ccb52b1660ab3a2e9ad6201 100644 (file)
@@ -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);
index fc065d7095d24445e04d19eb36b2bafbf051bda5..46a2c613b691beed4aa18634f18f26e36077d380 100644 (file)
@@ -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)
                {
index 4f305ebad8b7a59b23557c5e5246e4997deebdb9..d22a9145f72af0b251d809bbd410144431d71fe2 100644 (file)
@@ -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;
index 193c01ef50a6ad258308cfd00c72abf92b8ce9bc..5f1239ecb43e2391f0f2ee52a8edfb1cecadea1a 100644 (file)
@@ -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.  */
 };