Update.
[deliverable/binutils-gdb.git] / ld / lexsup.c
index 795ecc8896a270a7566139fec7e780175cb61183..dddbdcaff0000dbf68a0f282cae261446cb4c072 100644 (file)
    Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
    02110-1301, USA.  */
 
-#include "config.h"
+#include "sysdep.h"
 #include "bfd.h"
 #include "bfdver.h"
-#include "sysdep.h"
 #include "libiberty.h"
 #include <stdio.h>
 #include <string.h>
@@ -84,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,
@@ -429,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},
@@ -964,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;
@@ -1045,17 +1052,14 @@ parse_args (unsigned argc, char **argv)
              /* First see whether OPTARG is already in the path.  */
              do
                {
-                 size_t idx = 0;
-
-                 while (optarg[idx] != '\0' && optarg[idx] == cp[idx])
-                   ++idx;
-                 if (optarg[idx] == '\0'
-                     && (cp[idx] == '\0' || cp[idx] == ':'))
+                 if (strncmp (optarg, cp, optarg_len) == 0
+                     && (cp[optarg_len] == 0
+                         || cp[optarg_len] == config.rpath_separator))
                    /* We found it.  */
                    break;
 
                  /* Not yet found.  */
-                 cp = strchr (cp, ':');
+                 cp = strchr (cp, config.rpath_separator);
                  if (cp != NULL)
                    ++cp;
                }
@@ -1064,7 +1068,8 @@ parse_args (unsigned argc, char **argv)
              if (cp == NULL)
                {
                  buf = xmalloc (rpath_len + optarg_len + 2);
-                 sprintf (buf, "%s:%s", command_line.rpath, optarg);
+                 sprintf (buf, "%s%c%s", command_line.rpath,
+                          config.rpath_separator, optarg);
                  free (command_line.rpath);
                  command_line.rpath = buf;
                }
@@ -1080,7 +1085,8 @@ parse_args (unsigned argc, char **argv)
              buf = xmalloc (strlen (command_line.rpath_link)
                             + strlen (optarg)
                             + 2);
-             sprintf (buf, "%s:%s", command_line.rpath_link, optarg);
+             sprintf (buf, "%s%c%s", command_line.rpath_link,
+                      config.rpath_separator, optarg);
              free (command_line.rpath_link);
              command_line.rpath_link = buf;
            }
This page took 0.023493 seconds and 4 git commands to generate.