Delete bfd_my_archive macro
authorAlan Modra <amodra@gmail.com>
Tue, 14 Jun 2016 03:54:37 +0000 (13:24 +0930)
committerAlan Modra <amodra@gmail.com>
Tue, 14 Jun 2016 03:54:37 +0000 (13:24 +0930)
Many more places use abfd->my_archive rather than bfd_my_archive (abfd),
so let's make the code consistently use the first idiom.

bfd/
* bfd-in.h (bfd_my_archive): Delete.
* bfd-in2.h: Regenerate.
binutils/
* ar.c: Expand uses of bfd_my_archive.
* size.c: Likewise.
ld/
* ldlang.c: Expand uses of bfd_my_archive.
* ldmain.c: Likewise.
* ldmisc.c: Likewise.
* plugin.c: Likewise.

bfd/ChangeLog
bfd/bfd-in.h
bfd/bfd-in2.h
binutils/ChangeLog
binutils/ar.c
binutils/size.c
ld/ChangeLog
ld/ldlang.c
ld/ldmain.c
ld/ldmisc.c
ld/plugin.c

index db25f2e241f379d73deffb7d9e684d544ebd757f..53c7c8848d1e46bcaaa619d0858943a90f73eb67 100644 (file)
@@ -1,3 +1,8 @@
+2016-06-14  Alan Modra  <amodra@gmail.com>
+
+       * bfd-in.h (bfd_my_archive): Delete.
+       * bfd-in2.h: Regenerate.
+
 2016-06-14  Alan Modra  <amodra@gmail.com>
 
        PR ld/20241
index 656d991ccf404a36f4c97389464ce5cebb70b289..a7532c51aa012708e92bc4083e4205e84479a30f 100644 (file)
@@ -511,7 +511,6 @@ extern void warn_deprecated (const char *, const char *, int, const char *);
 #define bfd_get_file_flags(abfd) ((abfd)->flags)
 #define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags)
 #define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags)
-#define bfd_my_archive(abfd) ((abfd)->my_archive)
 #define bfd_has_map(abfd) ((abfd)->has_armap)
 #define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive)
 
index b536a59d0031eb02dab442ff06c48d39de952a6e..2d6237c224f065e7d7caa8b0d88f4350e4861fa6 100644 (file)
@@ -518,7 +518,6 @@ extern void warn_deprecated (const char *, const char *, int, const char *);
 #define bfd_get_file_flags(abfd) ((abfd)->flags)
 #define bfd_applicable_file_flags(abfd) ((abfd)->xvec->object_flags)
 #define bfd_applicable_section_flags(abfd) ((abfd)->xvec->section_flags)
-#define bfd_my_archive(abfd) ((abfd)->my_archive)
 #define bfd_has_map(abfd) ((abfd)->has_armap)
 #define bfd_is_thin_archive(abfd) ((abfd)->is_thin_archive)
 
index 77a660448756915e71f3839efdd286d97c074e23..ff8161a1b4193a041921237387c016989198a1c9 100644 (file)
@@ -1,3 +1,8 @@
+2016-06-14  Alan Modra  <amodra@gmail.com>
+
+       * ar.c: Expand uses of bfd_my_archive.
+       * size.c: Likewise.
+
 2016-06-14  Alan Modra  <amodra@gmail.com>
 
        PR ld/20241
index 3d2bc59dcd72c506d44503fdbb1818bbab3f80f4..3afa25333c64adc77cf12b2b87d76eabe7ce33fe 100644 (file)
@@ -1003,7 +1003,7 @@ print_contents (bfd *abfd)
       if (nread != tocopy)
        /* xgettext:c-format */
        fatal (_("%s is not a valid archive"),
-              bfd_get_filename (bfd_my_archive (abfd)));
+              bfd_get_filename (abfd->my_archive));
 
       /* fwrite in mingw32 may return int instead of bfd_size_type. Cast the
         return value to bfd_size_type to avoid comparison between signed and
@@ -1081,7 +1081,7 @@ extract_file (bfd *abfd)
        if (nread != tocopy)
          /* xgettext:c-format */
          fatal (_("%s is not a valid archive"),
-                bfd_get_filename (bfd_my_archive (abfd)));
+                bfd_get_filename (abfd->my_archive));
 
        /* See comment above; this saves disk arm motion */
        if (ostream == NULL)
index ddb3bf480d0cd10eaa0258328cfd7635896fbd57..07a570eff7fe9e0923b48b06dd01a6e3035799fb 100644 (file)
@@ -499,8 +499,8 @@ print_berkeley_format (bfd *abfd)
 
   fputs (bfd_get_filename (abfd), stdout);
 
-  if (bfd_my_archive (abfd))
-    printf (" (ex %s)", bfd_get_filename (bfd_my_archive (abfd)));
+  if (abfd->my_archive)
+    printf (" (ex %s)", bfd_get_filename (abfd->my_archive));
 }
 
 /* I REALLY miss lexical functions! */
@@ -587,8 +587,8 @@ print_sysv_format (bfd *file)
   svi_total = 0;
   printf ("%s  ", bfd_get_filename (file));
 
