OSDN Git Service

* Makefile.def (target_modules) [libtermcap, libiberty, zlib]: Stage.
[pf3gnuchains/gcc-fork.git] / gcc / collect2.c
index 356eda9..a249e4c 100644 (file)
@@ -150,6 +150,10 @@ int do_collecting = 1;
 int do_collecting = 0;
 #endif
 
+#ifndef COLLECT_PARSE_FLAG
+#define COLLECT_PARSE_FLAG(FLAG)
+#endif
+
 /* Nonzero if we should suppress the automatic demangling of identifiers
    in linker error messages.  Set from COLLECT_NO_DEMANGLE.  */
 int no_demangle;
@@ -853,8 +857,11 @@ main (int argc, char **argv)
     int i;
 
     for (i = 1; argv[i] != NULL; i ++)
-      if (! strcmp (argv[i], "-debug"))
-       debug = 1;
+      {
+       if (! strcmp (argv[i], "-debug"))
+         debug = 1;
+       COLLECT_PARSE_FLAG (argv[i]);
+      }
     vflag = debug;
   }
 
@@ -877,8 +884,9 @@ main (int argc, char **argv)
     }
   obstack_free (&temporary_obstack, temporary_firstobj);
 
-  /* -fno-exceptions -w */
-  num_c_args += 2;
+  /* -fno-profile-arcs -fno-test-coverage -fno-branch-probabilities
+     -fno-exceptions -w */
+  num_c_args += 5;
 
   c_ptr = (const char **) (c_argv = xcalloc (sizeof (char *), num_c_args));
 
@@ -1039,6 +1047,9 @@ main (int argc, char **argv)
        }
     }
   obstack_free (&temporary_obstack, temporary_firstobj);
+  *c_ptr++ = "-fno-profile-arcs";
+  *c_ptr++ = "-fno-test-coverage";
+  *c_ptr++ = "-fno-branch-probabilities";
   *c_ptr++ = "-fno-exceptions";
   *c_ptr++ = "-w";
 
@@ -1421,10 +1432,10 @@ main (int argc, char **argv)
 
   fork_execute ("gcc",  c_argv);
 #ifdef COLLECT_EXPORT_LIST
-  /* On AIX we must call tlink because of possible templates resolution */
+  /* On AIX we must call tlink because of possible templates resolution */
   do_tlink (ld2_argv, object_lst);
 #else
-  /* Otherwise, simply call ld because tlink is already done */
+  /* Otherwise, simply call ld because tlink is already done */
   fork_execute ("ld", ld2_argv);
 
   /* Let scan_prog_file do any final mods (OSF/rose needs this for
@@ -2473,9 +2484,9 @@ scan_libraries (const char *prog_name)
     }
 
   /* Parent context from here on.  */
-  int_handler  = (void (*) (int))) signal (SIGINT,  SIG_IGN;
+  int_handler  = (void (*) (int)) signal (SIGINT,  SIG_IGN);
 #ifdef SIGQUIT
-  quit_handler = (void (*) (int))) signal (SIGQUIT, SIG_IGN;
+  quit_handler = (void (*) (int)) signal (SIGQUIT, SIG_IGN);
 #endif
 
   if (close (pipe_fd[1]) < 0)
@@ -2545,7 +2556,7 @@ scan_libraries (const char *prog_name)
 
 #ifdef OBJECT_FORMAT_COFF
 
-#if defined(EXTENDED_COFF)
+#if defined (EXTENDED_COFF)
 
 #   define GCC_SYMBOLS(X)      (SYMHEADER(X).isymMax + SYMHEADER(X).iextMax)
 #   define GCC_SYMENT          SYMR
@@ -2558,14 +2569,26 @@ scan_libraries (const char *prog_name)
 
 #   define GCC_SYMBOLS(X)      (HEADER(ldptr).f_nsyms)
 #   define GCC_SYMENT          SYMENT
-#   define GCC_OK_SYMBOL(X) \
-     (((X).n_sclass == C_EXT) && \
-      ((X).n_scnum > N_UNDEF) && \
-      (aix64_flag \
-       || (((X).n_type & N_TMASK) == (DT_NON << N_BTSHFT) \
-           || ((X).n_type & N_TMASK) == (DT_FCN << N_BTSHFT))))
-#   define GCC_UNDEF_SYMBOL(X) \
-     (((X).n_sclass == C_EXT) && ((X).n_scnum == N_UNDEF))
+#   if defined (C_WEAKEXT)
+#     define GCC_OK_SYMBOL(X) \
+       (((X).n_sclass == C_EXT || (X).n_sclass == C_WEAKEXT) && \
+        ((X).n_scnum > N_UNDEF) && \
+        (aix64_flag \
+         || (((X).n_type & N_TMASK) == (DT_NON << N_BTSHFT) \
+             || ((X).n_type & N_TMASK) == (DT_FCN << N_BTSHFT))))
+#     define GCC_UNDEF_SYMBOL(X) \
+       (((X).n_sclass == C_EXT || (X).n_sclass == C_WEAKEXT) && \
+        ((X).n_scnum == N_UNDEF))
+#   else
+#     define GCC_OK_SYMBOL(X) \
+       (((X).n_sclass == C_EXT) && \
+        ((X).n_scnum > N_UNDEF) && \
+        (aix64_flag \
+         || (((X).n_type & N_TMASK) == (DT_NON << N_BTSHFT) \
+             || ((X).n_type & N_TMASK) == (DT_FCN << N_BTSHFT))))
+#     define GCC_UNDEF_SYMBOL(X) \
+       (((X).n_sclass == C_EXT) && ((X).n_scnum == N_UNDEF))
+#   endif
 #   define GCC_SYMINC(X)       ((X).n_numaux+1)
 #   define GCC_SYMZERO(X)      0