Commit c71791e0 by David Edelsohn

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
parent f6cad4c9
2000-01-07 David Edelsohn <edelsohn@gnu.org>
* 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.
2000-01-07 Nick Clifton <nickc@cygnus.com> 2000-01-07 Nick Clifton <nickc@cygnus.com>
* config/elfos.h: Tidy up formatting of marcos. Make sure * config/elfos.h: Tidy up formatting of marcos. Make sure
......
...@@ -884,7 +884,7 @@ main (argc, argv) ...@@ -884,7 +884,7 @@ main (argc, argv)
set first, in case a diagnostic is issued. */ set first, in case a diagnostic is issued. */
ld1 = (const char **)(ld1_argv = (char **) xcalloc(sizeof (char *), argc+3)); 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)); object = (const char **)(object_lst = (char **) xcalloc(sizeof (char *), argc));
#ifdef DEBUG #ifdef DEBUG
...@@ -1263,7 +1263,7 @@ main (argc, argv) ...@@ -1263,7 +1263,7 @@ main (argc, argv)
/* The AIX linker will discard static constructors in object files if /* The AIX linker will discard static constructors in object files if
nothing else in the file is referenced, so look at them first. */ 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) while (export_object_lst < object)
scan_prog_file (*export_object_lst++, PASS_OBJ); scan_prog_file (*export_object_lst++, PASS_OBJ);
...@@ -1462,11 +1462,21 @@ main (argc, argv) ...@@ -1462,11 +1462,21 @@ main (argc, argv)
/* Tell the linker that we have initializer and finalizer functions. */ /* Tell the linker that we have initializer and finalizer functions. */
#ifdef LD_INIT_SWITCH #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++ = LD_INIT_SWITCH;
*ld2++ = initname; *ld2++ = initname;
*ld2++ = LD_FINI_SWITCH; *ld2++ = LD_FINI_SWITCH;
*ld2++ = fininame; *ld2++ = fininame;
#endif #endif
#endif
#ifdef COLLECT_EXPORT_LIST #ifdef COLLECT_EXPORT_LIST
if (shared_obj) if (shared_obj)
...@@ -2786,7 +2796,8 @@ scan_prog_file (prog_name, which_pass) ...@@ -2786,7 +2796,8 @@ scan_prog_file (prog_name, which_pass)
switch (is_ctor_dtor (name)) switch (is_ctor_dtor (name))
{ {
case 1: case 1:
if (! is_shared) add_to_list (&constructors, name); if (! is_shared)
add_to_list (&constructors, name);
#ifdef COLLECT_EXPORT_LIST #ifdef COLLECT_EXPORT_LIST
if (which_pass == PASS_OBJ) if (which_pass == PASS_OBJ)
add_to_list (&exports, name); add_to_list (&exports, name);
...@@ -2801,7 +2812,8 @@ scan_prog_file (prog_name, which_pass) ...@@ -2801,7 +2812,8 @@ scan_prog_file (prog_name, which_pass)
break; break;
case 2: case 2:
if (! is_shared) add_to_list (&destructors, name); if (! is_shared)
add_to_list (&destructors, name);
#ifdef COLLECT_EXPORT_LIST #ifdef COLLECT_EXPORT_LIST
if (which_pass == PASS_OBJ) if (which_pass == PASS_OBJ)
add_to_list (&exports, name); add_to_list (&exports, name);
...@@ -2817,13 +2829,17 @@ scan_prog_file (prog_name, which_pass) ...@@ -2817,13 +2829,17 @@ scan_prog_file (prog_name, which_pass)
#ifdef COLLECT_EXPORT_LIST #ifdef COLLECT_EXPORT_LIST
case 3: case 3:
#ifndef LD_INIT_SWITCH
if (is_shared) if (is_shared)
add_to_list (&constructors, name); add_to_list (&constructors, name);
#endif
break; break;
case 4: case 4:
#ifndef LD_INIT_SWITCH
if (is_shared) if (is_shared)
add_to_list (&destructors, name); add_to_list (&destructors, name);
#endif
break; break;
#endif #endif
...@@ -2841,7 +2857,8 @@ scan_prog_file (prog_name, which_pass) ...@@ -2841,7 +2857,8 @@ scan_prog_file (prog_name, which_pass)
{ {
if (which_pass == PASS_OBJ && (! export_flag)) if (which_pass == PASS_OBJ && (! export_flag))
add_to_list (&exports, name); add_to_list (&exports, name);
else if (! is_shared && which_pass == PASS_FIRST else if (! is_shared
&& which_pass == PASS_FIRST
&& import_flag && import_flag
&& is_in_list(name, undefined.first)) && is_in_list(name, undefined.first))
add_to_list (&imports, name); add_to_list (&imports, name);
...@@ -2850,14 +2867,13 @@ scan_prog_file (prog_name, which_pass) ...@@ -2850,14 +2867,13 @@ scan_prog_file (prog_name, which_pass)
continue; continue;
} }
#if !defined(EXTENDED_COFF)
if (debug) if (debug)
#if !defined(EXTENDED_COFF)
fprintf (stderr, "\tsec=%d class=%d type=%s%o %s\n", fprintf (stderr, "\tsec=%d class=%d type=%s%o %s\n",
symbol.n_scnum, symbol.n_sclass, symbol.n_scnum, symbol.n_sclass,
(symbol.n_type ? "0" : ""), symbol.n_type, (symbol.n_type ? "0" : ""), symbol.n_type,
name); name);
#else #else
if (debug)
fprintf (stderr, fprintf (stderr,
"\tiss = %5d, value = %5ld, index = %5d, name = %s\n", "\tiss = %5d, value = %5ld, index = %5d, name = %s\n",
symbol.iss, (long) symbol.value, symbol.index, name); symbol.iss, (long) symbol.value, symbol.index, name);
......
...@@ -26,8 +26,8 @@ Boston, MA 02111-1307, USA. */ ...@@ -26,8 +26,8 @@ Boston, MA 02111-1307, USA. */
#define TARGET_XL_CALL (target_flags & MASK_XL_CALL) #define TARGET_XL_CALL (target_flags & MASK_XL_CALL)
#undef SUBTARGET_SWITCHES #undef SUBTARGET_SWITCHES
#define SUBTARGET_SWITCHES \ #define SUBTARGET_SWITCHES \
{"64", MASK_64BIT | MASK_POWERPC64 | MASK_POWERPC}, \ {"aix64", MASK_64BIT | MASK_POWERPC64 | MASK_POWERPC}, \
{"32", - (MASK_64BIT | MASK_POWERPC64)}, \ {"aix32", - (MASK_64BIT | MASK_POWERPC64)}, \
{"xl-call", MASK_XL_CALL}, \ {"xl-call", MASK_XL_CALL}, \
{"no-xl-call", - MASK_XL_CALL}, \ {"no-xl-call", - MASK_XL_CALL}, \
{"threads", 0}, \ {"threads", 0}, \
...@@ -48,25 +48,25 @@ do { \ ...@@ -48,25 +48,25 @@ do { \
if (TARGET_64BIT && (target_flags & NON_POWERPC_MASKS)) \ if (TARGET_64BIT && (target_flags & NON_POWERPC_MASKS)) \
{ \ { \
target_flags &= ~NON_POWERPC_MASKS; \ target_flags &= ~NON_POWERPC_MASKS; \
warning ("-m64 and POWER architecture are incompatible."); \ warning ("-maix64 and POWER architecture are incompatible."); \
} \ } \
if (TARGET_64BIT && ! (target_flags & MASK_POWERPC64)) \ if (TARGET_64BIT && ! (target_flags & MASK_POWERPC64)) \
{ \ { \
target_flags |= MASK_POWERPC64; \ target_flags |= MASK_POWERPC64; \
warning ("-m64 requires PowerPC64 architecture remain enabled."); \ warning ("-maix64 requires PowerPC64 architecture remain enabled."); \
} \ } \
} while (0); } while (0);
#include "rs6000/rs6000.h" #include "rs6000/rs6000.h"
#undef ASM_SPEC #undef ASM_SPEC
#define ASM_SPEC "-u %{m64:-a64 -mppc64} %(asm_cpu)" #define ASM_SPEC "-u %{maix64:-a64 -mppc64} %(asm_cpu)"
/* Common ASM definitions used by ASM_SPEC amonst the various targets /* Common ASM definitions used by ASM_SPEC amonst the various targets
for handling -mcpu=xxx switches. */ for handling -mcpu=xxx switches. */
#undef ASM_CPU_SPEC #undef ASM_CPU_SPEC
#define ASM_CPU_SPEC \ #define ASM_CPU_SPEC \
"%{!mcpu*: %{!m64: \ "%{!mcpu*: %{!maix64: \
%{mpower: %{!mpower2: -mpwr}} \ %{mpower: %{!mpower2: -mpwr}} \
%{mpower2: -mpwr2} \ %{mpower2: -mpwr2} \
%{mpowerpc*: %{!mpowerpc64: -mppc}} \ %{mpowerpc*: %{!mpowerpc64: -mppc}} \
...@@ -104,7 +104,7 @@ do { \ ...@@ -104,7 +104,7 @@ do { \
#undef CPP_SPEC #undef CPP_SPEC
#define CPP_SPEC "%{posix: -D_POSIX_SOURCE}\ #define CPP_SPEC "%{posix: -D_POSIX_SOURCE}\
%{m64: -D__64BIT__ -D_ARCH_PPC}\ %{maix64: -D__64BIT__ -D_ARCH_PPC}\
%{mpe: -I/usr/lpp/ppe.poe/include}\ %{mpe: -I/usr/lpp/ppe.poe/include}\
%{mthreads: -D_THREAD_SAFE}\ %{mthreads: -D_THREAD_SAFE}\
%(cpp_cpu)" %(cpp_cpu)"
...@@ -113,7 +113,7 @@ do { \ ...@@ -113,7 +113,7 @@ do { \
for handling -mcpu=xxx switches. */ for handling -mcpu=xxx switches. */
#undef CPP_CPU_SPEC #undef CPP_CPU_SPEC
#define CPP_CPU_SPEC \ #define CPP_CPU_SPEC \
"%{!mcpu*: %{!m64: \ "%{!mcpu*: %{!maix64: \
%{mpower: %{!mpower2: -D_ARCH_PWR}} \ %{mpower: %{!mpower2: -D_ARCH_PWR}} \
%{mpower2: -D_ARCH_PWR2} \ %{mpower2: -D_ARCH_PWR2} \
%{mpowerpc*: -D_ARCH_PPC} \ %{mpowerpc*: -D_ARCH_PPC} \
...@@ -182,15 +182,15 @@ do { \ ...@@ -182,15 +182,15 @@ do { \
#undef LIB_SPEC #undef LIB_SPEC
#define LIB_SPEC "%{pg:-L/lib/profiled -L/usr/lib/profiled}\ #define LIB_SPEC "%{pg:-L/lib/profiled -L/usr/lib/profiled}\
%{p:-L/lib/profiled -L/usr/lib/profiled}\ %{p:-L/lib/profiled -L/usr/lib/profiled}\
%{!m64:%{!shared:%{g*:-lg}}}\ %{!maix64:%{!shared:%{g*:-lg}}}\
%{mpe:-L/usr/lpp/ppe.poe/lib -lmpi -lvtd}\ %{mpe:-L/usr/lpp/ppe.poe/lib -lmpi -lvtd}\
%{mthreads:-L/usr/lib/threads -lpthreads -lc_r /usr/lib/libc.a}\ %{mthreads:-L/usr/lib/threads -lpthreads -lc_r /usr/lib/libc.a}\
%{!mthreads:-lc}" %{!mthreads:-lc}"
#undef LINK_SPEC #undef LINK_SPEC
#define LINK_SPEC "-bpT:0x10000000 -bpD:0x20000000 %{!r:-btextro} -bnodelcsect\ #define LINK_SPEC "-bpT:0x10000000 -bpD:0x20000000 %{!r:-btextro} -bnodelcsect\
%{static:-bnso %(link_syscalls) } %{!m64:%{!shared:%{g*: %(link_libg) }}}\ %{static:-bnso %(link_syscalls) } %{shared:-bM:SRE %{!e:-bnoentry}}\
%{shared:-bM:SRE %{!e:-bnoentry}} %{m64:-b64}" %{!maix64:%{!shared:%{g*: %(link_libg) }}} %{maix64:-b64}"
#undef STARTFILE_SPEC #undef STARTFILE_SPEC
#define STARTFILE_SPEC "%{!shared:\ #define STARTFILE_SPEC "%{!shared:\
...@@ -198,8 +198,8 @@ do { \ ...@@ -198,8 +198,8 @@ do { \
%{!pg:%{p:/usr/lpp/ppe.poe/lib/mcrt0.o}\ %{!pg:%{p:/usr/lpp/ppe.poe/lib/mcrt0.o}\
%{!p:/usr/lpp/ppe.poe/lib/crt0.o}}}\ %{!p:/usr/lpp/ppe.poe/lib/crt0.o}}}\
%{!mpe:\ %{!mpe:\
%{m64:%{pg:gcrt0_64%O%s}%{!pg:%{p:mcrt0_64%O%s}%{!p:crt0_64%O%s}}}\ %{maix64:%{pg:gcrt0_64%O%s}%{!pg:%{p:mcrt0_64%O%s}%{!p:crt0_64%O%s}}}\
%{!m64:\ %{!maix64:\
%{mthreads:%{pg:gcrt0_r%O%s}%{!pg:%{p:mcrt0_r%O%s}%{!p:crt0_r%O%s}}}\ %{mthreads:%{pg:gcrt0_r%O%s}%{!pg:%{p:mcrt0_r%O%s}%{!p:crt0_r%O%s}}}\
%{!mthreads:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}}}}}}" %{!mthreads:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}}}}}}"
...@@ -213,3 +213,13 @@ do { \ ...@@ -213,3 +213,13 @@ do { \
#undef RS6000_CALL_GLUE #undef RS6000_CALL_GLUE
#define RS6000_CALL_GLUE "{cror 31,31,31|nop}" #define RS6000_CALL_GLUE "{cror 31,31,31|nop}"
#if 0
/* AIX 4.2 and above provides initialization and finalization function
support from linker command line. */
#undef HAS_INIT_SECTION
#define HAS_INIT_SECTION
#undef LD_INIT_SWITCH
#define LD_INIT_SWITCH "-binitfini"
#endif
...@@ -185,6 +185,9 @@ rs6000_override_options (default_cpu) ...@@ -185,6 +185,9 @@ rs6000_override_options (default_cpu)
{"power2", PROCESSOR_POWER, {"power2", PROCESSOR_POWER,
MASK_POWER | MASK_POWER2 | MASK_MULTIPLE | MASK_STRING, MASK_POWER | MASK_POWER2 | MASK_MULTIPLE | MASK_STRING,
POWERPC_MASKS | MASK_NEW_MNEMONICS}, POWERPC_MASKS | MASK_NEW_MNEMONICS},
{"power3", PROCESSOR_PPC630,
MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS,
POWER_MASKS | MASK_PPC_GPOPT},
{"powerpc", PROCESSOR_POWERPC, {"powerpc", PROCESSOR_POWERPC,
MASK_POWERPC | MASK_NEW_MNEMONICS, MASK_POWERPC | MASK_NEW_MNEMONICS,
POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64}, POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64},
......
...@@ -18,7 +18,7 @@ fp-bit.c: $(srcdir)/config/fp-bit.c ...@@ -18,7 +18,7 @@ fp-bit.c: $(srcdir)/config/fp-bit.c
# different processor models # different processor models
MULTILIB_OPTIONS = msoft-float \ MULTILIB_OPTIONS = msoft-float \
mcpu=common/mcpu=power/mcpu=powerpc/m64 mcpu=common/mcpu=power/mcpu=powerpc/maix64
MULTILIB_DIRNAMES = soft-float \ MULTILIB_DIRNAMES = soft-float \
common power powerpc ppc64 common power powerpc ppc64
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
/* Minimum and maximum values a `signed long int' can hold. /* Minimum and maximum values a `signed long int' can hold.
(Same as `int'). */ (Same as `int'). */
#ifndef __LONG_MAX__ #ifndef __LONG_MAX__
#if defined (__alpha__) || (defined (__sparc__) && defined(__arch64__)) || defined (__sparcv9) #if defined (__alpha__) || (defined (_ARCH_PPC) && defined (__64BIT__)) || (defined (__sparc__) && defined(__arch64__)) || defined (__sparcv9)
#define __LONG_MAX__ 9223372036854775807L #define __LONG_MAX__ 9223372036854775807L
#else #else
#define __LONG_MAX__ 2147483647L #define __LONG_MAX__ 2147483647L
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment