aboutsummaryrefslogtreecommitdiff
path: root/gcc/collect2.c
diff options
context:
space:
mode:
authorDavid Edelsohn <dje@gcc.gnu.org>2000-01-07 13:33:12 -0500
committerDavid Edelsohn <dje@gcc.gnu.org>2000-01-07 13:33:12 -0500
commitc71791e01ea3b0fecdbf429548fbea38e0f3b5e1 (patch)
tree1d0f42ae5da15ff4a9963d5d8d5609986e2fd53e /gcc/collect2.c
parentf6cad4c9e950e2985565e7d0ca6bc2eb6af2c776 (diff)
downloadgcc-c71791e01ea3b0fecdbf429548fbea38e0f3b5e1.zip
gcc-c71791e01ea3b0fecdbf429548fbea38e0f3b5e1.tar.gz
gcc-c71791e01ea3b0fecdbf429548fbea38e0f3b5e1.tar.bz2
rs6000.c (processor_target_table): Add power3 as alias for 630.
* rs6000.c (processor_target_table): Add power3 as alias for 630. * aix43.h: Revert Aug 2 change. (HAS_INIT_SECTION): Define, not visible yet. (LD_INIT_SWITCH): Define, not visible yet. * t-aix43 (MULTILIB_OPTIONS): Revert Aug 2 change. * glimits.h (__LONG_MAX__): Recognize 64-bit AIX too. * collect2.c (main): Expand ld2 size further. (export_object_lst): Cast assignment to avoid warning. (main, LD_INIT_SWITCH): Add AIX 4.2+ -binitfini support. (scan_prog_file, COFF): Do not collect initialization or finalization functions generated for entire shared object if init/fini support present. From-SVN: r31275
Diffstat (limited to 'gcc/collect2.c')
-rw-r--r--gcc/collect2.c30
1 files changed, 23 insertions, 7 deletions
diff --git a/gcc/collect2.c b/gcc/collect2.c
index bfab130..2fe3800 100644
--- a/gcc/collect2.c
+++ b/gcc/collect2.c
@@ -884,7 +884,7 @@ main (argc, argv)
set first, in case a diagnostic is issued. */
ld1 = (const char **)(ld1_argv = (char **) xcalloc(sizeof (char *), argc+3));
- ld2 = (const char **)(ld2_argv = (char **) xcalloc(sizeof (char *), argc+6));
+ ld2 = (const char **)(ld2_argv = (char **) xcalloc(sizeof (char *), argc+10));
object = (const char **)(object_lst = (char **) xcalloc(sizeof (char *), argc));
#ifdef DEBUG
@@ -1263,7 +1263,7 @@ main (argc, argv)
/* The AIX linker will discard static constructors in object files if
nothing else in the file is referenced, so look at them first. */
{
- char **export_object_lst = object_lst;
+ const char **export_object_lst = (const char **)object_lst;
while (export_object_lst < object)
scan_prog_file (*export_object_lst++, PASS_OBJ);
@@ -1462,11 +1462,21 @@ main (argc, argv)
/* Tell the linker that we have initializer and finalizer functions. */
#ifdef LD_INIT_SWITCH
+#ifdef COLLECT_EXPORT_LIST
+ {
+ /* option name + functions + colons + NULL */
+ char *buf = xmalloc (strlen (LD_INIT_SWITCH)
+ + strlen(initname) + strlen(fininame) + 3);
+ sprintf (buf, "%s:%s:%s", LD_INIT_SWITCH, initname, fininame);
+ *ld2++ = buf;
+ }
+#else
*ld2++ = LD_INIT_SWITCH;
*ld2++ = initname;
*ld2++ = LD_FINI_SWITCH;
*ld2++ = fininame;
#endif
+#endif
#ifdef COLLECT_EXPORT_LIST
if (shared_obj)
@@ -2786,7 +2796,8 @@ scan_prog_file (prog_name, which_pass)
switch (is_ctor_dtor (name))
{
case 1:
- if (! is_shared) add_to_list (&constructors, name);
+ if (! is_shared)
+ add_to_list (&constructors, name);
#ifdef COLLECT_EXPORT_LIST
if (which_pass == PASS_OBJ)
add_to_list (&exports, name);
@@ -2801,7 +2812,8 @@ scan_prog_file (prog_name, which_pass)
break;
case 2:
- if (! is_shared) add_to_list (&destructors, name);
+ if (! is_shared)
+ add_to_list (&destructors, name);
#ifdef COLLECT_EXPORT_LIST
if (which_pass == PASS_OBJ)
add_to_list (&exports, name);
@@ -2817,13 +2829,17 @@ scan_prog_file (prog_name, which_pass)
#ifdef COLLECT_EXPORT_LIST
case 3:
+#ifndef LD_INIT_SWITCH
if (is_shared)
add_to_list (&constructors, name);
+#endif
break;
case 4:
+#ifndef LD_INIT_SWITCH
if (is_shared)
add_to_list (&destructors, name);
+#endif
break;
#endif
@@ -2841,7 +2857,8 @@ scan_prog_file (prog_name, which_pass)
{
if (which_pass == PASS_OBJ && (! export_flag))
add_to_list (&exports, name);
- else if (! is_shared && which_pass == PASS_FIRST
+ else if (! is_shared
+ && which_pass == PASS_FIRST
&& import_flag
&& is_in_list(name, undefined.first))
add_to_list (&imports, name);
@@ -2850,14 +2867,13 @@ scan_prog_file (prog_name, which_pass)
continue;
}
-#if !defined(EXTENDED_COFF)
if (debug)
+#if !defined(EXTENDED_COFF)
fprintf (stderr, "\tsec=%d class=%d type=%s%o %s\n",
symbol.n_scnum, symbol.n_sclass,
(symbol.n_type ? "0" : ""), symbol.n_type,
name);
#else
- if (debug)
fprintf (stderr,
"\tiss = %5d, value = %5ld, index = %5d, name = %s\n",
symbol.iss, (long) symbol.value, symbol.index, name);