Use size_t rather than bfd_size_type
[deliverable/binutils-gdb.git] / ld / plugin.c
index b0e2a5f7a70764a0c359d35e1ae86b3504be9f62..c951995dccb3104b741925e3604c0311e37134d6 100644 (file)
@@ -1,5 +1,5 @@
 /* Plugin control for the GNU linker.
-   Copyright (C) 2010-2015 Free Software Foundation, Inc.
+   Copyright (C) 2010-2016 Free Software Foundation, Inc.
 
    This file is part of the GNU Binutils.
 
@@ -674,7 +674,24 @@ get_symbols (const void *handle, int nsyms, struct ld_plugin_symbol *syms,
                                             syms[n].name, FALSE, FALSE, TRUE);
       if (!blhe)
        {
-         res = LDPR_UNKNOWN;
+         /* The plugin is called to claim symbols in an archive element
+            from plugin_object_p.  But those symbols aren't needed to
+            create output.  They are defined and referenced only within
+            IR.  */
+         switch (syms[n].def)
+           {
+           default:
+             abort ();
+           case LDPK_UNDEF:
+           case LDPK_WEAKUNDEF:
+             res = LDPR_UNDEF;
+             break;
+           case LDPK_DEF:
+           case LDPK_WEAKDEF:
+           case LDPK_COMMON:
+             res = LDPR_PREVAILING_DEF_IRONLY;
+             break;
+           }
          goto report_symbol;
        }
 
@@ -825,21 +842,23 @@ message (int level, const char *format, ...)
       break;
     case LDPL_WARNING:
       {
-       char *newfmt = ACONCAT (("%P: warning: ", format, "\n",
-                                (const char *) NULL));
+       char *newfmt = concat ("%P: warning: ", format, "\n",
+                              (const char *) NULL);
        vfinfo (stdout, newfmt, args, TRUE);
+       free (newfmt);
       }
       break;
     case LDPL_FATAL:
     case LDPL_ERROR:
     default:
       {
-       char *newfmt = ACONCAT ((level == LDPL_FATAL ? "%P%F" : "%P%X",
-                                ": error: ", format, "\n",
-                                (const char *) NULL));
+       char *newfmt = concat (level == LDPL_FATAL ? "%P%F" : "%P%X",
+                              ": error: ", format, "\n",
+                              (const char *) NULL);
        fflush (stdout);
        vfinfo (stderr, newfmt, args, TRUE);
        fflush (stderr);
+       free (newfmt);
       }
       break;
     }
@@ -1014,8 +1033,6 @@ plugin_call_claim_file (const struct ld_plugin_input_file *file, int *claimed)
 {
   plugin_t *curplug = plugins_list;
   *claimed = FALSE;
-  if (no_more_claiming)
-    return 0;
   while (curplug && !*claimed)
     {
       if (curplug->claim_file_handler)
This page took 0.023671 seconds and 4 git commands to generate.