* ld.texinfo (--no-warn-search-mismatch): Document.
authorAlan Modra <amodra@gmail.com>
Thu, 3 May 2007 09:24:16 +0000 (09:24 +0000)
committerAlan Modra <amodra@gmail.com>
Thu, 3 May 2007 09:24:16 +0000 (09:24 +0000)
* ldfile.c (ldfile_try_open_bfd): Don't warn about skipping
incompatible libraries if --no-warn-search-mismatch.
* ld.h (args_type): Add warn_search_mismatch.
* ldmain.c (main): Init it.
* lexsup.c (enum option_values): Add OPTION_NO_WARN_SEARCH_MISMATCH.
(ld_options): Add entry for --no-warn-search-mismatch.
(parse_args): Handle OPTION_NO_WARN_SEARCH_MISMATCH.

ld/ChangeLog
ld/ld.h
ld/ld.texinfo
ld/ldfile.c
ld/ldmain.c
ld/lexsup.c

index 1064f775bc3265484772e38ae5de98dfafac2c13..8a40c00647a440805894290038263113f8e00211 100644 (file)
@@ -1,3 +1,14 @@
+2007-05-03  Alan Modra  <amodra@bigpond.net.au>
+
+       * ld.texinfo (--no-warn-search-mismatch): Document.
+       * ldfile.c (ldfile_try_open_bfd): Don't warn about skipping
+       incompatible libraries if --no-warn-search-mismatch.
+       * ld.h (args_type): Add warn_search_mismatch.
+       * ldmain.c (main): Init it.
+       * lexsup.c (enum option_values): Add OPTION_NO_WARN_SEARCH_MISMATCH.
+       (ld_options): Add entry for --no-warn-search-mismatch.
+       (parse_args): Handle OPTION_NO_WARN_SEARCH_MISMATCH.
+
 2007-05-03  Alan Modra  <amodra@bigpond.net.au>
 
        * scripttempl/elf.sc: Add .debug_pubtypes and .debug_ranges.
diff --git a/ld/ld.h b/ld/ld.h
index f049c079b62d6e84018e716931aefeadc29875a6..96b9b8d434c1f9086711197c55ad1df704c0a6a6 100644 (file)
--- a/ld/ld.h
+++ b/ld/ld.h
@@ -177,6 +177,10 @@ typedef struct {
      files.  */
   bfd_boolean warn_mismatch;
 
+  /* Warn on attempting to open an incompatible library during a library
+     search.  */
+  bfd_boolean warn_search_mismatch;
+
   /* Name of shared object whose symbol table should be filtered with
      this shared object.  From the --filter option.  */
   char *filter_shlib;
index 010345d7aa9b7a4a59a82aab020488c3a9a7edf5..788c515efcf7650365e801c1bc5765fd082c1d8a 100644 (file)
@@ -1390,6 +1390,11 @@ errors.  This option should only be used with care, in cases when you
 have taken some special action that ensures that the linker errors are
 inappropriate.
 
+@kindex --no-warn-search-mismatch
+@item --no-warn-search-mismatch
+Normally @command{ld} will give a warning if it finds an incompatible
+library during a library search.  This option silences the warning.
+
 @kindex --no-whole-archive
 @item --no-whole-archive
 Turn off the effect of the @option{--whole-archive} option for subsequent
index d3ad46732a3928492919d21bf2c515086789ce1f..9781aac887e1341772772bff917e873b378fa5ba 100644 (file)
@@ -252,8 +252,10 @@ ldfile_try_open_bfd (const char *attempt,
                  yyin = NULL;
                  if (skip)
                    {
-                     einfo (_("%P: skipping incompatible %s when searching for %s\n"),
-                            attempt, entry->local_sym_name);
+                     if (command_line.warn_search_mismatch)
+                       einfo (_("%P: skipping incompatible %s "
+                                "when searching for %s\n"),
+                              attempt, entry->local_sym_name);
                      bfd_close (entry->the_bfd);
                      entry->the_bfd = NULL;
                      return FALSE;
@@ -279,8 +281,10 @@ ldfile_try_open_bfd (const char *attempt,
                    && bfd_get_flavour (output_bfd) == bfd_target_xcoff_flavour
                    && bfd_check_format (entry->the_bfd, bfd_archive)))
            {
-             einfo (_("%P: skipping incompatible %s when searching for %s\n"),
-                    attempt, entry->local_sym_name);
+             if (command_line.warn_search_mismatch)
+               einfo (_("%P: skipping incompatible %s "
+                        "when searching for %s\n"),
+                      attempt, entry->local_sym_name);
              bfd_close (entry->the_bfd);
              entry->the_bfd = NULL;
              return FALSE;
index 1ab52b31119380adb4d0249f63b9203f9c556cc3..ccbc8bb89bf274419b886beac7246ea3ed39978b 100644 (file)
@@ -257,6 +257,7 @@ main (int argc, char **argv)
   command_line.interpreter = NULL;
   command_line.rpath = NULL;
   command_line.warn_mismatch = TRUE;
+  command_line.warn_search_mismatch = TRUE;
   command_line.check_section_addresses = TRUE;
   command_line.accept_unknown_input_arch = FALSE;
   command_line.symbolic = symbolic_unset;
index 489f8adf3f056be9156948f6f48675404e2e8386..dddbdcaff0000dbf68a0f282cae261446cb4c072 100644 (file)
@@ -83,6 +83,7 @@ enum option_values
   OPTION_NO_DEMANGLE,
   OPTION_NO_KEEP_MEMORY,
   OPTION_NO_WARN_MISMATCH,
+  OPTION_NO_WARN_SEARCH_MISMATCH,
   OPTION_NOINHIBIT_EXEC,
   OPTION_NON_SHARED,
   OPTION_NO_WHOLE_ARCHIVE,
@@ -428,6 +429,10 @@ static const struct ld_option ld_options[] =
     TWO_DASHES },
   { {"no-warn-mismatch", no_argument, NULL, OPTION_NO_WARN_MISMATCH},
     '\0', NULL, N_("Don't warn about mismatched input files"), TWO_DASHES},
+  { {"no-warn-search-mismatch", no_argument, NULL,
+     OPTION_NO_WARN_SEARCH_MISMATCH},
+    '\0', NULL, N_("Don't warn on finding an incompatible library"),
+    TWO_DASHES},
   { {"no-whole-archive", no_argument, NULL, OPTION_NO_WHOLE_ARCHIVE},
     '\0', NULL, N_("Turn off --whole-archive"), TWO_DASHES },
   { {"noinhibit-exec", no_argument, NULL, OPTION_NOINHIBIT_EXEC},
@@ -963,6 +968,9 @@ parse_args (unsigned argc, char **argv)
        case OPTION_NO_WARN_MISMATCH:
          command_line.warn_mismatch = FALSE;
          break;
+       case OPTION_NO_WARN_SEARCH_MISMATCH:
+         command_line.warn_search_mismatch = FALSE;
+         break;
        case OPTION_NOINHIBIT_EXEC:
          force_make_executable = TRUE;
          break;