diff options
-rw-r--r-- | gcc/ChangeLog | 38 | ||||
-rw-r--r-- | gcc/config/rs6000/eabi-ci.asm | 12 | ||||
-rw-r--r-- | gcc/config/rs6000/eabi-cn.asm | 8 | ||||
-rw-r--r-- | gcc/config/rs6000/eabi-ctors.c | 104 | ||||
-rw-r--r-- | gcc/config/rs6000/eabi.asm | 4 | ||||
-rw-r--r-- | gcc/config/rs6000/linux.h | 15 | ||||
-rw-r--r-- | gcc/config/rs6000/sysv4.h | 55 | ||||
-rw-r--r-- | gcc/config/rs6000/t-ppccomm | 10 | ||||
-rw-r--r-- | gcc/po/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/po/POTFILES.in | 1 |
10 files changed, 95 insertions, 157 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ff72913193d..041abc3fff6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,41 @@ +2000-04-14 Geoff Keating <geoffk@cygnus.com> + + * config/rs6000/sysv4.h (LINK_START_SOLARIS_SPEC): Define to empty + always, use the default SVR4 start address. + + * config/rs6000/linux.h (LINK_SPEC): Don't define. + (LINK_SHLIB_SPEC): Define. + (LINK_START_DEFAULT_SPEC): Define. + (LINK_OS_DEFAULT_SPEC): Define. + + * config/rs6000/sysv4.h (ENDFILE_SPEC): Use the %(endfile_*) macros. + + * config/rs6000/eabi.asm (__eabi): Call __init rather than + __do_global_ctors to handle constructors. + * config/rs6000/sysv4.h (STARTFILE_ADS_SPEC): Use crtbegin. + (STARTFILE_YELLOWKNIFE_SPEC): Likewise. + (STARTFILE_MVME_SPEC): Likewise. + (STARTFILE_SIM_SPEC): Likewise. + (ENDFILE_ADS_SPEC): Use crtend. + (ENDFILE_YELLOWKNIFE_SPEC): Likewise. + (ENDFILE_MVME_SPEC): Likewise. + (ENDFILE_SIM_SPEC): Likewise. + (STARTFILE_SOLARIS_SPEC): Use crtbegin/crtbeginS. + (ENDFILE_SOLARIS_SPEC): Use crtend/crtendS. + (STARTFILE_LINUX_SPEC): Use crtbeginS for shared objects. + (ENDFILE_LINUX_SPEC): Use crtendS for shared objects. + * config/rs6000/t-ppccomm (LIB2FUNCS_EXTRA): Don't build eabi-ctors.o. + (EXTRA_MULTILIB_PARTS): Build crtbeginS/crtendS. + (CRTSTUFF_T_CFLAGS_S): Define. + * config/rs6000/eabi-ctors.c: Delete. + + * config/rs6000/eabi-ci.asm (__init): Align stack to 16-byte + boundary. + (__fini): Likewise. + * config/rs6000/eabi-cn.asm (__init): Allow for 16-byte stack frame. + boundary. + (__fini): Likewise. + Fri Apr 14 16:09:02 2000 Jim Wilson <wilson@cygnus.com> * combine.c (force_to_mode, case LSHIFTRT): Check that shift shift diff --git a/gcc/config/rs6000/eabi-ci.asm b/gcc/config/rs6000/eabi-ci.asm index 40fc98ef566..cec18328261 100644 --- a/gcc/config/rs6000/eabi-ci.asm +++ b/gcc/config/rs6000/eabi-ci.asm @@ -107,18 +107,18 @@ __EXCEPT_START__: .type __EH_FRAME_BEGIN__,@object __EH_FRAME_BEGIN__: -# Head of __init function used for static constructors in Solaris +# Head of __init function used for static constructors .section ".init","ax" .align 2 FUNC_START(__init) - stwu 1,-8(1) + stwu 1,-16(1) mflr 0 - stw 0,12(1) + stw 0,20(1) -# Head of __fini function used for static destructors in Solaris +# Head of __fini function used for static destructors .section ".fini","ax" .align 2 FUNC_START(__fini) - stwu 1,-8(1) + stwu 1,-16(1) mflr 0 - stw 0,12(1) + stw 0,20(1) diff --git a/gcc/config/rs6000/eabi-cn.asm b/gcc/config/rs6000/eabi-cn.asm index d62e2faff92..d75141cb244 100644 --- a/gcc/config/rs6000/eabi-cn.asm +++ b/gcc/config/rs6000/eabi-cn.asm @@ -102,14 +102,14 @@ __EH_FRAME_END__: # Tail of __init used for static constructors in Solaris .section ".init","ax" - lwz 0,12(1) + lwz 0,20(1) mtlr 0 - addi 1,1,8 + addi 1,1,16 blr # Tail of __fini used for static destructors in Solaris .section ".fini","ax" - lwz 0,12(1) + lwz 0,20(1) mtlr 0 - addi 1,1,8 + addi 1,1,16 blr diff --git a/gcc/config/rs6000/eabi-ctors.c b/gcc/config/rs6000/eabi-ctors.c deleted file mode 100644 index 9785a112a6d..00000000000 --- a/gcc/config/rs6000/eabi-ctors.c +++ /dev/null @@ -1,104 +0,0 @@ -/* Stripped down support to run global constructors and destructors on - embedded PowerPC systems. - - Copyright (C) 1995, 2000 Free Software Foundation, Inc. - Contributed by Michael Meissner (meissner@cygnus.com). - -This file is part of GNU CC. - -GNU CC is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU CC is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -/* As a special exception, if you link this library with other files, - some of which are compiled with GCC, to produce an executable, - this library does not by itself cause the resulting executable - to be covered by the GNU General Public License. - This exception does not however invalidate any other reasons why - the executable file might be covered by the GNU General Public License. */ - -#include "tm.h" -#include "defaults.h" -#include <stddef.h> -#include "frame.h" -#include "gbl-ctors.h" - -/* FIXME: This file should share code with all the other - constructor/destructor implementations in crtstuff.c and libgcc2.c. */ - -/* Declare the set of symbols use as begin and end markers for the lists - of global object constructors and global object destructors. */ - -extern func_ptr __CTOR_LIST__[] asm ("__CTOR_LIST__"); -extern func_ptr __CTOR_END__ [] asm ("__CTOR_END__"); -extern func_ptr __DTOR_LIST__[] asm ("__DTOR_LIST__"); -extern func_ptr __DTOR_END__ [] asm ("__DTOR_END__"); -extern unsigned char __EH_FRAME_BEGIN__[] asm ("__EH_FRAME_BEGIN__"); - -extern void __do_global_ctors (void); - -extern void __init (), __fini (); - -void (*__atexit)(func_ptr); - -/* Call all global constructors */ -void -__do_global_ctors (void) -{ - func_ptr *p = __CTOR_END__ - 1; - -#ifdef EH_FRAME_SECTION - { - static struct object object; - __register_frame_info (__EH_FRAME_BEGIN__, &object); - } -#endif - - /* Call the constructors collected in the .ctors section. */ - for ( ; p >= __CTOR_LIST__; p--) - if (*p) - (*p)(); - - if (__atexit) - __atexit (__do_global_dtors); - - /* Call the initialization function in the .init section. */ - __init (); -} - -/* Call all global destructors */ -void -__do_global_dtors (void) -{ - static func_ptr *p = __DTOR_LIST__ + 1; - static int completed = 0; - - if (completed) - return; - - /* Call the termination function in the .fini section. */ - __fini (); - - while (p < __DTOR_END__) - { - p++; - (*(p-1)) (); - } - -#ifdef EH_FRAME_SECTION_ASM_OP - if (__deregister_frame_info) - __deregister_frame_info (__EH_FRAME_BEGIN__); -#endif - completed = 1; -} diff --git a/gcc/config/rs6000/eabi.asm b/gcc/config/rs6000/eabi.asm index 252f8fe266a..108328e7134 100644 --- a/gcc/config/rs6000/eabi.asm +++ b/gcc/config/rs6000/eabi.asm @@ -1,7 +1,7 @@ /* * special support for eabi * - * Copyright (C) 1995, 1996, 1998 Free Software Foundation, Inc. + * Copyright (C) 1995, 1996, 1998, 2000 Free Software Foundation, Inc. * Written By Michael Meissner * * This file is free software; you can redistribute it and/or modify it @@ -228,7 +228,7 @@ FUNC_START(__eabi) /* Done adjusting pointers, return by way of doing the C++ global constructors. */ .Ldone: - b FUNC_NAME(__do_global_ctors) /* do any C++ global constructors (which returns to caller) */ + b FUNC_NAME(__init) /* do any C++ global constructors (which returns to caller) */ FUNC_END(__eabi) /* Special subroutine to convert a bunch of pointers directly. diff --git a/gcc/config/rs6000/linux.h b/gcc/config/rs6000/linux.h index ffa78ae4359..a28a8bdfdd5 100644 --- a/gcc/config/rs6000/linux.h +++ b/gcc/config/rs6000/linux.h @@ -33,13 +33,8 @@ Boston, MA 02111-1307, USA. */ #undef CPP_OS_DEFAULT_SPEC #define CPP_OS_DEFAULT_SPEC "%(cpp_os_linux)" -#undef LINK_SPEC -#define LINK_SPEC "-m elf32ppclinux %{G*} %{shared:-shared} \ - %{!shared: \ - %{!static: \ - %{rdynamic:-export-dynamic} \ - %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \ - %{static:-static}}" +#undef LINK_SHLIB_SPEC +#define LINK_SHLIB_SPEC "%{shared:-shared} %{!shared: %{static:-static}}" #undef LIB_DEFAULT_SPEC #define LIB_DEFAULT_SPEC "%(lib_linux)" @@ -50,6 +45,12 @@ Boston, MA 02111-1307, USA. */ #undef ENDFILE_DEFAULT_SPEC #define ENDFILE_DEFAULT_SPEC "%(endfile_linux)" +#undef LINK_START_DEFAULT_SPEC +#define LINK_START_DEFAULT_SPEC "%(link_start_linux)" + +#undef LINK_OS_DEFAULT_SPEC +#define LINK_OS_DEFAULT_SPEC "%(link_os_linux)" + #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (PowerPC GNU/Linux)"); diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h index f87f7aef32b..33222ad6822 100644 --- a/gcc/config/rs6000/sysv4.h +++ b/gcc/config/rs6000/sysv4.h @@ -1082,7 +1082,7 @@ do { \ %{Wl,*:%*} %{YP,*} %{R*} \ %{Qy:} %{!Qn:-Qy} \ %(link_shlib) \ -%{!Ttext*: %(link_start) } \ +%{!Wl,-T*: %{!T*: %(link_start) }} \ %(link_target) \ %(link_os)" @@ -1218,12 +1218,12 @@ do { \ /* Override svr4.h definition. */ #undef ENDFILE_SPEC #define ENDFILE_SPEC "\ -%{mads: ecrtn.o%s} \ -%{myellowknife: ecrtn.o%s} \ -%{mmvme: ecrtn.o%s} \ -%{msim: ecrtn.o%s} \ +%{mads: %(endfile_ads)} \ +%{myellowknife: %(endfile_yellowknife)} \ +%{mmvme: %(endfile_mvme)} \ +%{msim: %(endfile_sim)} \ %{mcall-linux: %(endfile_linux) } \ -%{mcall-solaris: scrtn.o%s} \ +%{mcall-solaris: %(endfile_solaris)} \ %{mvxworks: %(endfile_vxworks) } \ %{!mads: %{!myellowknife: %{!mmvme: %{!msim: %{!mcall-linux: %{!mcall-solaris: %{!mvxworks: %(endfile_default) }}}}}}}" @@ -1232,9 +1232,9 @@ do { \ /* Motorola ADS support. */ #define LIB_ADS_SPEC "--start-group -lads -lc --end-group" -#define STARTFILE_ADS_SPEC "ecrti.o%s crt0.o%s" +#define STARTFILE_ADS_SPEC "ecrti.o%s crt0.o%s crtbegin.o%s" -#define ENDFILE_ADS_SPEC "ecrtn.o%s" +#define ENDFILE_ADS_SPEC "crtend.o%s ecrtn.o%s" #define LINK_START_ADS_SPEC "-T ads.ld%s" @@ -1245,9 +1245,9 @@ do { \ /* Motorola Yellowknife support. */ #define LIB_YELLOWKNIFE_SPEC "--start-group -lyk -lc --end-group" -#define STARTFILE_YELLOWKNIFE_SPEC "ecrti.o%s crt0.o%s" +#define STARTFILE_YELLOWKNIFE_SPEC "ecrti.o%s crt0.o%s crtbegin.o%s" -#define ENDFILE_YELLOWKNIFE_SPEC "ecrtn.o%s" +#define ENDFILE_YELLOWKNIFE_SPEC "crtend.o%s ecrtn.o%s" #define LINK_START_YELLOWKNIFE_SPEC "-T yellowknife.ld%s" @@ -1258,11 +1258,11 @@ do { \ /* Motorola MVME support. */ #define LIB_MVME_SPEC "--start-group -lmvme -lc --end-group" -#define STARTFILE_MVME_SPEC "ecrti.o%s crt0.o%s" +#define STARTFILE_MVME_SPEC "ecrti.o%s crt0.o%s crtbegin.o%s" -#define ENDFILE_MVME_SPEC "ecrtn.o%s" +#define ENDFILE_MVME_SPEC "crtend.o%s ecrtn.o%s" -#define LINK_START_MVME_SPEC "%{!Wl,-T*: %{!T*: -Ttext 0x40000}}" +#define LINK_START_MVME_SPEC "-Ttext 0x40000" #define LINK_OS_MVME_SPEC "" @@ -1271,13 +1271,13 @@ do { \ /* PowerPC simulator based on netbsd system calls support. */ #define LIB_SIM_SPEC "--start-group -lsim -lc --end-group" -#define STARTFILE_SIM_SPEC "ecrti.o%s sim-crt0.o%s" +#define STARTFILE_SIM_SPEC "ecrti.o%s sim-crt0.o%s crtbegin.o%s" -#define ENDFILE_SIM_SPEC "ecrtn.o%s" +#define ENDFILE_SIM_SPEC "crtend.o%s ecrtn.o%s" -#define LINK_START_SIM_SPEC "-Ttext 0x10000074" +#define LINK_START_SIM_SPEC "" -#define LINK_OS_SIM_SPEC "" +#define LINK_OS_SIM_SPEC "-m elf32ppcsim" #define CPP_OS_SIM_SPEC "" @@ -1294,15 +1294,16 @@ do { \ #define STARTFILE_LINUX_SPEC "\ %{!shared: %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} %{!p:crt1.o%s}}} \ %{mnewlib: ecrti.o%s} %{!mnewlib: crti.o%s} \ -crtbegin.o%s" +%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}" -#define ENDFILE_LINUX_SPEC "crtend.o%s \ -%{mnewlib: ecrtn.o%s} \ -%{!mnewlib: crtn.o%s}" +#define ENDFILE_LINUX_SPEC "%{!shared:crtend.o%s} %{shared:crtendS.o%s} \ +%{mnewlib: ecrtn.o%s} %{!mnewlib: crtn.o%s}" -#define LINK_START_LINUX_SPEC "-Ttext 0x400074" +#define LINK_START_LINUX_SPEC "" -#define LINK_OS_LINUX_SPEC "" +#define LINK_OS_LINUX_SPEC "-m elf32ppclinux %{!shared: %{!static: \ + %{rdynamic:-export-dynamic} \ + %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}" #ifdef USE_GNULIBC_1 #define CPP_OS_LINUX_SPEC "-D__unix__ -D__linux__ \ @@ -1339,17 +1340,15 @@ crtbegin.o%s" #define STARTFILE_SOLARIS_SPEC "\ %{!msolaris-cclib: scrti.o%s scrt0.o%s} \ -%{msolaris-cclib: /opt/SUNWspro/SC4.0/lib/crti.o%s /opt/SUNWspro/SC4.0/lib/crt1.o%s}" +%{msolaris-cclib: /opt/SUNWspro/SC4.0/lib/crti.o%s /opt/SUNWspro/SC4.0/lib/crt1.o%s} \ +%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}" #define ENDFILE_SOLARIS_SPEC "\ +%{!shared:crtend.o%s} %{shared:crtendS.o%s} \ %{!msolaris-cclib: scrtn.o%s} \ %{msolaris-cclib: /opt/SUNWspro/SC4.0/lib/crtn.o%s}" -#ifdef CROSS_COMPILE -#define LINK_START_SOLARIS_SPEC "-Ttext 0x2000074" -#else #define LINK_START_SOLARIS_SPEC "" -#endif #define LINK_OS_SOLARIS_SPEC "" diff --git a/gcc/config/rs6000/t-ppccomm b/gcc/config/rs6000/t-ppccomm index 00fd44b16b8..3a1f106ad21 100644 --- a/gcc/config/rs6000/t-ppccomm +++ b/gcc/config/rs6000/t-ppccomm @@ -6,7 +6,7 @@ CROSS_LIBGCC1 = # These are really part of libgcc1, but this will cause them to be # built correctly, so... [taken from t-sparclite] -LIB2FUNCS_EXTRA = eabi.S eabi-ctors.c tramp.S +LIB2FUNCS_EXTRA = eabi.S tramp.S # We want fine grained libraries, so use the new code to build the # floating point emulation libraries. @@ -24,9 +24,6 @@ fp-bit.c: $(srcdir)/config/fp-bit.c eabi.S: $(srcdir)/config/rs6000/eabi.asm cat $(srcdir)/config/rs6000/eabi.asm > eabi.S -eabi-ctors.c: $(srcdir)/config/rs6000/eabi-ctors.c - cat $(srcdir)/config/rs6000/eabi-ctors.c > eabi-ctors.c - tramp.S: $(srcdir)/config/rs6000/tramp.asm cat $(srcdir)/config/rs6000/tramp.asm > tramp.S @@ -44,6 +41,7 @@ MULTILIB_MATCHES_SYSV = mcall-sysv=mcall-sysv-eabi mcall-sysv=mcall-sysv-noeabi LIBGCC = stmp-multilib INSTALL_LIBGCC = install-multilib EXTRA_MULTILIB_PARTS = crtbegin$(objext) crtend$(objext) \ + crtbeginS$(objext) crtendS$(objext) \ ecrti$(objext) ecrtn$(objext) scrt0$(objext) scrti$(objext) scrtn$(objext) # We build {e,s}crti.o, {e,s}crtn.o, and scrt0.o which serve to add begin and @@ -83,4 +81,6 @@ $(T)scrt0$(objext): scrt0.c # It is important that crtbegin.o, etc., aren't surprised by stuff in .sdata. CRTSTUFF_T_CFLAGS = -msdata=none - +# There is no need to add -fPIC here because crtstuff is multilibbed +# and so automatically gets -fPIC when needed. +CRTSTUFF_T_CFLAGS_S = -msdata=none diff --git a/gcc/po/ChangeLog b/gcc/po/ChangeLog index 3f2787e47a5..68ec053c3ed 100644 --- a/gcc/po/ChangeLog +++ b/gcc/po/ChangeLog @@ -1,5 +1,10 @@ 2000-04-05 Geoff Keating <geoffk@cygnus.com> + * POTFILES.in: Remove config/rs6000/eabi-ctors.c, which was + previously commented out anyway. + +2000-04-05 Geoff Keating <geoffk@cygnus.com> + * POTFILES.in: Update for config/rs6000 changes. Comment out rs6000 files which are not built into GCC. diff --git a/gcc/po/POTFILES.in b/gcc/po/POTFILES.in index 7a8a232a0a4..1e4e63b5f87 100644 --- a/gcc/po/POTFILES.in +++ b/gcc/po/POTFILES.in @@ -451,7 +451,6 @@ config/rs6000/aix3newas.h config/rs6000/aix41.h config/rs6000/aix43.h config/rs6000/beos.h -#config/rs6000/eabi-ctors.c config/rs6000/eabi.h config/rs6000/eabiaix.h config/rs6000/eabisim.h |