aboutsummaryrefslogtreecommitdiff
path: root/gcc/collect2.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/collect2.c')
-rw-r--r--gcc/collect2.c46
1 files changed, 28 insertions, 18 deletions
diff --git a/gcc/collect2.c b/gcc/collect2.c
index c26838427d7..c901179ffeb 100644
--- a/gcc/collect2.c
+++ b/gcc/collect2.c
@@ -234,7 +234,7 @@ struct obstack temporary_obstack;
char * temporary_firstobj;
/* Holds the return value of pexecute. */
-int pexecute_pid;
+int pid;
/* Structure to hold all the directories in which to search for files to
execute. */
@@ -1499,7 +1499,7 @@ collect_wait (prog)
{
int status;
- pwait (pexecute_pid, &status, 0);
+ pwait (pid, &status, 0);
if (status)
{
if (WIFSIGNALED (status))
@@ -1507,7 +1507,7 @@ collect_wait (prog)
int sig = WTERMSIG (status);
error ("%s terminated with signal %d [%s]%s",
prog, sig, strsignal(sig),
- status & 0200 ? "" : ", core dumped");
+ WCOREDUMP(status) ? ", core dumped" : "");
collect_exit (FATAL_EXIT_CODE);
}
@@ -1588,9 +1588,9 @@ collect_execute (prog, argv, redir)
dup2 (redir_handle, STDERR_FILENO);
}
- pexecute_pid = pexecute (argv[0], argv, argv[0], NULL,
- &errmsg_fmt, &errmsg_arg,
- (PEXECUTE_FIRST | PEXECUTE_LAST | PEXECUTE_SEARCH));
+ pid = pexecute (argv[0], argv, argv[0], NULL,
+ &errmsg_fmt, &errmsg_arg,
+ (PEXECUTE_FIRST | PEXECUTE_LAST | PEXECUTE_SEARCH));
if (redir)
{
@@ -1602,7 +1602,7 @@ collect_execute (prog, argv, redir)
close (redir_handle);
}
- if (pexecute_pid == -1)
+ if (pid == -1)
fatal_perror (errmsg_fmt, errmsg_arg);
}
@@ -2069,7 +2069,6 @@ scan_prog_file (prog_name, which_pass)
void (*quit_handler) PARAMS ((int));
char *real_nm_argv[4];
const char **nm_argv = (const char **) real_nm_argv;
- int pid;
int argc = 0;
int pipe_fd[2];
char *p, buf[1024];
@@ -2514,7 +2513,6 @@ scan_libraries (prog_name)
void (*quit_handler) PARAMS ((int));
char *real_ldd_argv[4];
const char **ldd_argv = (const char **) real_ldd_argv;
- int pid;
int argc = 0;
int pipe_fd[2];
char buf[1024];
@@ -2647,7 +2645,7 @@ scan_libraries (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
@@ -2660,14 +2658,26 @@ scan_libraries (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