-  if (bfd_my_archive (file))
-    printf (" (ex %s)", bfd_get_filename (bfd_my_archive (file)));
+  if (file->my_archive)
+    printf (" (ex %s)", bfd_get_filename (file->my_archive));
 
   printf (":\n%-*s   %*s   %*s\n", svi_namelen, "section",
          svi_sizelen, "size", svi_vmalen, "addr");
index ac56c8f14c3dca102d97dcc2747a0d3bcd6f8e7c..4518b46c471d484d2c5585642e5c1b036db2b5a4 100644 (file)
@@ -1,3 +1,10 @@
+2016-06-14  Alan Modra  <amodra@gmail.com>
+
+       * ldlang.c: Expand uses of bfd_my_archive.
+       * ldmain.c: Likewise.
+       * ldmisc.c: Likewise.
+       * plugin.c: Likewise.
+
 2016-06-14  Alan Modra  <amodra@gmail.com>
 
        PR ld/20241
index 1cbba39e988b61ad1cb6d793f20e7af2a656b343..f29651a02e26c4347570a7141626349f3178d871 100644 (file)
@@ -2499,9 +2499,9 @@ wild_sort (lang_wild_statement_type *wild,
             archive.  */
 
          if (file->the_bfd != NULL
-             && bfd_my_archive (file->the_bfd) != NULL)
+             && file->the_bfd->my_archive != NULL)
            {
-             fn = bfd_get_filename (bfd_my_archive (file->the_bfd));
+             fn = bfd_get_filename (file->the_bfd->my_archive);
              fa = TRUE;
            }
          else
@@ -2510,9 +2510,9 @@ wild_sort (lang_wild_statement_type *wild,
              fa = FALSE;
            }
 
-         if (bfd_my_archive (ls->section->owner) != NULL)
+         if (ls->section->owner->my_archive != NULL)
            {
-             ln = bfd_get_filename (bfd_my_archive (ls->section->owner));
+             ln = bfd_get_filename (ls->section->owner->my_archive);
              la = TRUE;
            }
          else
index 3c5065f9424e0aadbed4765a0c40210655ac80f5..406833b35f110cbcf197602d539d710224bc0159 100644 (file)
@@ -865,17 +865,17 @@ add_archive_element (struct bfd_link_info *info,
          header_printed = TRUE;
        }
 
-      if (bfd_my_archive (abfd) == NULL
-         || bfd_is_thin_archive (bfd_my_archive (abfd)))
+      if (abfd->my_archive == NULL
+         || bfd_is_thin_archive (abfd->my_archive))
        {
          minfo ("%s", bfd_get_filename (abfd));
          len = strlen (bfd_get_filename (abfd));
        }
       else
        {
-         minfo ("%s(%s)", bfd_get_filename (bfd_my_archive (abfd)),
+         minfo ("%s(%s)", bfd_get_filename (abfd->my_archive),
                 bfd_get_filename (abfd));
-         len = (strlen (bfd_get_filename (bfd_my_archive (abfd)))
+         len = (strlen (bfd_get_filename (abfd->my_archive))
                 + strlen (bfd_get_filename (abfd))
                 + 2);
        }
index 321db9a21c59f2d85b74c29a4365c8eb1d364256..5efff74feef0e7636b8c1f95065960e70c824c1d 100644 (file)
@@ -231,13 +231,13 @@ vfinfo (FILE *fp, const char *fmt, va_list arg, bfd_boolean is_warning)
                lang_input_statement_type *i;
 
                i = va_arg (arg, lang_input_statement_type *);
-               if (bfd_my_archive (i->the_bfd) != NULL
-                   && !bfd_is_thin_archive (bfd_my_archive (i->the_bfd)))
+               if (i->the_bfd->my_archive != NULL
+                   && !bfd_is_thin_archive (i->the_bfd->my_archive))
                  fprintf (fp, "(%s)",
-                          bfd_get_filename (bfd_my_archive (i->the_bfd)));
+                          bfd_get_filename (i->the_bfd->my_archive));
                fprintf (fp, "%s", i->local_sym_name);
-               if ((bfd_my_archive (i->the_bfd) == NULL
-                    || bfd_is_thin_archive (bfd_my_archive (i->the_bfd)))
+               if ((i->the_bfd->my_archive == NULL
+                    || bfd_is_thin_archive (i->the_bfd->my_archive))
                    && filename_cmp (i->local_sym_name, i->filename) != 0)
                  fprintf (fp, " (%s)", i->filename);
              }
index c347cfa61cc9484ccf4f68a149d91b41fa4b1883..ebde25ffe70aee6b002ea4a554f61545799c7155 100644 (file)
@@ -1089,9 +1089,9 @@ plugin_object_p (bfd *ibfd)
        return NULL;
     }
 
-  inarchive = (bfd_my_archive (ibfd) != NULL
-              && !bfd_is_thin_archive (bfd_my_archive (ibfd)));
-  name = inarchive ? bfd_my_archive (ibfd)->filename : ibfd->filename;
+  inarchive = (ibfd->my_archive != NULL
+              && !bfd_is_thin_archive (ibfd->my_archive));
+  name = inarchive ? ibfd->my_archive->filename : ibfd->filename;
   fd = open (name, O_RDONLY | O_BINARY);
 
   if (fd < 0)