/* Collect static initialization info into data structures that can be
traversed by C++ initialization and finalization routines.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000 Free Software Foundation, Inc.
+ 1999, 2000, 2001 Free Software Foundation, Inc.
Contributed by Chris Smith (csmith@convex.com).
Heavily modified by Michael Meissner (meissner@cygnus.com),
Per Bothner (bothner@cygnus.com), and John Gilmore (gnu@cygnus.com).
#include "config.h"
#include "system.h"
#include <signal.h>
+#if ! defined( SIGCHLD ) && defined( SIGCLD )
+# define SIGCHLD SIGCLD
+#endif
#ifdef vfork /* Autoconf may define this to fork for us. */
# define VFORK_STRING "fork"
FILE *outf;
#ifdef COLLECT_EXPORT_LIST
FILE *exportf;
- FILE *importf;
#endif
const char *ld_file_name;
const char *p;
COLLECT2_HOST_INITIALIZATION;
#endif
+#ifdef SIGCHLD
+ /* We *MUST* set SIGCHLD to SIG_DFL so that the wait4() call will
+ receive the signal. A different setting is inheritable */
+ signal (SIGCHLD, SIG_DFL);
+#endif
+
/* LC_CTYPE determines the character set used by the terminal so it has be set
to output messages correctly. */
}
else if ((p = strrchr (arg, '.')) != (char *) 0
&& (strcmp (p, ".o") == 0 || strcmp (p, ".a") == 0
- || strcmp (p, ".so") == 0 || strcmp (p, ".lo") == 0))
+ || strcmp (p, ".so") == 0 || strcmp (p, ".lo") == 0
+ || strcmp (p, ".obj") == 0))
{
if (first_file)
{
#ifdef OBJECT_FORMAT_COFF
#if defined(EXTENDED_COFF)
+
# define GCC_SYMBOLS(X) (SYMHEADER(X).isymMax + SYMHEADER(X).iextMax)
# define GCC_SYMENT SYMR
# define GCC_OK_SYMBOL(X) ((X).st == stProc || (X).st == stGlobal)
# define GCC_SYMINC(X) (1)
# define GCC_SYMZERO(X) (SYMHEADER(X).isymMax)
# define GCC_CHECK_HDR(X) (PSYMTAB(X) != 0)
+
#else
+
# 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))
# define GCC_SYMINC(X) ((X).n_numaux+1)
# define GCC_SYMZERO(X) 0
+
+/* 0757 = U803XTOCMAGIC (AIX 4.3) and 0767 = U64_TOCMAGIC (AIX V5) */
+#ifdef _AIX51
+# define GCC_CHECK_HDR(X) \
+ ((HEADER (X).f_magic == U802TOCMAGIC && ! aix64_flag) \
+ || (HEADER (X).f_magic == 0767 && aix64_flag))
+#else
# define GCC_CHECK_HDR(X) \
((HEADER (X).f_magic == U802TOCMAGIC && ! aix64_flag) \
|| (HEADER (X).f_magic == 0757 && aix64_flag))
#endif
-extern char *ldgetname PARAMS ((LDFILE *, GCC_SYMENT *));
-extern int ldtbread PARAMS ((LDFILE *, long, GCC_SYMENT *));
-extern int ldclose PARAMS ((LDFILE *));
+#endif
+
+extern char *ldgetname ();
/* COFF version to scan the name list of the loaded program for
the symbols g++ uses for static constructors and destructors.
static const char *aix_std_libs[] = {
"/unix",
"/lib/libc.a",
+ "/lib/libm.a",
"/lib/libc_r.a",
+ "/lib/libm_r.a",
"/usr/lib/libc.a",
+ "/usr/lib/libm.a",
"/usr/lib/libc_r.a",
+ "/usr/lib/libm_r.a",
"/usr/lib/threads/libc.a",
"/usr/ccs/lib/libc.a",
+ "/usr/ccs/lib/libm.a",
"/usr/ccs/lib/libc_r.a",
+ "/usr/ccs/lib/libm_r.a",
NULL
};