This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: CFT: [build] Move crtstuff support to toplevel libgcc


Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:

> The next patch in the series moves crtstuff.c, extra_parts, EXTRA_PARTS,
> EXTRA_MULTILIB_PARTS and referenced files to libgcc.  This will avoid
> errors due to inconsistencies in extra_parts between gcc and libgcc in
> the future.
>
> Much of this is pretty mechanical, but given that I cannot test most of
> the platforms, there are likely to be mistakes in the process.

Given Joseph's approval, I'm about to check in the following rebased
version of the patch, after regtesting on i386-pc-solaris2.11,
sparc-sun-solaris2.11, x86_64-unknown-linux-gnu, i386-apple-darwin9.8.0,
and powerpc-apple-darwin9.8.0.

	Rainer


2011-07-15  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	gcc:
	* config.gcc (extra_parts): Remove.
	(*-*-freebsd*): Remove extra_parts.
	(*-*-linux*, frv-*-*linux*, *-*-kfreebsd*-gnu, *-*-knetbsd*-gnu,
	*-*-gnu*, *-*-kopensolaris*-gnu): Likewise.
	(*-*-netbsd*): Remove t-libc-ok, t-netbsd from tmake_file.
	Remove extra_parts for *-*-netbsd*1.[7-9]*, *-*-netbsd[2-9]*,
	*-*-netbsdelf[2-9]*.
	(*-*-openbsd*): Remove t-libc-ok from tmake_file.
	(alpha*-*-linux*): Remove extra_parts.
	(alpha*-*-freebsd*): Likewise.
	(bfin*-linux-uclibc*): Likewise.
	(fr30-*-elf): Likewise.
	(moxie-*-elf): Likewise.
	(moxie-*-uclinux*): Likewise.
	(h8300-*-rtems*): Remove h8300/t-elf from tmake_file.
	(h8300-*-elf*): Likewise.
	(hppa*64*-*-hpux11*): Remove extra_parts.
	(i[34567]86-*-elf*): Remove i386/t-i386elf, i386/t-crtstuff from
	tmake_file.
	(x86_64-*-elf*): Likewise.
	(i[34567]86-*-freebsd*): Remove tmake_file.
	(x86_64-*-freebsd*): Likewise.
	(x86_64-*-netbsd*): Likewise.
	(i[34567]86-*-openbsd2.*, i[34567]86-*openbsd3.[0123]): Remove
	t-libc-ok from tmake_file.
	(i[34567]86-*-linux*, i[34567]86-*-kfreebsd*-gnu,
	i[34567]86-*-knetbsd*-gnu, i[34567]86-*-gnu*,
	i[34567]86-*-kopensolaris*-gnu): Remove i386/t-crtstuff from tmake_file.
	Remove extra_parts.
	(x86_64-*-linux*, x86_64-*-kfreebsd*-gnu, x86_64-*-knetbsd*-gnu):
	Remove i386/t-crtstuff from tmake_file.
	(i[34567]86-*-lynxos*): Likewise.
	Remove extra_parts.
	(ia64*-*-elf*): Remove extra_parts.
	(ia64*-*-freebsd*): Likewise.
	(ia64*-*-linux*): Likewise.
	(ia64-hp-*vms*): Remove ia64/t-vms from tmake_file.
	(m32r-*-elf*): Remove extra_parts.
	(m32rle-*-elf*): Likewise.
	(m32r-*-rtems*): Likewise.
	(m68k-*-elf*, fido-*-elf*): Likewise.
	(m68k*-*-openbsd*): Remove t-libc-ok from tmake_file.
	(m68k-*-rtems*): Remove extra_parts.
	(mep-*-*): Likewise.
	(microblaze*-linux*): Likewise.
	(mips64*-*-linux*, mipsisa64*-*-linux*): Likewise.
	(mips*-*-linux*): Likewise.
	(powerpc-*-lynxos*): Likewise.
	(s390x-ibm-tpf*): Likewise.
	(score-*-elf): Likewise.
	Remove tmake_file.
	(sh-*-elf*, sh[12346l]*-*-elf*, sh-*-linux*, sh[2346lbe]*-*-linux*,
	sh-*-netbsdelf*, shl*-*-netbsdelf*, sh5-*-netbsd*, sh5l*-*-netbsd*,
	sh64-*-netbsd*, sh64l*-*-netbsd*): Remove sh/t-elf from tmake_file.
	Remove sh/t-superh from tmake_file for sh*-superh-elf.
	Remove sh/t-linux64 from tmake_file for sh64*-*-linux*.
	(sh-*-rtems*): Remove sh/t-elf from tmake_file.
	(sh-wrs-vxworks): Likewise.
	(sparc-*-linux*): Remove extra_parts.
	(sparc64-*-linux*): Likewise.
	(sparc64-*-freebsd*, ultrasparc-*-freebsd*): Likewise.
	(xstormy16-*-elf): Likewise.
	(xtensa*-*-linux*): Remove xtensa/t-linux from tmake_file.
	(am33_2.0-*-linux*): Remove extra_parts.
	* configure.ac (extra_parts): Don't substitute.
	* configure: Regenerate.
	* crtstuff.c: Move to ../libgcc.
	* Makefile.in (CRTSTUFF_CFLAGS): Remove.
	(EXTRA_PARTS): Remove.
	(CRTSTUFF_T_CFLAGS): Remove.
	(MOSTLYCLEANFILES): Remove $(EXTRA_PARTS).
	(GCC_EXTRA_PARTS): Remove.
	(libgcc.mvars): Remove GCC_EXTRA_PARTS, CRTSTUFF_CFLAGS,
	CRTSTUFF_T_CFLAGS, CRTSTUFF_T_CFLAGS_S.
	Emit GCC_CFLAGS, INHIBIT_LIBC_CFLAGS.
	($(T)crtbegin.o, $(T)crtend.o, $(T)crtbeginS.o, $(T)crtendS.o)
	($(T)crtbeginT.o): Remove.
	* config/alpha/t-vms (EXTRA_PARTS): Remove.
	($(T)vms-dwarf2.o, $(T)vms-dwarf2eh.o): Remove.
	* config/alpha/vms-dwarf2.asm: Move to
	../libgcc/config/alpha/vms-dwarf2.S.
	* config/alpha/vms-dwarf2eh.asm: Move to
	../libgcc/config/alpha/vms-dwarf2eh.S.
	* config/arm/crti.asm: Move to ../libgcc/config/arm/crti.S.
	* config/arm/crtn.asm: Move to ../libgcc/config/arm/crtn.S.
	* config/arm/t-arm-elf (EXTRA_MULTILIB_PARTS): Remove.
	($(T)crti.o, $(T)crtn.o): Remove.
	* config/arm/t-linux: Remove comment.
	* config/arm/t-linux-eabi (EXTRA_MULTILIB_PARTS): Remove.
	* config/arm/t-strongarm-elf (EXTRA_MULTILIB_PARTS): Remove.
	($(T)crti.o, $(T)crtn.o): Remove.
	* config/arm/t-symbian (EXTRA_MULTILIB_PARTS): Remove.
	* config/bfin/crti.s: Move to ../libgcc/config/bfin/crti.S.
	* config/bfin/crtn.s: Move to ../libgcc/config/bfin/crtn.S.
	* config/bfin/crtlibid.s: Move to ../libgcc/config/bfin/crtlibid.S.
	* config/bfin/t-bfin (EXTRA_PARTS): Remove.
	($(T)crti.o, $(T)crtn.o): Remove.
	* config/bfin/t-bfin-elf (CRTSTUFF_T_CFLAGS): Remove.
	($(T)crti.o, $(T)crtn.o, $(T)crtlibid.o): Remove
	(EXTRA_MULTILIB_PARTS): Remove.
	* config/bfin/t-bfin-linux (CRTSTUFF_T_CFLAGS,
	EXTRA_MULTILIB_PARTS): Remove.
	* config/bfin/t-bfin-uclinux (CRTSTUFF_T_CFLAGS): Remove.
	($(T)crtlibid.o): Remove.
	(EXTRA_MULTILIB_PARTS): Remove.
	* config/c6x/crti.s: Move to ../libgcc/config/c6x/crti.S.
	* config/c6x/crtn.s: Move to ../libgcc/config/c6x/crtn.S.
	* config/c6x/t-c6x-elf ($(T)crti.o, $(T)crtn.o): Remove.
	(EXTRA_MULTILIB_PARTS): Remove.
	(CRTSTUFF_T_CFLAGS, CRTSTUFF_T_CFLAGS_S): Remove.
	* config/c6x/t-c6x-uclinux (CRTSTUFF_T_CFLAGS,
	CRTSTUFF_T_CFLAGS_S): Remove.
	* config/cris/t-elfmulti (CRTSTUFF_T_CFLAGS): Remove.
	* config/cris/t-linux (CRTSTUFF_T_CFLAGS_S): Remove.
	* config/fr30/crti.asm: Move to ../libgcc/config/fr30/crti.S.
	* config/fr30/crtn.asm: Move to ../libgcc/config/fr30/crtn.S.
	* config/fr30/t-fr30 ($(T)crti.o, $(T)crtn.o): Remove.
	* config/frv/frvbegin.c, config/frv/frvend.c: Move to
	../libgcc/config/frv.
	* config/frv/t-frv (EXTRA_MULTILIB_PARTS): Remove.
	(FRVSTUFF_CFLAGS, $(T)frvbegin$(objext), $(T)frvend$(objext)): Remove.
	* config/frv/t-linux (EXTRA_MULTILIB_PARTS): Remove.
	(CRTSTUFF_T_CFLAGS): Remove.
	* config/h8300/crti.asm: Move to ../libgcc/config/h8300/crti.S.
	* config/h8300/crtn.asm: Move to ../libgcc/config/h8300/crtn.S.
	* config/h8300/t-elf: Remove.
	* config/i386/cygming-crtbegin.c, config/i386/cygming-crtend.c:
	Move to ../libgcc/config/i386.
	* config/i386/t-crtstuff: Remove.
	* config/i386/t-i386elf: Remove.
	* config/i386/t-linux64 (EXTRA_MULTILIB_PARTS): Remove.
	* config/i386/t-nto (CRTSTUFF_T_CFLAGS, EXTRA_PARTS): Remove.
	* config/ia64/crtbegin.asm: Move to
	../libgcc/config/ia64/crtbegin.S.
	* config/ia64/crtend.asm: Move to
	../libgcc/config/ia64/crtend.S.
	* config/ia64/crti.asm: Move to ../libgcc/config/ia64/crti.S.
	* config/ia64/crtn.asm: Move to ../libgcc/config/ia64/crtn.S.
	* config/ia64/t-vms: Remove.
	* config/ia64/vms-crtinit.asm: Move to
	../libgcc/config/ia64/vms-crtinit.S.
	* config/m32c/t-m32c (EXTRA_MULTILIB_PARTS): Remove.
	* config/m32r/initfini.c: Move to ../libgcc/config/m32r.
	* config/m32r/t-linux (CRTSTUFF_T_CFLAGS_S): Remove.
	* config/m32r/t-m32r (CRTSTUFF_T_CFLAGS): Remove.
	($(T)crtinit.o, $(T)crtfini.o): Remove.
	(m32rx, m32r2): Remove.
	(EXTRA_MULTILIB_PARTS): Remove.
	* config/m68k/crti.s: Move to ../libgcc/config/m68k/crti.S.
	* config/m68k/crtn.s: Move to ../libgcc/config/m68k/crtn.S.
	* config/m68k/t-crtstuff: Remove.
	* config/m68k/t-linux (EXTRA_MULTILIB_PARTS): Remove.
	* config/m68k/t-m68kelf: Remove.
	* config/m68k/t-uclinux (EXTRA_MULTILIB_PARTS): Remove.
	* config/mcore/crti.asm: Move to ../libgcc/config/mcore/crti.S.
	* config/mcore/crtn.asm: Move to ../libgcc/config/mcore/crtn.S.
	* config/mcore/t-mcore ($(T)crti.o, $(T)crtn.o): Remove.
	(EXTRA_PARTS, EXTRA_MULTILIB_PARTS): Remove.
	* config/mep/t-mep (CRTSTUFF_CFLAGS): Remove.
	(EXTRA_MULTILIB_PARTS): Remove.
	* config/microblaze/crti.s: Move to ../libgcc/config/microblaze/crti.S.
	* config/microblaze/crtn.s: Move to ../libgcc/config/microblaze/crtn.S.
	* config/microblaze/t-microblaze (EXTRA_MULTILIB_PARTS,
	EXTRA_PARTS): Remove.
	($(T)crti$(objext), $(T)crtn$(objext)): Remove.
	* config/mips/crti.asm: Move to ../libgcc/config/mips/crti.S.
	* config/mips/crtn.asm: Move to ../libgcc/config/mips/crtn.S.
	* config/mips/t-elf (CRTSTUFF_T_CFLAGS): Remove.
	($(T)crti.o, $(T)crtn.o): Remove.
	(EXTRA_MULTILIB_PARTS): Remove.
	* config/mips/t-isa3264: Likewise.
	* config/mips/t-linux64 (EXTRA_MULTILIB_PARTS): Remove.
	* config/mips/t-r3900 (EXTRA_MULTILIB_PARTS): Remove.
	(CRTSTUFF_T_CFLAGS): Remove.
	* config/mips/t-sde (CRTSTUFF_T_CFLAGS): Remove.
	($(T)crti.o, $(T)crtn.o): Remove.
	(EXTRA_MULTILIB_PARTS): Remove.
	* config/mips/t-sr71k (EXTRA_MULTILIB_PARTS, CRTSTUFF_T_CFLAGS):
	Remove.
	($(T)crti.o, $(T)crtn.o): Remove.
	* config/mips/t-st (EXTRA_MULTILIB_PARTS): Remove.
	* config/mips/t-vr (CRTSTUFF_T_CFLAGS): Remove.
	(EXTRA_MULTILIB_PARTS): Remove.
	($(T)crti.o, $(T)crtn.o): Remove.
	* config/mmix/crti.asm: Move to ../libgcc/config/crti.S.
	* config/mmix/crtn.asm: Move to ../libgcc/config/crtn.S.
	* config/mmix/t-mmix (CRTSTUFF_T_CFLAGS): Remove.
	* config/moxie/crti.asm, config/moxie/crtn.asm: Remove.
	* config/pa/stublib.c: Move to libgcc/config/pa.
	* config/pa/t-linux (CRTSTUFF_T_CFLAGS_S): Remove.
	* config/pa/t-linux64 (CRTSTUFF_T_CFLAGS_S): Remove.
	* config/pa/t-pa-hpux11 (LIBGCCSTUB_OBJS, stublib.c): Remove.
	(pthread_default_stacksize_np-stub.o, pthread_mutex_lock-stub.o)
	(pthread_mutex_unlock-stub.o, pthread_once-stub.o)
	($(T)libgcc_stub.a): Remove.
	* config/pa/t-pa64 (LIBGCCSTUB_OBJS, stublib.c): Remove.
	(rfi-stub.o, dfi-stub.o, cxaf-stub.o, jvrc-stub.o)
	(pthread_default_stacksize_np-stub.o, pthread_mutex_lock-stub.o)
	(pthread_mutex_unlock-stub.o, pthread_once-stub.o)
	($(T)libgcc_stub.a): Remove.
	* config/rs6000/eabi-cn.asm: Move to
	../../../libgcc/config/rs6000/eabi-cn.S.
	* config/rs6000/eabi-ci.asm: Move to
	../../../libgcc/config/rs6000/eabi-ci.S.
	* config/rs6000/sol-ci.asm: Move to
	../../../libgcc/config/rs6000/sol-ci.S.
	* config/rs6000/sol-cn.asm: Move to
	../../../libgcc/config/rs6000/sol-cn.S.
	* config/rs6000/t-lynx (EXTRA_MULTILIB_PARTS): Remove.
	(CRTSTUFF_T_CFLAGS, CRTSTUFF_T_CFLAGS_S): Remove.
	* config/rs6000/t-netbsd (CRTSTUFF_T_CFLAGS, CRTSTUFF_T_CFLAGS_S):
	Remove.
	(EXTRA_MULTILIB_PARTS): Remove.
	* config/rs6000/t-ppccomm (EXTRA_MULTILIB_PARTS): Remove.
	(ecrti.S, ecrtn.S, ncrti.S, ncrtn.S): Remove.
	($(T)ecrti$(objext), $(T)ecrtn$(objext), $(T)ncrti$(objext),
	$(T)ncrtn$(objext)): Remove.
	(CRTSTUFF_T_CFLAGS, CRTSTUFF_T_CFLAGS_S): Remove.
	* config/rs6000/t-vxworks (EXTRA_MULTILIB_PARTS): Remove.
	* config/rx/t-rx (EXTRA_MULTILIB_PARTS): Remove.
	* config/score/crti.asm: Move to ../libgcc/config/score/crti.S.
	* config/score/crtn.asm: Move to ../libgcc/config/score/crtn.S.
	* config/score/t-score-elf: Remove.
	* config/sh/crt1.asm: Move to ../libgcc/config/sh/crt1.S.
	* config/sh/crti.asm: Move to ../libgcc/config/sh/crti.S.
	* config/sh/crtn.asm: Move to ../libgcc/config/sh/crtn.S.
	* config/sh/lib1funcs-4-300.asm: Move to
	../../../libgcc/config/sh/lib1funcs-4-300.S.
	* config/sh/lib1funcs-Os-4-200.asm: Move to
	../libgcc/config/sh/lib1funcs-Os-4-200.S.
	* config/sh/t-elf: Remove.
	* config/sh/t-linux (EXTRA_MULTILIB_PARTS): Remove.
	* config/sh/t-linux64: Remove.
	* config/sh/t-netbsd (EXTRA_MULTILIB_PARTS): Remove.
	* config/sh/t-sh ($(T)crt1.o, $(T)crti.o, $(T)crtn.o): Remove.
	(IC_EXTRA_PARTS, OPT_EXTRA_PARTS, EXTRA_MULTILIB_PARTS): Remove.
	($(T)ic_invalidate_array_4-100.o)
	($(T)libic_invalidate_array_4-100.a)
	($(T)ic_invalidate_array_4-200.o)
	($(T)libic_invalidate_array_4-200.a, $(T)ic_invalidate_array_4a.o)
	($(T)libic_invalidate_array_4a.a, $(T)sdivsi3_i4i-Os-4-200.o)
	($(T)udivsi3_i4i-Os-4-200.o, $(T)unwind-dw2-Os-4-200.o)
	($(T)libgcc-Os-4-200.a, $(T)div_table-4-300.o)
	($(T)libgcc-4-300.a): Remove.
	* config/sh/t-superh: Remove.
	* config/sh/t-vxworks (EXTRA_MULTILIB_PARTS): Remove.
	* config/sparc/t-linux64 (CRTSTUFF_T_CFLAGS): Remove.
	* config/spu/cache.S: Move to ../libgcc/config/spu.
	* config/spu/cachemgr.c: Move to ../libgcc/config/spu.
	* config/spu/t-spu-elf (CRTSTUFF_T_CFLAGS): Remove.
	(EXTRA_MULTILIB_PARTS): Remove.
	($(T)cachemgr.o, $(T)cachemgr_nonatomic.o, $(T)libgcc_%.a): Remove.
	($(T)cache8k.o, $(T)cache16k.o, $(T)cache32k.o, $(T)cache32k.o)
	($(T)cache64k.o, $(T)cache128k.o): Remove.
	* config/t-freebsd (CRTSTUFF_T_CFLAGS_S): Remove.
	* config/t-libc-ok: Remove.
	* config/t-linux (CRTSTUFF_T_CFLAGS_S): Remove.
	* config/t-lynx (CRTSTUFF_T_CFLAGS_S): Remove.
	* config/t-netbsd: Remove.
	* config/t-svr4 (CRTSTUFF_T_CFLAGS_S): Remove.
	* config/t-vxworks (EXTRA_MULTILIB_PARTS): Remove.
	* config/vms/t-vms (VMS_EXTRA_PARTS): Remove.
	($(T)vcrt0.o, $(T)pcrt0.o): Remove.
	* config/vms/vms-ucrt0.c: Move to ../libgcc/config/vms.
	* config/xtensa/crti.asm: Move to ../libgcc/config/xtensa/crti.S.
	* config/xtensa/crtn.asm: Move to ../libgcc/config/xtensa/crtn.S.
	* config/xtensa/t-elf (CRTSTUFF_T_CFLAGS, CRTSTUFF_T_CFLAGS_S):
	Remove.
	(EXTRA_MULTILIB_PARTS): Remove.
	* config/xtensa/t-linux: Remove.
	* config/xtensa/t-xtensa ($(T)crti.o, $(T)crtn.o): Remove.

	gcc/po:
	* EXCLUDES (crtstuff.c): Remove.

	libgcc:
	* crtstuff.c: New file.
	* Makefile.in (CRTSTUFF_CFLAGS): Define.
	(CRTSTUFF_T_CFLAGS): Define.
	(extra-parts, INSTALL_PARTS): Remove conditional assignments.
	(crtbegin$(objext), crtend$(objext), crtbeginS$(objext))
	(crtendS$(objext), crtbeginT.o): Use $(srcdir) to refer to
	crtstuff.c.
	Use $<.
	(crtbeginT.o): Use $(objext).
	[!CUSTOM_CRTIN] (crti$(objext), crtn$(objext)): New rules.
	(libgcc-extra-parts): Don't compare EXTRA_PARTS, GCC_EXTRA_PARTS.
	(gcc-extra-parts): Remove.
	* config.host (*-*-freebsd*): Add t-crtstuff-pic to tmake_file.
	Set extra_parts.
	(*-*-linux*, frv-*-*linux*, *-*-kfreebsd*-gnu, *-*-knetbsd*-gnu,
	*-*-gnu*): Also handle *-*-kopensolaris*-gnu.
	Add t-crtstuff-pic to tmake_file.
	(*-*-lynxos*): New case.
	Set tmake_file, extra_parts.
	(*-*-netbsd*): Add t-crtstuff-pic to tmake_file.
	Set extra_parts for *-*-netbsd*1.[7-9]*, *-*-netbsd[2-9]*,
	*-*-netbsdelf[2-9]*.
	(*-*-openbsd*): Add t-crtstuff-pic to tmake_file.
	(*-*-rtems*): Set extra_parts.
	(*-*-solaris2*): Remove t-crtin from tmake_file for Solaris < 10.
	(*-*-uclinux*): New case.
	Set extra_parts.
	(*-*-vms*): New case.
	Set tmake_file, extra_parts.
	(*-*-elf): Set extra_parts.
	(alpha*-*-freebsd*): Add crtbeginT.o to extra_parts.
	(alpha64-dec-*vms*): Append to tmake_file, remove vms/t-vms,
	vms/t-vms64.
	Set extra_parts.
	(alpha*-dec-*vms*): Append to tmake_file, remove vms/t-vms.
	Set extra_parts.
	(arm*-*-freebsd*): Add t-crtin to tmake_file.
	Add crtbegin.o, crtend.o, crti.o, crtn.o to extra_parts.
	(arm-wrs-vxworks): Append to tmake_file.
	Set extra_parts.
	(arm*-*-uclinux*): Set extra_parts.
	(arm*-*-ecos-elf): Likewise.
	(arm*-*-eabi*, arm*-*-symbianelf*): Set extra_parts for
	arm*-*-eabi*.
	(arm*-*-rtems*): Set extra_parts.
	(arm*-*-elf): Likewise.
	(avr-*-rtems*): Clear extra_parts.
	(bfin*-elf*): Add bfin/t-crtlibid, bfin/t-crtstuff to extra_parts.
	Set extra_parts.
	(bfin*-uclinux*): Likewise.
	(bfin*-linux-uclibc*): Add bfin/t-crtstuff to tmake_file.
	(bfin*-rtems*): Append to tmake_file.
	Set extra_parts.
	(bfin*-*): Likewise.
	(crisv32-*-elf, crisv32-*-none, cris-*-elf, cris-*-none): Split into ...
	(crisv32-*-elf): ... this.
	(crisv32-*-none): ... this.
	(cris-*-elf, cris-*-none): New cases.
	Add cris/t-elfmulti to tmake_file.
	(fr30-*-elf): Append to tmake_file.
	Set extra_parts.
	(frv-*-elf): Append to tmake_file, add frv/t-frv.
	Set extra_parts.
	(h8300-*-rtems*): Append to tmake_file.
	Set extra_parts.
	(h8300-*-elf*): Likewise.
	(hppa*64*-*-hpux11*): Add pa/t-stublib, pa/t-stublib64 to tmake_file.
	Set extra_parts.
	(hppa[12]*-*-hpux11*): Add pa/t-stublib to tmake_file.
	Set extra_parts.
	(i[34567]86-*-elf*): Add i386/t-crtstuff, t-crtstuff-pic to tmake_file.
	(x86_64-*-elf*): Likewise.
	(i[34567]86-*-freebsd*): Add i386/t-crtstuff to tmake_file.
	(x86_64-*-freebsd*): Likewise.
	(x86_64-*-netbsd*): Likewise.
	(i[34567]86-*-linux*): Likewise.
	(i[34567]86-*-kfreebsd*-gnu, i[34567]86-*-knetbsd*-gnu)
	(i[34567]86-*-gnu*, i[34567]86-*-kopensolaris*-gnu): Likewise.
	(x86_64-*-linux*): Likewise.
	(x86_64-*-kfreebsd*-gnu, x86_64-*-knetbsd*-gnu): Likewise.
	(i[34567]86-*-lynxos*): Add t-crtstuff-pic, i386/t-crtstuff to
	tmake_file.
	Set extra_parts.
	(i[34567]86-*-nto-qnx*): Set tmake_file, extra_parts.
	(i[34567]86-*-rtems*): Append to tmake_file, remove t-crtin.
	Append to extra_parts, remove crtbegin.o, crtend.o.
	(ia64*-*-elf*): Append to extra_parts, remove crtbegin.o, crtend.o.
	(ia64*-*-freebsd*): Append to extra_parts, remove crtbegin.o,
	crtend.o, crtbeginS.o, crtendS.o.
	(ia64*-*-linux*): Comment extra_parts.
	(ia64-hp-*vms*): Append to tmake_file, remove vms/t-vms, vms/t-vms64.
	Set extra_parts.
	(iq2000*-*-elf*): Clear extra_parts.
	(lm32-*-elf*, lm32-*-rtems*): Add t-crtin to tmake_file.
	(lm32-*-uclinux*): Add to extra_parts, remove crtbegin.o, crtend.o
	(m32r-*-elf*, m32r-*-rtems*): Split off ...
	(m32r-*-rtems*): ... this.
	Add m32r/t-m32r to tmake_file.
	(m68k-*-elf*): Add t-crtin to tmake_file.
	(m68k-*-rtems*): Add crti.o, crtn.o to extra_parts.
	(mcore-*-elf): Likewise.
	(microblaze*-*-*): Set extra_parts.
	(mips*-sde-elf*): New case.
	Set tmake_file, extra_parts.
	(mipsisa32-*-elf*, mipsisa32el-*-elf*, mipsisa32r2-*-elf*)
	(mipsisa32r2el-*-elf*, mipsisa64-*-elf*, mipsisa64el-*-elf*)
	(mipsisa64r2-*-elf*, mipsisa64r2el-*-elf*): Add mips/t-crtstuff to
	tmake_file.
	Set extra_parts.
	(mipsisa64sr71k-*-elf*): Likewise.
	(mipsisa64sb1-*-elf*, mipsisa64sb1el-*-elf*): Likewise.
	(mips-*-elf*, mipsel-*-elf*): Likewise.
	(mips64-*-elf*, mips64el-*-elf*): Likewise.
	(mips64vr-*-elf*, mips64vrel-*-elf*): Likewise.
	(mips64orion-*-elf*,  mips64orionel-*-elf*): Likewise.
	(mips*-*-rtems*): Likewise.
	(mipstx39-*-elf*, mipstx39el-*-elf*): Likewise.
	(moxie-*-*): Split into ...
	(moxie-*-elf, moxie-*-uclinux*): ... this.
	Add to extra_parts, remove crtbegin.o, crtend.o.
	(moxie-*-rtems*): New case.
	Set tmake_file.
	Clear extra_parts.
	(powerpc-*-freebsd*): Add rs6000/t-crtstuff to tmake_file.
	Set extra_parts.
	(powerpc-*-netbsd*): Add rs6000/t-netbsd to tmake_file.
	(powerpc-*-eabispe*): Add rs6000/t-crtstuff, t-crtstuff-pic to
	tmake_file.
	Set extra_parts.
	(powerpc-*-eabisimaltivec*): Add to tmake_file, add rs6000/t-ppccomm,
	rs6000/t-crtstuff, t-crtstuff-pic to tmake_file.
	Set extra_parts.
	(powerpc-*-eabisim*): Likewise.
	(powerpc-*-elf*): Likewise.
	(powerpc-*-eabialtivec*): Likewise.
	(powerpc-xilinx-eabi*): Likewise.
	(powerpc-*-eabi*): Likewise.
	(powerpc-*-rtems*): Likewise.
	(powerpc-*-linux*, powerpc64-*-linux*): Add rs6000/t-crtstuff to
	tmake_file.
	Set extra_parts.
	(powerpc-*-lynxos*): Add to tmake_file.
	(powerpcle-*-elf*): Add to tmake_file, add rs6000/t-ppccomm,
	rs6000/t-crtstuff, t-crtstuff-pic.
	Set extra_parts.
	(powerpcle-*-eabisim*): Likewise.
	(powerpcle-*-eabi*): Likewise.
	(rx-*-elf): Remove extra_parts.
	(s390x-ibm-tpf*): Set extra_parts.
	(score-*-elf): Set extra_parts.
	(sh-*-elf*, sh[12346l]*-*-elf*, sh-*-linux*)
	(sh[2346lbe]*-*-linux*, sh-*-netbsdelf*, shl*-*-netbsdelf*)
	(sh5-*-netbsd*, sh5l*-*-netbsd*, sh64-*-netbsd*)
	(sh64l*-*-netbsd*): Split into ...
	(sh-*-elf*, sh[12346l]*-*-elf*): ... this.
	Add t-crtstuff-pic to tmake_file.
	Set extra_parts.
	(sh-*-rtems*): Add to tmake_file, add t-crtstuff-pic.
	Set extra_parts.
	(sh-wrs-vxworks): Add to tmake_file, add t-crtstuff-pic.
	(sparc-*-elf*): Remove t-crtin from tmake_file.
	Add to extra_parts, remove crtbegin.o, crtend.o.
	(sparc-*-linux*): Add sparc/t-linux64 to tmake_file.
	(sparc64-*-linux*): Likewise.
	(sparc-*-rtems*): Remove sparc/t-elf from tmake_file.
	Add to extra_parts, remove crtbegin.o, crtend.o.
	(sparc64-*-elf*): Remove t-crtin from tmake_file.
	Add to extra_parts, remove crtbegin.o, crtend.o.
	(sparc64-*-rtems*): Remove t-crtin from tmake_file.
	Add to extra_parts, remove crtbegin.o, crtend.o.
	(sparc64-*-freebsd*, ultrasparc-*-freebsd*): Add to extra_parts.
	(sparc64-*-linux*): Add sparc/t-linux64 to tmake_file.
	(spu-*-elf*): Add to tmake_file, add spu/t-elf.
	Set extra_parts.
	(tic6x-*-uclinux): Add c6x/t-uxlinux, t-crtstuff-pic to tmake_file.
	Set extra_parts.
	(tic6x-*-*): Change to ...
	(tic6x-*-elf): ... this.
	Set extra_parts.
	(xtensa*-*-elf*): Add to tmake_file, add xtensa/t-elf.
	Set extra_parts.
	(am33_2.0-*-linux*): Add comment.
	(mep*-*-*): Add mep/t-mep to tmake_file.
	Set extra_parts.
	* config/alpha/t-vms: New file.
	* config/alpha/vms-dwarf2.S, config/alpha/vms-dwarf2eh.S: New files.
	* config/arm/crti.S, config/arm/crtn.S: New files.
	* config/bfin/crti.S, config/bfin/crtn.S: New files.
	* config/bfin/crtlibid.S: New file.
	* config/bfin/t-crtlibid, config/bfin/t-crtstuff: New files.
	* config/c6x/crti.S, config/c6x/crtn.S: New files.
	* config/c6x/t-elf (CUSTOM_CRTIN): Set.
	(crti.o, crtin.o): New rules.
	(CRTSTUFF_T_CFLAGS, CRTSTUFF_T_CFLAGS_S): Set.
	* config/c6x/t-uclinux: New file.
	* config/cris/t-elfmulti: New file.
	* config/cris/t-linux (CRTSTUFF_T_CFLAGS_S): Set.
	* config/fr30/crti.S, config/fr30/crtn.S: New files.
	* config/frv/frvbegin.c, config/frv/frvend.c: New files.
	* config/frv/t-frv: New file.
	* config/frv/t-linux (CRTSTUFF_T_CFLAGS): Set.
	* config/h8300/crti.S, config/h8300/crtn.S: New files.
	* config/i386/cygming-crtbegin.c, config/i386/cygming-crtend.c:
	New files.
	* config/i386/t-cygming (crtbegin.o, crtend.o): Use $(srcdir) to
	refer to cygming-crtbegin.c, cygming-crtend.c.
	Use $<.
	* config/i386/t-nto: New file.
	* config/ia64/crtbegin.S, config/ia64/crtend.S: New files.
	* config/ia64/crti.S, config/ia64/crtn.S: New files.
	* config/ia64/t-ia64 (crtbegin.o, crtend.o, crtbeginS.o,
	crtendS.o): Use $(srcdir) to refer to crtbegin.S, crtend.S.
	Use .S extension.
	Use $<.
	* config/ia64/t-vms (CRTSTUFF_T_CFLAGS, CRTSTUFF_T_CFLAGS_S): Set.
	(crtinitS.o): New rule.
	* config/ia64/vms-crtinit.S: New file.
	* config/lm32/t-elf ($(T)crti.o, $(T)crtn.o): Remove.
	* config/m32r/initfini.c: New file.
	* config/m32r/t-linux, config/m32r/t-m32r: New files.
	* config/m68k/crti.S, config/m68k/crtn.S: New files.
	* config/mcore/crti.S, config/mcore/crtn.S: New files.
	* config/mep/t-mep: New file.
	* config/microblaze/crti.S, config/microblaze/crtn.S: New files.
	* config/microblaze/t-microblaze (MULTILIB_OPTIONS): Remove.
	* config/mips/crti.S, config/mips/crtn.S: New files.
	* config/mips/t-crtstuff: New file.
	* config/mmix/crti.S, config/mmix/crtn.S: New files.
	* config/mmix/t-mmix (CRTSTUFF_T_CFLAGS): Set.
	(CUSTOM_CRTIN): Set.
	($(T)crti.o, $(T)crtn.o): Remove $(T),
	dependencies.
	Use $(srcdir) to refer to crti.S, crtn.S.
	Use .S extension, $<.
	* config/moxie/crti.asm: Rename to ...
	* config/moxie/crti.S: ... this.
	* config/moxie/crtn.asm: Rename to ...
	* config/moxie/crtn.S: ... this.
	* config/moxie/t-moxie: Remove.
	* config/pa/stublib.c: New file.
	* config/pa/t-stublib, config/pa/t-stublib64: New files.
	* config/rs6000/eabi-ci.S, config/rs6000/eabi-cn.S: New files.
	* config/rs6000/sol-ci.S, config/rs6000/sol-cn.S: New files.
	* config/rs6000/t-crtstuff: New file.
	* config/rs6000/t-ppccomm (EXTRA_PARTS): Remove.
	(ecrti.S, ecrtn.S, ncrti.S, ncrtn.S): Remove.
	(ecrti$(objext)): Depend on $(srcdir)/config/rs6000/eabi-ci.S.
	Make output file explicit.
	(ecrtn$(objext)): Depend on $(srcdir)/config/rs6000/eabi-cn.S.
	Make output file explicit.
	(ncrti$(objext): Depend on $(srcdir)/config/rs6000/sol-ci.S.
	Make output file explicit.
	(ncrtn$(objext)): Depend on $(srcdir)/config/rs6000/sol-cn.S.
	Make output file explicit.
	* config/score/crti.S, config/score/crtn.S: New files.
	* config/sh/crt1.S, config/sh/crti.S, config/sh/crtn.S: New files.
	* config/sh/lib1funcs-4-300.S, config/sh/lib1funcs-Os-4-200.S: New
	files.
	* config/sh/t-sh, config/sh/t-superh: New files.
	* config/sparc/t-linux64: New file.
	* config/spu/cache.S, config/spu/cachemgr.c: New files.
	* config/spu/t-elf (CRTSTUFF_T_CFLAGS): Set.
	(cachemgr.o, cachemgr_nonatomic.o, libgcc_%.a, cache8k.o)
	(cache16k.o, cache32k.o, cache64k.o, cache128k.o): New rules.
	* config/t-crtin: Remove.
	* config/t-crtstuff-pic: New file.
	* config/t-sol2 (CUSTOM_CRTIN): Set.
	(crti.o, crtn.o): New rules.
	* config/vms/t-vms: New file.
	* config/vms/vms-ucrt0.c: New file.
	* config/xtensa/t-elf: New file.

# HG changeset patch
# Parent eae81f08e3c38fde20ca4c3235dd241ea59033a7
Move crtstuff support to toplevel libgcc

diff --git a/gcc/Makefile.in b/gcc/Makefile.in
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -687,13 +687,6 @@ LIBGCC2_INCLUDES =
 # Additional target-dependent options for compiling libgcc2.a.
 TARGET_LIBGCC2_CFLAGS =
 
-# Options to use when compiling crtbegin/end.
-CRTSTUFF_CFLAGS = -O2 $(GCC_CFLAGS) $(INCLUDES_FOR_TARGET) $(MULTILIB_CFLAGS) \
-  -g0 -finhibit-size-directive -fno-inline -fno-exceptions \
-  -fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize \
-  -fno-stack-protector \
-  $(INHIBIT_LIBC_CFLAGS)
-
 # List of extra executables that should be compiled for this target machine
 # that are used for compiling from source code to object code.
 # The rules for compiling them should be in the t-* file for the machine.
@@ -702,10 +695,6 @@ EXTRA_PASSES =@extra_passes@
 # Like EXTRA_PASSES, but these are used when linking.
 EXTRA_PROGRAMS = @extra_programs@
 
-# List of extra object files that should be compiled for this target machine.
-# The rules for compiling them should be in the t-* file for the machine.
-EXTRA_PARTS = @extra_parts@
-
 # List of extra object files that should be compiled and linked with
 # compiler proper (cc1, cc1obj, cc1plus).
 EXTRA_OBJS = @extra_objs@
@@ -801,9 +790,6 @@ RUNTEST = `if [ -f $${srcdir}/../dejagnu
 	    else echo runtest; fi`
 RUNTESTFLAGS =
 
-# Extra flags to use when compiling crt{begin,end}.o.
-CRTSTUFF_T_CFLAGS =
-
 # "t" or nothing, for building multilibbed versions of, say, crtbegin.o.
 T =
 
@@ -1538,7 +1524,7 @@ MOSTLYCLEANFILES = insn-flags.h insn-con
  tree-check.h min-insn-modes.c insn-modes.c insn-modes.h \
  genrtl.h gt-*.h gtype-*.h gtype-desc.c gtyp-input.list \
  xgcc$(exeext) cpp$(exeext) cc1$(exeext) $(EXTRA_PASSES) \
- $(EXTRA_PARTS) $(EXTRA_PROGRAMS) gcc-cross$(exeext) \
+ $(EXTRA_PROGRAMS) gcc-cross$(exeext) \
  $(SPECS) collect2$(exeext) gcc-ar$(exeext) gcc-nm$(exeext) \
  gcc-ranlib$(exeext) \
  gcov-iov$(build_exeext) gcov$(exeext) gcov-dump$(exeext) \
@@ -1886,10 +1872,6 @@ srcdirify = $(patsubst $$(libgcc_objdir)
 	    $(patsubst %,$$(gcc_objdir)/%, \
 		$(filter-out $(srcdir)% $$(libgcc_objdir)%,$(1)))
 
-# The distinction between these two variables is no longer relevant,
-# so we combine them.  Sort removes duplicates.
-GCC_EXTRA_PARTS := $(sort $(EXTRA_MULTILIB_PARTS) $(EXTRA_PARTS))
-
 libgcc-support: libgcc.mvars stmp-int-hdrs $(TCONFIG_H) \
 	$(MACHMODE_H) $(LIB2ADD) $(LIB2ADD_ST) gcov-iov.h
 
@@ -1904,12 +1886,10 @@ libgcc.mvars: config.status Makefile $(L
 	echo LIB2ADD_ST = '$(call srcdirify,$(LIB2ADD_ST))' >> tmp-libgcc.mvars
 	echo LIB2_SIDITI_CONV_FUNCS = '$(LIB2_SIDITI_CONV_FUNCS)' >> tmp-libgcc.mvars
 	echo LIB2_DIVMOD_FUNCS = '$(LIB2_DIVMOD_FUNCS)' >> tmp-libgcc.mvars
-	echo GCC_EXTRA_PARTS = '$(GCC_EXTRA_PARTS)' >> tmp-libgcc.mvars
 	echo LIBGCC2_CFLAGS = '$(LIBGCC2_CFLAGS)' >> tmp-libgcc.mvars
 	echo TARGET_LIBGCC2_CFLAGS = '$(TARGET_LIBGCC2_CFLAGS)' >> tmp-libgcc.mvars
-	echo CRTSTUFF_CFLAGS = '$(CRTSTUFF_CFLAGS)' >> tmp-libgcc.mvars
-	echo CRTSTUFF_T_CFLAGS = '$(CRTSTUFF_T_CFLAGS)' >> tmp-libgcc.mvars
-	echo CRTSTUFF_T_CFLAGS_S = '$(CRTSTUFF_T_CFLAGS_S)' >> tmp-libgcc.mvars
+	echo GCC_CFLAGS = '$(GCC_CFLAGS)' >> tmp-libgcc.mvars
+	echo INHIBIT_LIBC_CFLAGS = '$(INHIBIT_LIBC_CFLAGS)' >> tmp-libgcc.mvars
 	echo TARGET_SYSTEM_ROOT = '$(TARGET_SYSTEM_ROOT)' >> tmp-libgcc.mvars
 
 	mv tmp-libgcc.mvars libgcc.mvars
@@ -1937,41 +1917,6 @@ s-mlib: $(srcdir)/genmultilib Makefile
 	fi
 	$(SHELL) $(srcdir)/../move-if-change tmp-mlib.h multilib.h
 	$(STAMP) s-mlib
-
-# Compile two additional files that are linked with every program
-# linked using GCC on systems using COFF or ELF, for the sake of C++
-# constructors.
-$(T)crtbegin.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
-  gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
-	$(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \
-	  -c $(srcdir)/crtstuff.c -DCRT_BEGIN \
-	  -o $(T)crtbegin$(objext)
-
-$(T)crtend.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
-  gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
-	$(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \
-	  -c $(srcdir)/crtstuff.c -DCRT_END \
-	  -o $(T)crtend$(objext)
-
-# These are versions of crtbegin and crtend for shared libraries.
-$(T)crtbeginS.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
-  gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
-	$(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS_S) \
-	  -c $(srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFS_O \
-	  -o $(T)crtbeginS$(objext)
-
-$(T)crtendS.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
-  gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
-	$(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS_S) \
-	  -c $(srcdir)/crtstuff.c -DCRT_END -DCRTSTUFFS_O \
-	  -o $(T)crtendS$(objext)
-
-# This is a version of crtbegin for -static links.
-$(T)crtbeginT.o: crtstuff.c $(GCC_PASSES) $(TCONFIG_H) auto-host.h \
-  gbl-ctors.h stmp-int-hdrs tsystem.h coretypes.h $(TM_H)
-	$(GCC_FOR_TARGET) $(CRTSTUFF_CFLAGS) $(CRTSTUFF_T_CFLAGS) \
-	  -c $(srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFT_O \
-	  -o $(T)crtbeginT$(objext)
 #
 # Compiling object files from source files.
 
diff --git a/gcc/config.gcc b/gcc/config.gcc
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -138,9 +138,6 @@
 #  extra_passes		List of extra executables compiled for this target
 #			machine, used for compiling from source to object.
 #
-#  extra_parts		List of extra object files that should be compiled
-#			for this target machine.
-#
 #  extra_programs	Like extra_passes, but these are used when linking.
 #
 #  extra_options	List of target-dependent .opt files.
@@ -215,7 +212,6 @@ user_headers_inc_next_post=
 use_gcc_tgmath=yes
 use_gcc_stdint=none
 extra_passes=
-extra_parts=
 extra_programs=
 extra_objs=
 extra_gcc_objs=
@@ -556,7 +552,6 @@ case ${target} in
   # pleases around the provided core setting.
   gas=yes
   gnu_ld=yes
-  extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
   fbsd_major=`echo ${target} | sed -e 's/.*freebsd//g' | sed -e 's/\..*//g'`
   tm_defines="${tm_defines} FBSD_MAJOR=${fbsd_major}"
   tmake_file="t-freebsd t-slibgcc"
@@ -586,7 +581,6 @@ case ${target} in
   ;;
 *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu)
   extra_options="$extra_options gnu-user.opt"
-  extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o"
   gas=yes
   gnu_ld=yes
   case ${enable_threads} in
@@ -640,7 +634,7 @@ case ${target} in
   esac
   ;;
 *-*-netbsd*)
-  tmake_file="t-libc-ok t-netbsd t-libgcc-pic t-slibgcc"
+  tmake_file="t-libgcc-pic t-slibgcc"
   gas=yes
   gnu_ld=yes
 
@@ -661,15 +655,6 @@ case ${target} in
       ;;
   esac
 
-  # NetBSD 1.7 and later are set up to use GCC's crtstuff for
-  # ELF configurations.  We will clear extra_parts in the
-  # a.out configurations.
-  case ${target} in
-    *-*-netbsd*1.[7-9]* | *-*-netbsd[2-9]* | *-*-netbsdelf[2-9]*)
-      extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o"
-      ;;
-  esac
-
   # NetBSD 2.0 and later provide __cxa_atexit(), which we use by
   # default (unless overridden by --disable-__cxa_atexit).
   case ${target} in
@@ -679,7 +664,7 @@ case ${target} in
   esac
   ;;
 *-*-openbsd*)
-  tmake_file="t-libc-ok t-openbsd t-libgcc-pic"
+  tmake_file="t-openbsd t-libgcc-pic"
   case ${enable_threads} in
     yes)
       thread_file='posix'
@@ -771,14 +756,12 @@ alpha*-*-linux*)
 	extra_options="${extra_options} alpha/elf.opt"
 	target_cpu_default="MASK_GAS"
 	tmake_file="${tmake_file} alpha/t-alpha alpha/t-ieee"
-	extra_parts="${extra_parts} crtfastmath.o"
 	;;
 alpha*-*-freebsd*)
 	tm_file="${tm_file} ${fbsd_tm_file} alpha/elf.h alpha/freebsd.h"
 	extra_options="${extra_options} alpha/elf.opt"
 	target_cpu_default="MASK_GAS"
 	tmake_file="${tmake_file} alpha/t-alpha alpha/t-ieee"
-	extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o crtfastmath.o"
 	;;
 alpha*-*-netbsd*)
 	tm_file="${tm_file} netbsd.h alpha/elf.h netbsd-elf.h alpha/netbsd.h"
@@ -963,7 +946,6 @@ bfin*-uclinux*)
 bfin*-linux-uclibc*)
 	tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h gnu-user.h linux.h glibc-stdint.h bfin/linux.h ./linux-sysroot-suffix.h"
 	tmake_file="bfin/t-bfin-linux t-slibgcc"
-	extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
 	use_collect2=no
 	;;
 bfin*-rtems*)
@@ -1008,7 +990,6 @@ crisv32-*-linux* | cris-*-linux*)
 fr30-*-elf)
 	tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
 	tmake_file=fr30/t-fr30
-	extra_parts="crti.o crtn.o crtbegin.o crtend.o"
 	;;
 frv-*-elf)
 	tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
@@ -1025,14 +1006,12 @@ moxie-*-elf)
 	gas=yes
 	gnu_ld=yes
 	tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
-	extra_parts="crti.o crtn.o crtbegin.o crtend.o"
 	tmake_file="${tmake_file} moxie/t-moxie"
 	;;
 moxie-*-uclinux*)
 	gas=yes
 	gnu_ld=yes
 	tm_file="dbxelf.h elfos.h ${tm_file} gnu-user.h linux.h glibc-stdint.h moxie/uclinux.h"
-	extra_parts="crti.o crtn.o crtbegin.o crtend.o"
 	tmake_file="${tmake_file} moxie/t-moxie"
 	;;
 moxie-*-rtems*)
@@ -1040,12 +1019,12 @@ moxie-*-rtems*)
 	tm_file="moxie/moxie.h dbxelf.h elfos.h moxie/rtems.h rtems.h newlib-stdint.h"
 	;;
 h8300-*-rtems*)
-	tmake_file="h8300/t-h8300 h8300/t-elf t-rtems h8300/t-rtems"
+	tmake_file="h8300/t-h8300 t-rtems h8300/t-rtems"
 	tm_file="h8300/h8300.h dbxelf.h elfos.h h8300/elf.h h8300/rtems.h rtems.h newlib-stdint.h"
 	libgcc_tm_file="$libgcc_tm_file h8300/h8300-lib.h"
 	;;
 h8300-*-elf*)
-	tmake_file="h8300/t-h8300 h8300/t-elf"
+	tmake_file="h8300/t-h8300"
 	tm_file="h8300/h8300.h dbxelf.h elfos.h newlib-stdint.h h8300/elf.h"
 	libgcc_tm_file="$libgcc_tm_file h8300/h8300-lib.h"
 	;;
@@ -1129,8 +1108,6 @@ hppa*64*-*-hpux11*)
 		       pa/pa-hpux1010.opt pa/pa64-hpux.opt hpux11.opt"
 	need_64bit_hwint=yes
 	tmake_file="pa/t-pa64 pa/t-pa-hpux t-slibgcc"
-	extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o \
-		     libgcc_stub.a"
 	case x${enable_threads} in
 	x | xyes | xposix )
 		thread_file=posix
@@ -1169,7 +1146,6 @@ hppa[12]*-*-hpux11*)
 		;;
 	esac
 	tmake_file="pa/t-pa-hpux11 pa/t-pa-hpux t-slibgcc"
-	extra_parts="libgcc_stub.a"
 	case x${enable_threads} in
 	x | xyes | xposix )
 		thread_file=posix
@@ -1207,19 +1183,17 @@ x86_64-*-darwin*)
 	;;
 i[34567]86-*-elf*)
 	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h"
-	tmake_file="${tmake_file} i386/t-i386elf i386/t-crtstuff t-svr4"
+	tmake_file="${tmake_file} t-svr4"
 	;;
 x86_64-*-elf*)
 	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h newlib-stdint.h i386/i386elf.h i386/x86-64.h"
-	tmake_file="${tmake_file} i386/t-i386elf i386/t-crtstuff t-svr4"
+	tmake_file="${tmake_file} t-svr4"
 	;;
 i[34567]86-*-freebsd*)
 	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/freebsd.h"
-	tmake_file="${tmake_file} i386/t-crtstuff"
 	;;
 x86_64-*-freebsd*)
 	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/x86-64.h i386/freebsd.h i386/freebsd64.h"
-	tmake_file="${tmake_file} i386/t-crtstuff"
 	;;
 i[34567]86-*-netbsdelf*)
 	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/netbsd-elf.h"
@@ -1228,13 +1202,12 @@ i[34567]86-*-netbsdelf*)
 x86_64-*-netbsd*)
 	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/x86-64.h i386/netbsd64.h"
 	extra_options="${extra_options} netbsd.opt netbsd-elf.opt"
-	tmake_file="${tmake_file} i386/t-crtstuff"
 	;;
 i[34567]86-*-openbsd2.*|i[34567]86-*openbsd3.[0123])
 	tm_file="i386/i386.h i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h openbsd-oldgas.h openbsd.h i386/openbsd.h"
 	extra_options="${extra_options} openbsd.opt"
 	# needed to unconfuse gdb
-	tmake_file="${tmake_file} t-libc-ok t-openbsd i386/t-openbsd"
+	tmake_file="${tmake_file} t-openbsd i386/t-openbsd"
 	# we need collect2 until our bug is fixed...
 	use_collect2=yes
 	;;
@@ -1306,10 +1279,6 @@ i[34567]86-*-linux* | i[34567]86-*-kfree
 		tm_file="$tm_file i386/gnu-user.h gnu.h i386/gnu.h"
 		;;
 	esac
-	tmake_file="${tmake_file} i386/t-crtstuff"
-	# This is a hack to avoid a configuration mismatch
-	# until the toplevel libgcc move is complete.
-	extra_parts="${extra_parts} crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
 	;;
 x86_64-*-linux* | x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu)
 	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h gnu-user.h glibc-stdint.h \
@@ -1327,7 +1296,7 @@ x86_64-*-linux* | x86_64-*-kfreebsd*-gnu
 		tm_file="${tm_file} knetbsd-gnu.h"
 		;;
 	esac
-	tmake_file="${tmake_file} i386/t-linux64 i386/t-crtstuff"
+	tmake_file="${tmake_file} i386/t-linux64"
 	x86_multilibs="${with_multilib_list}"
 	if test "$x86_multilibs" = "default"; then
 		x86_multilibs="m64,m32"
@@ -1357,8 +1326,7 @@ i[34567]86-pc-msdosdjgpp*)
 i[34567]86-*-lynxos*)
 	xm_defines=POSIX
 	tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h i386/lynx.h lynx.h"
-	tmake_file="${tmake_file} i386/t-crtstuff t-lynx"
-	extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
+	tmake_file="${tmake_file} t-lynx"
 	extra_options="${extra_options} lynx.opt"
 	thread_file=lynx
 	gnu_ld=yes
@@ -1547,19 +1515,16 @@ ia64*-*-elf*)
 	then
 		target_cpu_default="${target_cpu_default}|MASK_GNU_LD"
 	fi
-	extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o"
 	;;
 ia64*-*-freebsd*)
 	tm_file="${tm_file} dbxelf.h elfos.h ${fbsd_tm_file} ia64/sysv4.h ia64/freebsd.h"
 	target_cpu_default="MASK_GNU_AS|MASK_GNU_LD"
 	tmake_file="${tmake_file} ia64/t-ia64"
-	extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o"
 	;;
 ia64*-*-linux*)
 	tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ia64/sysv4.h ia64/linux.h"
 	tmake_file="${tmake_file} ia64/t-ia64 t-libunwind"
 	target_cpu_default="MASK_GNU_AS|MASK_GNU_LD"
-	extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o"
 	;;
 ia64*-*-hpux*)
 	tm_file="${tm_file} dbxelf.h elfos.h ia64/sysv4.h ia64/hpux.h"
@@ -1585,7 +1550,7 @@ ia64*-*-hpux*)
 ia64-hp-*vms*)
 	tm_file="${tm_file} elfos.h ia64/sysv4.h ia64/elf.h ia64/vms.h ia64/vms64.h"
 	xm_file="vms/xm-vms.h vms/xm-vms64.h"
-	tmake_file="${tmake_file} vms/t-vms64 ia64/t-ia64 ia64/t-vms"
+	tmake_file="${tmake_file} vms/t-vms64 ia64/t-ia64"
 	target_cpu_default="0"
 	if test x$gas = xyes
 	then
@@ -1614,16 +1579,13 @@ lm32-*-uclinux*)
         ;;
 m32r-*-elf*)
 	tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file}"
-	extra_parts="crtinit.o crtfini.o"
  	;;
 m32rle-*-elf*)
 	tm_file="dbxelf.h elfos.h newlib-stdint.h m32r/little.h ${tm_file}"
-	extra_parts="crtinit.o crtfini.o m32rx/crtinit.o m32rx/crtfini.o"
 	;;
 m32r-*-rtems*)
 	tm_file="dbxelf.h elfos.h ${tm_file} m32r/rtems.h rtems.h newlib-stdint.h"
 	tmake_file="m32r/t-m32r t-rtems"
-	extra_parts="crtinit.o crtfini.o"
  	;;
 m32r-*-linux*)
 	tm_file="dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h ${tm_file} m32r/linux.h"
@@ -1673,7 +1635,6 @@ m68k-*-elf* | fido-*-elf*)
 		tmake_file="$tmake_file m68k/t-mlibs"
 		;;
 	esac
-	extra_parts="crtbegin.o crtend.o"
 	;;
 m68k*-*-netbsdelf*)
 	default_m68k_cpu=68020
@@ -1689,7 +1650,7 @@ m68k*-*-openbsd*)
 	tm_defines="${tm_defines} OBSD_OLD_GAS"
 	tm_file="${tm_file} openbsd.h openbsd-stdint.h openbsd-libpthread.h m68k/openbsd.h"
 	extra_options="${extra_options} openbsd.opt"
-	tmake_file="t-libc-ok t-openbsd m68k/t-openbsd"
+	tmake_file="t-openbsd m68k/t-openbsd"
 	# we need collect2 until our bug is fixed...
 	use_collect2=yes
 	;;
@@ -1703,7 +1664,7 @@ m68k-*-uclinux*)		# Motorola m68k/ColdFi
  	tm_defines="${tm_defines} MOTOROLA=1"
 	tmake_file="m68k/t-floatlib m68k/t-uclinux m68k/t-mlibs"
 	;;
-m68k-*-linux*)		# Motorola m68k's running GNU/Linux
+m68k-*-linux*)			# Motorola m68k's running GNU/Linux
 				# with ELF format using glibc 2
 				# aka the GNU/Linux C library 6.
 	default_m68k_cpu=68020
@@ -1720,7 +1681,6 @@ m68k-*-rtems*)
 	tmake_file="m68k/t-floatlib m68k/t-m68kbare m68k/t-crtstuff t-rtems m68k/t-rtems m68k/t-mlibs"
 	tm_file="${tm_file} m68k/m68k-none.h m68k/m68kelf.h dbxelf.h elfos.h m68k/m68kemb.h m68k/m68020-elf.h m68k/rtemself.h rtems.h newlib-stdint.h"
 	tm_defines="${tm_defines} MOTOROLA=1"
-	extra_parts="crtbegin.o crtend.o"
 	;;
 mcore-*-elf)
 	tm_file="dbxelf.h elfos.h newlib-stdint.h ${tm_file} mcore/mcore-elf.h"
@@ -1730,7 +1690,6 @@ mcore-*-elf)
 mep-*-*)
 	tm_file="dbxelf.h elfos.h ${tm_file}"
 	tmake_file=mep/t-mep
-	extra_parts="crtbegin.o crtend.o"
 	c_target_objs="mep-pragma.o"
 	cxx_target_objs="mep-pragma.o"
 	if test -d "${srcdir}/../newlib/libc/include" &&
@@ -1744,7 +1703,6 @@ microblaze*-linux*)
 	c_target_objs="${c_target_objs} microblaze-c.o"
 	cxx_target_objs="${cxx_target_objs} microblaze-c.o"
 	tmake_file="${tmake_file} t-linux microblaze/t-microblaze"
-        extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o crtbeginT.o"
 	;;
 microblaze*-*-*)
         tm_file="${tm_file} dbxelf.h"
@@ -1794,7 +1752,6 @@ mips64*-*-linux* | mipsisa64*-*-linux*)
 			tm_defines="${tm_defines} MIPS_ISA_DEFAULT=65"
 			;;
 	esac
-	extra_parts="$extra_parts crtfastmath.o"
 	gnu_ld=yes
 	gas=yes
 	test x$with_llsc != x || with_llsc=yes
@@ -1813,7 +1770,6 @@ mips*-*-linux*)				# Linux MIPS, either 
         mipsisa32*)
 		tm_defines="${tm_defines} MIPS_ISA_DEFAULT=32"
         esac
-	extra_parts="$extra_parts crtfastmath.o"
 	test x$with_llsc != x || with_llsc=yes
 	;;
 mips*-*-openbsd*)
@@ -2110,7 +2066,6 @@ powerpc-*-lynxos*)
 	tm_file="${tm_file} dbxelf.h elfos.h rs6000/sysv4.h rs6000/lynx.h lynx.h"
 	tmake_file="t-lynx rs6000/t-lynx"
 	extra_options="${extra_options} rs6000/sysv4.opt lynx.opt"
-	extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
 	thread_file=lynx
 	gnu_ld=yes
 	gas=yes
@@ -2202,7 +2157,6 @@ s390x-ibm-tpf*)
         md_file=s390/s390.md
         extra_modes=s390/s390-modes.def
         out_file=s390/s390.c
-        extra_parts="crtbeginS.o crtendS.o"
         thread_file='tpf'
 	extra_options="${extra_options} s390/tpf.opt"
 	;;
@@ -2210,13 +2164,11 @@ score-*-elf)
 	gas=yes
 	gnu_ld=yes
         tm_file="dbxelf.h elfos.h score/elf.h score/score.h newlib-stdint.h"
-	extra_parts="crti.o crtn.o crtbegin.o crtend.o"
-        tmake_file="${tmake_file} score/t-score-elf"
         ;;
 sh-*-elf* | sh[12346l]*-*-elf* | \
   sh-*-linux* | sh[2346lbe]*-*-linux* | \
   sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
-   sh64-*-netbsd* | sh64l*-*-netbsd*)
+  sh64-*-netbsd* | sh64l*-*-netbsd*)
 	tmake_file="${tmake_file} sh/t-sh sh/t-elf"
 	if test x${with_endian} = x; then
 		case ${target} in
@@ -2257,7 +2209,6 @@ sh-*-elf* | sh[12346l]*-*-elf* | \
                         fi
 			tm_file="${tm_file} sh/embed-elf.h"
 			tm_file="${tm_file} sh/superh.h"
-			tmake_file="${tmake_file} sh/t-superh"
 			extra_options="${extra_options} sh/superh.opt" ;;
 	*)		if test x$with_newlib = xyes \
 			   && test x$with_libgloss = xyes; then
@@ -2278,7 +2229,7 @@ sh-*-elf* | sh[12346l]*-*-elf* | \
                 tmake_file="${tmake_file} sh/t-netbsd"
 		;;
 	sh64*-*-linux*)
-		tmake_file="${tmake_file} sh/t-sh64 sh/t-linux64"
+		tmake_file="${tmake_file} sh/t-sh64"
 		tm_file="${tm_file} sh/sh64.h"
 		extra_headers="shmedia.h ushmedia.h sshmedia.h"
 		;;
@@ -2392,11 +2343,11 @@ sh-*-elf* | sh[12346l]*-*-elf* | \
 	tmake_file="$tmake_file t-sysroot-suffix"
 	;;
 sh-*-rtems*)
-	tmake_file="sh/t-sh sh/t-elf t-rtems sh/t-rtems"
+	tmake_file="sh/t-sh t-rtems sh/t-rtems"
 	tm_file="${tm_file} dbxelf.h elfos.h sh/elf.h sh/embed-elf.h sh/rtemself.h rtems.h newlib-stdint.h"
 	;;
 sh-wrs-vxworks)
-	tmake_file="$tmake_file sh/t-sh sh/t-elf sh/t-vxworks"
+	tmake_file="$tmake_file sh/t-sh sh/t-vxworks"
 	tm_file="${tm_file} elfos.h sh/elf.h sh/embed-elf.h vx-common.h vxworks.h sh/vxworks.h"
 	;;
 sparc-*-elf*)
@@ -2437,7 +2388,6 @@ sparc-*-linux*)
 	else
 		tm_file="${tm_file} sparc/linux.h"
 	fi
-	extra_parts="${extra_parts} crtfastmath.o"
 	;;
 sparc-*-netbsdelf*)
 	tm_file="${tm_file} dbxelf.h elfos.h sparc/sysv4.h netbsd.h netbsd-elf.h sparc/netbsd-elf.h"
@@ -2475,7 +2425,6 @@ sparc64-*-linux*)
 	tm_file="sparc/biarch64.h ${tm_file} dbxelf.h elfos.h sparc/sysv4.h gnu-user.h linux.h glibc-stdint.h sparc/default-64.h sparc/linux64.h"
 	extra_options="${extra_options} sparc/long-double-switch.opt"
 	tmake_file="${tmake_file} sparc/t-sparc sparc/t-linux64"
-	extra_parts="${extra_parts} crtfastmath.o"
 	;;
 sparc64-*-freebsd*|ultrasparc-*-freebsd*)
 	tm_file="${tm_file} ${fbsd_tm_file} dbxelf.h elfos.h sparc/sysv4.h sparc/freebsd.h"
@@ -2485,7 +2434,6 @@ sparc64-*-freebsd*|ultrasparc-*-freebsd*
 		x) with_cpu=ultrasparc ;;
 		*) echo "$with_cpu not supported for freebsd target"; exit 1 ;;
 	esac
-	extra_parts="${extra_parts} crtfastmath.o"
 	tmake_file="${tmake_file} sparc/t-sparc"
 	;;
 sparc64-*-netbsd*)
@@ -2579,7 +2527,6 @@ xstormy16-*-elf)
 	out_file=stormy16/stormy16.c
 	extra_options=stormy16/stormy16.opt
 	tmake_file="stormy16/t-stormy16"
-	extra_parts="crtbegin.o crtend.o"
 	;;
 xtensa*-*-elf*)
 	tm_file="${tm_file} dbxelf.h elfos.h newlib-stdint.h xtensa/elf.h"
@@ -2588,12 +2535,11 @@ xtensa*-*-elf*)
 	;;
 xtensa*-*-linux*)
 	tm_file="${tm_file} dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h xtensa/linux.h"
-	tmake_file="${tmake_file} xtensa/t-xtensa xtensa/t-linux"
+	tmake_file="${tmake_file} xtensa/t-xtensa"
 	;;
 am33_2.0-*-linux*)
 	tm_file="mn10300/mn10300.h dbxelf.h elfos.h gnu-user.h linux.h glibc-stdint.h mn10300/linux.h"
 	gas=yes gnu_ld=yes
-	extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
 	use_collect2=no
 	;;
 m32c-*-rtems*)
diff --git a/gcc/config/alpha/t-vms b/gcc/config/alpha/t-vms
--- a/gcc/config/alpha/t-vms
+++ b/gcc/config/alpha/t-vms
@@ -19,17 +19,6 @@
 
 LIB2FUNCS_EXTRA = $(srcdir)/config/alpha/vms-gcc_shell_handler.c
 
-EXTRA_PARTS = vms-dwarf2.o vms-dwarf2eh.o $(VMS_EXTRA_PARTS) \
-  crtbegin.o crtbeginS.o crtend.o crtendS.o
-
-# This object must be linked with in order to make the executable debuggable.
-# vms-ld handles it automatically when passed -g.
-$(T)vms-dwarf2.o : $(srcdir)/config/alpha/vms-dwarf2.asm
-	$(GCC_FOR_TARGET) -c -x assembler $< -o $@
-
-$(T)vms-dwarf2eh.o : $(srcdir)/config/alpha/vms-dwarf2eh.asm
-	$(GCC_FOR_TARGET) -c -x assembler $< -o $@
-
 MULTILIB_OPTIONS = mcpu=ev6
 MULTILIB_DIRNAMES = ev6
 MULTILIB_OSDIRNAMES = ev6
diff --git a/gcc/config/arm/t-arm-elf b/gcc/config/arm/t-arm-elf
--- a/gcc/config/arm/t-arm-elf
+++ b/gcc/config/arm/t-arm-elf
@@ -104,11 +104,6 @@ MULTILIB_EXCEPTIONS    += *mthumb/*mfloa
 # MULTILIB_MATCHES    += mcpu?arm7=mcpu?arm610
 # MULTILIB_MATCHES    += mcpu?arm7=mcpu?arm620
 
-EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crti.o crtn.o
-
-# If EXTRA_MULTILIB_PARTS is not defined above then define EXTRA_PARTS here
-# EXTRA_PARTS = crtbegin.o crtend.o crti.o crtn.o
-
 LIBGCC = stmp-multilib
 INSTALL_LIBGCC = install-multilib
 
@@ -116,13 +111,3 @@ INSTALL_LIBGCC = install-multilib
 # or scheduling code that is breaking _fpmul_parts in fp-bit.c.
 # Disabling function inlining is a workaround for this problem.
 TARGET_LIBGCC2_CFLAGS = -fno-inline
-
-# Assemble startup files.
-$(T)crti.o: $(srcdir)/config/arm/crti.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-	-c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/arm/crti.asm
-
-$(T)crtn.o: $(srcdir)/config/arm/crtn.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-	-c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/arm/crtn.asm
-
diff --git a/gcc/config/arm/t-linux b/gcc/config/arm/t-linux
--- a/gcc/config/arm/t-linux
+++ b/gcc/config/arm/t-linux
@@ -28,7 +28,5 @@ LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3
 # MULTILIB_OPTIONS = mfloat-abi=hard/mfloat-abi=soft
 # MULTILIB_DIRNAMES = hard-float soft-float
 
-# EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o
-
 # LIBGCC = stmp-multilib
 # INSTALL_LIBGCC = install-multilib
diff --git a/gcc/config/arm/t-linux-eabi b/gcc/config/arm/t-linux-eabi
--- a/gcc/config/arm/t-linux-eabi
+++ b/gcc/config/arm/t-linux-eabi
@@ -1,4 +1,4 @@
-# Copyright (C) 2005, 2009, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2005, 2009, 2010, 2011 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -31,9 +31,5 @@ MULTILIB_DIRNAMES	=
 # Use a version of div0 which raises SIGFPE, and a special __clear_cache.
 LIB1ASMFUNCS := $(filter-out _dvmd_tls,$(LIB1ASMFUNCS)) _dvmd_lnx _clear_cache
 
-# Multilib the standard Linux files.  Don't include crti.o or crtn.o,
-# which are provided by glibc.
-EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
-
 LIB2FUNCS_STATIC_EXTRA += $(srcdir)/config/arm/linux-atomic.c
 LIB2FUNCS_STATIC_EXTRA += $(srcdir)/config/arm/linux-atomic-64bit.c
diff --git a/gcc/config/arm/t-strongarm-elf b/gcc/config/arm/t-strongarm-elf
--- a/gcc/config/arm/t-strongarm-elf
+++ b/gcc/config/arm/t-strongarm-elf
@@ -23,7 +23,6 @@ MULTILIB_OPTIONS     = mlittle-endian/mb
 MULTILIB_DIRNAMES    = le be fpu soft
 MULTILIB_EXCEPTIONS  =
 MULTILIB_MATCHES     = mbig-endian=mbe mlittle-endian=mle
-EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crti.o crtn.o
 
 LIBGCC = stmp-multilib
 INSTALL_LIBGCC = install-multilib
@@ -32,12 +31,3 @@ INSTALL_LIBGCC = install-multilib
 # or scheduling code that is breaking _fpmul_parts in fp-bit.c.
 # Disabling function inlining is a workaround for this problem.
 TARGET_LIBGCC2_CFLAGS = -fno-inline
-
-# Assemble startup files.
-$(T)crti.o: $(srcdir)/config/arm/crti.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-	-c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/arm/crti.asm
-
-$(T)crtn.o: $(srcdir)/config/arm/crtn.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-	-c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/arm/crtn.asm
diff --git a/gcc/config/arm/t-symbian b/gcc/config/arm/t-symbian
--- a/gcc/config/arm/t-symbian
+++ b/gcc/config/arm/t-symbian
@@ -40,6 +40,3 @@ LIB2FUNCS_STATIC_EXTRA = $(srcdir)/confi
 # enabled, so there are no separate thumb-mode libraries.
 MULTILIB_OPTIONS     = mfloat-abi=softfp
 MULTILIB_DIRNAMES    = softfp
-
-# Symbian OS provides its own startup code.
-EXTRA_MULTILIB_PARTS=
diff --git a/gcc/config/bfin/t-bfin b/gcc/config/bfin/t-bfin
--- a/gcc/config/bfin/t-bfin
+++ b/gcc/config/bfin/t-bfin
@@ -21,14 +21,3 @@
 LIB1ASMSRC = bfin/lib1funcs.asm
 LIB1ASMFUNCS = _divsi3 _udivsi3 _umodsi3 _modsi3 _muldi3 _umulsi3_highpart
 LIB1ASMFUNCS += _smulsi3_highpart
-
-EXTRA_PARTS = crtbegin.o crtend.o crti.o crtn.o
-
-# Assemble startup files.
-$(T)crti.o: $(srcdir)/config/bfin/crti.s $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-	-c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/bfin/crti.s
-
-$(T)crtn.o: $(srcdir)/config/bfin/crtn.s $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-	-c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/bfin/crtn.s
diff --git a/gcc/config/bfin/t-bfin-elf b/gcc/config/bfin/t-bfin-elf
--- a/gcc/config/bfin/t-bfin-elf
+++ b/gcc/config/bfin/t-bfin-elf
@@ -22,7 +22,6 @@ LIB1ASMSRC = bfin/lib1funcs.asm
 LIB1ASMFUNCS = _divsi3 _udivsi3 _umodsi3 _modsi3 _muldi3 _umulsi3_highpart
 LIB1ASMFUNCS += _smulsi3_highpart
 
-CRTSTUFF_T_CFLAGS = -fpic
 TARGET_LIBGCC2_CFLAGS = -fpic
 
 MULTILIB_OPTIONS=mcpu=bf532-none
@@ -54,19 +53,3 @@ MULTILIB_EXCEPTIONS=mleaf-id-shared-libr
 MULTILIB_EXCEPTIONS+=mcpu=bf532-none/mleaf-id-shared-library*
 MULTILIB_EXCEPTIONS+=*mfdpic/mleaf-id-shared-library*
 MULTILIB_EXCEPTIONS+=*msep-data/mleaf-id-shared-library*
-
-# Assemble startup files.
-$(T)crti.o: $(srcdir)/config/bfin/crti.s $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-	-c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/bfin/crti.s
-
-$(T)crtn.o: $(srcdir)/config/bfin/crtn.s $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-	-c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/bfin/crtn.s
-
-$(T)crtlibid.o: $(srcdir)/config/bfin/crtlibid.s $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-	-c -o $(T)crtlibid.o -x assembler-with-cpp \
-	$(srcdir)/config/bfin/crtlibid.s
-
-EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crtbeginS.o crtendS.o crti.o crtn.o crtlibid.o
diff --git a/gcc/config/bfin/t-bfin-linux b/gcc/config/bfin/t-bfin-linux
--- a/gcc/config/bfin/t-bfin-linux
+++ b/gcc/config/bfin/t-bfin-linux
@@ -22,7 +22,6 @@ LIB1ASMSRC = bfin/lib1funcs.asm
 LIB1ASMFUNCS = _divsi3 _udivsi3 _umodsi3 _modsi3 _muldi3 _umulsi3_highpart
 LIB1ASMFUNCS += _smulsi3_highpart
 
-CRTSTUFF_T_CFLAGS = -fpic
 TARGET_LIBGCC2_CFLAGS = -fpic
 
 MULTILIB_OPTIONS=mcpu=bf532-none
@@ -49,8 +48,6 @@ MULTILIB_MATCHES+=mcpu?bf532-none=mcpu?b
 MULTILIB_MATCHES+=mcpu?bf532-none=mcpu?bf561-none
 MULTILIB_MATCHES+=mcpu?bf532-none=mcpu?bf592-none
 
-EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crtbeginS.o crtendS.o
-
 # This rule uses MULTILIB_MATCHES to generate a definition of
 # SYSROOT_SUFFIX_SPEC.
 linux-sysroot-suffix.h: $(srcdir)/config/bfin/print-sysroot-suffix.sh
diff --git a/gcc/config/bfin/t-bfin-uclinux b/gcc/config/bfin/t-bfin-uclinux
--- a/gcc/config/bfin/t-bfin-uclinux
+++ b/gcc/config/bfin/t-bfin-uclinux
@@ -22,7 +22,6 @@ LIB1ASMSRC = bfin/lib1funcs.asm
 LIB1ASMFUNCS = _divsi3 _udivsi3 _umodsi3 _modsi3 _muldi3 _umulsi3_highpart
 LIB1ASMFUNCS += _smulsi3_highpart
 
-CRTSTUFF_T_CFLAGS = -fpic
 TARGET_LIBGCC2_CFLAGS = -fpic
 
 MULTILIB_OPTIONS=mcpu=bf532-none
@@ -53,11 +52,3 @@ MULTILIB_MATCHES+=mcpu?bf532-none=mcpu?b
 MULTILIB_EXCEPTIONS=mleaf-id-shared-library*
 MULTILIB_EXCEPTIONS+=mcpu=bf532-none/mleaf-id-shared-library*
 MULTILIB_EXCEPTIONS+=*msep-data/mleaf-id-shared-library*
-
-# Assemble startup files.
-$(T)crtlibid.o: $(srcdir)/config/bfin/crtlibid.s $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-	-c -o $(T)crtlibid.o -x assembler-with-cpp \
-	$(srcdir)/config/bfin/crtlibid.s
-
-EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crtbeginS.o crtendS.o crtlibid.o
diff --git a/gcc/config/c6x/t-c6x-elf b/gcc/config/c6x/t-c6x-elf
--- a/gcc/config/c6x/t-c6x-elf
+++ b/gcc/config/c6x/t-c6x-elf
@@ -46,20 +46,5 @@ MULTILIB_DIRNAMES    = be c674x
 MULTILIB_EXCEPTIONS  =
 MULTILIB_MATCHES     =
 
-# Assemble startup files.
-$(T)crti.o: $(srcdir)/config/c6x/crti.s $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-	-c -o $(T)crti.o $(CRTSTUFF_T_CFLAGS) -x assembler-with-cpp \
-	$(srcdir)/config/c6x/crti.s
-
-$(T)crtn.o: $(srcdir)/config/c6x/crtn.s $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-	-c -o $(T)crtn.o $(CRTSTUFF_T_CFLAGS) -x assembler-with-cpp \
-	$(srcdir)/config/c6x/crtn.s
-
-EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crtbeginS.o crtendS.o crti.o crtn.o
-
 # Avoid failures when the user's GOT becomes too large.
-CRTSTUFF_T_CFLAGS = -msdata=none
-CRTSTUFF_T_CFLAGS_S = -msdata=none
 TARGET_LIBGCC2_CFLAGS = -msdata=none
diff --git a/gcc/config/c6x/t-c6x-uclinux b/gcc/config/c6x/t-c6x-uclinux
--- a/gcc/config/c6x/t-c6x-uclinux
+++ b/gcc/config/c6x/t-c6x-uclinux
@@ -2,6 +2,4 @@ MULTILIB_OSDIRNAMES    = march.c674x=!c6
 MULTILIB_OSDIRNAMES   += mbig-endian=!be
 MULTILIB_OSDIRNAMES   += mbig-endian/march.c674x=!be/c674x
 
-CRTSTUFF_T_CFLAGS = -fPIC -msdata=none
-CRTSTUFF_T_CFLAGS_S = -fPIC -msdata=none
 TARGET_LIBGCC2_CFLAGS = -fPIC -msdata=none
diff --git a/gcc/config/cris/t-elfmulti b/gcc/config/cris/t-elfmulti
--- a/gcc/config/cris/t-elfmulti
+++ b/gcc/config/cris/t-elfmulti
@@ -31,4 +31,3 @@ MULTILIB_MATCHES = \
 MULTILIB_EXTRA_OPTS = mbest-lib-options
 INSTALL_LIBGCC = install-multilib
 LIBGCC = stmp-multilib
-CRTSTUFF_T_CFLAGS = -moverride-best-lib-options
diff --git a/gcc/config/cris/t-linux b/gcc/config/cris/t-linux
--- a/gcc/config/cris/t-linux
+++ b/gcc/config/cris/t-linux
@@ -1,5 +1,4 @@
 TARGET_LIBGCC2_CFLAGS += -fPIC
-CRTSTUFF_T_CFLAGS_S = $(TARGET_LIBGCC2_CFLAGS)
 
 # We *know* we have a limits.h in the glibc library, with extra
 # definitions needed for e.g. libgfortran.
diff --git a/gcc/config/fr30/t-fr30 b/gcc/config/fr30/t-fr30
--- a/gcc/config/fr30/t-fr30
+++ b/gcc/config/fr30/t-fr30
@@ -19,13 +19,6 @@
 LIB1ASMSRC    = fr30/lib1funcs.asm
 LIB1ASMFUNCS  = _udivsi3 _divsi3 _umodsi3 _modsi3
 
-# Assemble startup files.
-$(T)crti.o: $(srcdir)/config/fr30/crti.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) -c -o $(T)crti.o -x assembler $(srcdir)/config/fr30/crti.asm
-
-$(T)crtn.o: $(srcdir)/config/fr30/crtn.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) -c -o $(T)crtn.o -x assembler $(srcdir)/config/fr30/crtn.asm
-
 # If any special flags are necessary when building libgcc2 put them here.
 #
 # TARGET_LIBGCC2_CFLAGS
diff --git a/gcc/config/frv/t-frv b/gcc/config/frv/t-frv
--- a/gcc/config/frv/t-frv
+++ b/gcc/config/frv/t-frv
@@ -57,25 +57,6 @@ ulltof.c: $(srcdir)/config/frv/ulltof.c
 ulltod.c: $(srcdir)/config/frv/ulltod.c
 	$(LN_S) $(srcdir)/config/frv/ulltod.c .
 
-# Build frvbegin.o and frvend.o
-EXTRA_MULTILIB_PARTS=frvbegin.o frvend.o
-
-# Compile two additional files that are linked with every program
-# linked using GCC on systems using COFF or ELF, for the sake of C++
-# constructors.
-
-FRVSTUFF_CFLAGS = $(TARGET_LIBGCC2_CFLAGS)
-
-$(T)frvbegin$(objext): $(srcdir)/config/frv/frvbegin.c $(GCC_PASSES) \
-  $(CONFIG_H) defaults.h $(srcdir)/../libgcc/unwind-dw2-fde.h gbl-ctors.h
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) $(FRVSTUFF_CFLAGS) \
-	  -c $(srcdir)/config/frv/frvbegin.c -o $(T)frvbegin$(objext)
-
-$(T)frvend$(objext): $(srcdir)/config/frv/frvend.c $(GCC_PASSES) \
-  $(CONFIG_H) defaults.h $(srcdir)/../libgcc/unwind-dw2-fde.h gbl-ctors.h
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) $(FRVSTUFF_CFLAGS) \
-	  -c $(srcdir)/config/frv/frvend.c -o $(T)frvend$(objext)
-
 # Enable the following if multilibs are needed.
 # See gcc/genmultilib, gcc/gcc.texi and gcc/tm.texi for a
 # description of the options and their values.
diff --git a/gcc/config/frv/t-linux b/gcc/config/frv/t-linux
--- a/gcc/config/frv/t-linux
+++ b/gcc/config/frv/t-linux
@@ -23,8 +23,4 @@ MULTILIB_MATCHES=
 MULTILIB_EXCEPTIONS=
 MULTILIB_EXTRA_OPTS=
 
-# We don't use frvbegin.o or frvend.o.
-EXTRA_MULTILIB_PARTS =
-
-CRTSTUFF_T_CFLAGS = -fPIC
 TARGET_LIBGCC2_CFLAGS = -fPIC
diff --git a/gcc/config/h8300/t-elf b/gcc/config/h8300/t-elf
deleted file mode 100644
--- a/gcc/config/h8300/t-elf
+++ /dev/null
@@ -1,6 +0,0 @@
-EXTRA_MULTILIB_PARTS= crti.o crtn.o crtbegin.o crtend.o
-
-$(T)crti.o: $(srcdir)/config/h8300/crti.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/h8300/crti.asm
-$(T)crtn.o: $(srcdir)/config/h8300/crtn.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/h8300/crtn.asm
diff --git a/gcc/config/i386/t-crtstuff b/gcc/config/i386/t-crtstuff
deleted file mode 100644
--- a/gcc/config/i386/t-crtstuff
+++ /dev/null
@@ -1,7 +0,0 @@
-# The pushl in CTOR initialization interferes with frame pointer elimination.
-# crtend*.o cannot be compiled without -fno-asynchronous-unwind-tables,
-# because then __FRAME_END__ might not be the last thing in .eh_frame
-# section.  -fno-asynchronous-unwind-tables is off by default for i386
-# and is on by default for x86-64.  We turn it off for both i386 and
-# x86-64.
-CRTSTUFF_T_CFLAGS += -fno-omit-frame-pointer -fno-asynchronous-unwind-tables
diff --git a/gcc/config/i386/t-i386elf b/gcc/config/i386/t-i386elf
deleted file mode 100644
--- a/gcc/config/i386/t-i386elf
+++ /dev/null
@@ -1,4 +0,0 @@
-# For svr4 we build crtbegin.o and crtend.o which serve to add begin and
-# end labels to the .ctors and .dtors section when we link using gcc.
-
-EXTRA_PARTS=crtbegin.o crtend.o
diff --git a/gcc/config/i386/t-linux64 b/gcc/config/i386/t-linux64
--- a/gcc/config/i386/t-linux64
+++ b/gcc/config/i386/t-linux64
@@ -40,7 +40,3 @@ MULTILIB_OSDIRNAMES+= mx32=../libx32
 
 LIBGCC = stmp-multilib
 INSTALL_LIBGCC = install-multilib
-
-EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crtbeginS.o crtendS.o \
-		     crtbeginT.o crtprec32.o crtprec64.o crtprec80.o \
-		     crtfastmath.o
diff --git a/gcc/config/i386/t-nto b/gcc/config/i386/t-nto
--- a/gcc/config/i386/t-nto
+++ b/gcc/config/i386/t-nto
@@ -1,4 +1,1 @@
-CRTSTUFF_T_CFLAGS = -fno-omit-frame-pointer -fPIC
 TARGET_LIBGCC2_CFLAGS = -fPIC -fexceptions
-
-EXTRA_PARTS = crtbegin.o
diff --git a/gcc/config/ia64/t-ia64 b/gcc/config/ia64/t-ia64
--- a/gcc/config/ia64/t-ia64
+++ b/gcc/config/ia64/t-ia64
@@ -38,9 +38,6 @@ LIB1ASMFUNCS  = __divxf3 __divdf3 __divs
 # to support the Intel assembler.
 #LIBGCC2_DEBUG_CFLAGS = -g1 -P
 
-# Effectively disable the crtbegin/end rules using crtstuff.c
-T = disable
-
 ia64-c.o: $(srcdir)/config/ia64/ia64-c.c $(CONFIG_H) $(SYSTEM_H) \
     coretypes.h $(TM_H) $(TREE_H) $(CPPLIB_H) $(C_COMMON_H) $(C_PRAGMA_H)
 	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
diff --git a/gcc/config/ia64/t-vms b/gcc/config/ia64/t-vms
deleted file mode 100644
--- a/gcc/config/ia64/t-vms
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright (C) 2009, 2011
-# Free Software Foundation, Inc.
-#
-# This file is part of GCC.
-#
-# GCC 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 3, or (at your option)
-# any later version.
-#
-# GCC 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 GCC; see the file COPYING3.  If not see
-# <http://www.gnu.org/licenses/>.
-
-# Enable the crtbegin/end rules disabled in t-ia64
-T =
-
-# VMS_EXTRA_PARTS is defined in x-vms and represent object files that
-# are only needed for VMS targets, but can only be compiled on a VMS host
-# (because they need DEC C).
-EXTRA_PARTS = $(VMS_EXTRA_PARTS) crtbegin.o crtbeginS.o crtend.o crtendS.o crtinitS.o
-
-CRTSTUFF_T_CFLAGS = -O0
-CRTSTUFF_T_CFLAGS_S = -O0
-
-$(T)crtinitS.o: $(srcdir)/config/ia64/vms-crtinit.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) -I. -c -o $(T)crtinitS.o -x assembler-with-cpp \
-		$(srcdir)/config/ia64/vms-crtinit.asm
diff --git a/gcc/config/m32c/t-m32c b/gcc/config/m32c/t-m32c
--- a/gcc/config/m32c/t-m32c
+++ b/gcc/config/m32c/t-m32c
@@ -53,5 +53,3 @@ m32c-pragma.o: $(srcdir)/config/m32c/m32
 MULTILIB_OPTIONS = mcpu=m32cm
 MULTILIB_DIRNAMES = m32cm
 MULTILIB_MATCHES = mcpu?m32cm=mcpu?m32c mcpu?r8c=mcpu?m16c
-
-EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o
diff --git a/gcc/config/m32r/t-linux b/gcc/config/m32r/t-linux
--- a/gcc/config/m32r/t-linux
+++ b/gcc/config/m32r/t-linux
@@ -24,15 +24,6 @@ CROSS_LIBGCC1 =
 
 TARGET_LIBGCC2_CFLAGS = -G 0 -fPIC
 
-# We need to use -fpic when we are using gcc to compile the routines in
-# initfini.c.  This is only really needed when we are going to use gcc/g++
-# to produce a shared library, but since we don't know ahead of time when
-# we will be doing that, we just always use -fpic when compiling the
-# routines in initfini.c.
-# -fpic currently isn't supported for the m32r.
-
-CRTSTUFF_T_CFLAGS_S = -fPIC
-
 # Don't install "assert.h" in gcc. We use the one in glibc.
 INSTALL_ASSERT_H =
  
diff --git a/gcc/config/m32r/t-m32r b/gcc/config/m32r/t-m32r
--- a/gcc/config/m32r/t-m32r
+++ b/gcc/config/m32r/t-m32r
@@ -22,35 +22,6 @@
 
 TARGET_LIBGCC2_CFLAGS = -G 0
 
-# We need to use -fpic when we are using gcc to compile the routines in
-# initfini.c.  This is only really needed when we are going to use gcc/g++
-# to produce a shared library, but since we don't know ahead of time when
-# we will be doing that, we just always use -fpic when compiling the
-# routines in initfini.c.
-# -fpic currently isn't supported for the m32r.
-
-CRTSTUFF_T_CFLAGS =
-
-# .init/.fini section routines
-
-$(T)crtinit.o: $(srcdir)/config/m32r/initfini.c $(GCC_PASSES) $(CONFIG_H)
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) \
-	$(CRTSTUFF_T_CFLAGS) $(INCLUDES) -DCRT_INIT \
-	-finhibit-size-directive -fno-inline-functions -g0 \
-	-mmodel=medium -c $(srcdir)/config/m32r/initfini.c \
-	-o $(T)crtinit.o 
-
-$(T)crtfini.o: $(srcdir)/config/m32r/initfini.c $(GCC_PASSES) $(CONFIG_H)
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) \
-	$(CRTSTUFF_T_CFLAGS) $(INCLUDES) -DCRT_FINI \
-	-finhibit-size-directive -fno-inline-functions -g0 \
-	-mmodel=medium -c $(srcdir)/config/m32r/initfini.c \
-	-o $(T)crtfini.o 
-m32rx:
-	mkdir $@
-m32r2:
-	mkdir $@
-
 # -mmodel={small,medium} requires separate libraries.
 # We don't build libraries for the large model, instead we use the medium
 # libraries.  The only difference is that the large model can handle jumps
@@ -65,7 +36,5 @@ MULTILIB_MATCHES = mmodel?medium=mmodel?
 # This is important for objects referenced in system header files.
 MULTILIB_EXTRA_OPTS = msdata=sdata
 
-EXTRA_MULTILIB_PARTS = crtinit.o crtfini.o
-
 LIBGCC = stmp-multilib
 INSTALL_LIBGCC = install-multilib
diff --git a/gcc/config/m68k/t-crtstuff b/gcc/config/m68k/t-crtstuff
deleted file mode 100644
--- a/gcc/config/m68k/t-crtstuff
+++ /dev/null
@@ -1,10 +0,0 @@
-EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crti.o crtn.o
-
-# Add flags here as required.
-CRTSTUFF_T_CFLAGS =
-
-# Assemble startup files.
-$(T)crti.o: $(srcdir)/config/m68k/crti.s $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crti.o $(srcdir)/config/m68k/crti.s
-$(T)crtn.o: $(srcdir)/config/m68k/crtn.s $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crtn.o $(srcdir)/config/m68k/crtn.s
diff --git a/gcc/config/m68k/t-linux b/gcc/config/m68k/t-linux
--- a/gcc/config/m68k/t-linux
+++ b/gcc/config/m68k/t-linux
@@ -1,4 +1,4 @@
-# Copyright (C) 2008, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2008, 2010, 2011 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -16,8 +16,6 @@
 # along with GCC; see the file COPYING3.  If not see
 # <http://www.gnu.org/licenses/>.
 
-EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
-
 # Only include multilibs for 680x0 and ColdFire CPUs with an MMU.
 M68K_MLIB_CPU += && ((CPU ~ "^m680") || (CPU ~ "^mcf")) && (FLAGS ~ "FL_MMU")
 
diff --git a/gcc/config/m68k/t-m68kelf b/gcc/config/m68k/t-m68kelf
deleted file mode 100644
--- a/gcc/config/m68k/t-m68kelf
+++ /dev/null
@@ -1,4 +0,0 @@
-# from ../t-svr4
-EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o
-# no pic for now
-#CRTSTUFF_T_CFLAGS=-fpic
diff --git a/gcc/config/m68k/t-uclinux b/gcc/config/m68k/t-uclinux
--- a/gcc/config/m68k/t-uclinux
+++ b/gcc/config/m68k/t-uclinux
@@ -1,4 +1,4 @@
-# Copyright (C) 2003, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2005, 2007, 2008, 2011 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -16,9 +16,6 @@
 # along with GCC; see the file COPYING3.  If not see
 # <http://www.gnu.org/licenses/>.
 
-# crti and crtn are provided by uClibc.
-EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o
-
 # Include multilibs for CPUs without an MMU or with FL_UCLINUX
 M68K_MLIB_CPU += && (!match(FLAGS, "FL_MMU") || match(FLAGS, "FL_UCLINUX"))
 
diff --git a/gcc/config/mcore/t-mcore b/gcc/config/mcore/t-mcore
--- a/gcc/config/mcore/t-mcore
+++ b/gcc/config/mcore/t-mcore
@@ -19,15 +19,6 @@
 LIB1ASMSRC    = mcore/lib1.asm
 LIB1ASMFUNCS  = _divsi3 _udivsi3 _modsi3 _umodsi3
 
-# Assemble startup files.
-$(T)crti.o: $(srcdir)/config/mcore/crti.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-	-c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/mcore/crti.asm
-
-$(T)crtn.o: $(srcdir)/config/mcore/crtn.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-	-c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/mcore/crtn.asm
-
 # could use -msifilter to be safe from interrupt/jmp interactions and others.
 TARGET_LIBGCC2_CFLAGS=-O3 -DNO_FLOATLIB_FIXUNSDFSI #-msifilter
 
@@ -37,21 +28,16 @@ CROSS_FLOAT_H = $(srcdir)/config/mcore/g
 # If support for -m4align is ever re-enabled then comment out the
 # following line and uncomment the mutlilib lines below.
 
-EXTRA_PARTS = crtbegin.o crtend.o crti.o crtn.o
-
 # MULTILIB_OPTIONS     = m8align/m4align
 # MULTILIB_DIRNAMES    = align8 align4
 # MULTILIB_MATCHES     = 
 # MULTILIB_EXTRA_OPTS  = 
 # MULTILIB_EXCEPTIONS  =
-# EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crti.o crtn.o
 # LIBGCC               = stmp-multilib
 # INSTALL_LIBGCC       = install-multilib
 
 MULTILIB_OPTIONS     = mbig-endian/mlittle-endian m210/m340
 MULTILIB_DIRNAMES    = big little m210 m340
 
-EXTRA_PARTS          =
-EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crti.o crtn.o
 LIBGCC               = stmp-multilib
 INSTALL_LIBGCC       = install-multilib
diff --git a/gcc/config/mep/t-mep b/gcc/config/mep/t-mep
--- a/gcc/config/mep/t-mep
+++ b/gcc/config/mep/t-mep
@@ -24,12 +24,6 @@
 
 GTM_H = tm.h $(tm_file_list) $(srcdir)/config/mep/mep-intrin.h insn-constants.h
 
-# Use -O0 instead of -O2 so we don't get complex relocations
-
-CRTSTUFF_CFLAGS = -O0 $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
-  -finhibit-size-directive -fno-inline-functions -fno-exceptions \
-  -fno-zero-initialized-in-bss -fno-unit-at-a-time
-
 TCFLAGS = -mlibrary
 
 mep-pragma.o: $(srcdir)/config/mep/mep-pragma.c $(CONFIG_H) $(SYSTEM_H) \
@@ -57,8 +51,6 @@ LIB2FUNCS_EXTRA = \
 MULTILIB_OPTIONS = mel mall-opts mfar
 MULTILIB_DIRNAMES = el allopt far
 
-EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o
-
 MD_INCLUDES = \
 	$(srcdir)/config/mep/intrinsics.md \
 	$(srcdir)/config/mep/predicates.md \
diff --git a/gcc/config/microblaze/t-microblaze b/gcc/config/microblaze/t-microblaze
--- a/gcc/config/microblaze/t-microblaze
+++ b/gcc/config/microblaze/t-microblaze
@@ -1,8 +1,3 @@
-# For C++ crtstuff
-EXTRA_MULTILIB_PARTS = crtbegin$(objext) crtend$(objext)
-
-EXTRA_PARTS += crti$(objext) crtn$(objext)
-
 MULTILIB_OPTIONS = mxl-barrel-shift mno-xl-soft-mul mxl-multiply-high
 MULTILIB_DIRNAMES = bs m mh
 MULTILIB_EXCEPTIONS = *mxl-barrel-shift/mxl-multiply-high mxl-multiply-high
@@ -13,10 +8,3 @@ microblaze-c.o: $(srcdir)/config/microbl
     $(CONFIG_H) $(SYSTEM_H) $(CPPLIB_H) $(TM_P_H) $(TREE_H) errors.h $(TM_H)
 	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
 	$(srcdir)/config/microblaze/microblaze-c.c
-
-# Assemble startup files
-$(T)crti$(objext): $(srcdir)/config/microblaze/crti.s
-	$(GCC_FOR_TARGET) -c $(srcdir)/config/microblaze/crti.s -o $(T)crti$(objext)
-
-$(T)crtn$(objext): $(srcdir)/config/microblaze/crtn.s
-	$(GCC_FOR_TARGET) -c $(srcdir)/config/microblaze/crtn.s -o $(T)crtn$(objext)
diff --git a/gcc/config/mips/t-elf b/gcc/config/mips/t-elf
--- a/gcc/config/mips/t-elf
+++ b/gcc/config/mips/t-elf
@@ -1,5 +1,5 @@
 # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2006,
-# 2007 Free Software Foundation, Inc.
+# 2007, 2011 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -17,18 +17,6 @@
 # along with GCC; see the file COPYING3.  If not see
 # <http://www.gnu.org/licenses/>.
 
-# Don't let CTOR_LIST end up in sdata section.
-CRTSTUFF_T_CFLAGS = -G 0
-
-# Assemble startup files.
-$(T)crti.o: $(srcdir)/config/mips/crti.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-	-c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/mips/crti.asm
-
-$(T)crtn.o: $(srcdir)/config/mips/crtn.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-	-c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/mips/crtn.asm
-
 # We must build libgcc2.a with -G 0, in case the user wants to link
 # without the $gp register.
 TARGET_LIBGCC2_CFLAGS = -G 0
@@ -38,7 +26,6 @@ TARGET_LIBGCC2_CFLAGS = -G 0
 MULTILIB_OPTIONS = msoft-float EL/EB
 MULTILIB_DIRNAMES = soft-float el eb
 MULTILIB_MATCHES = EL=mel EB=meb msingle-float=m4650
-EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crti.o crtn.o
 
 LIBGCC = stmp-multilib
 INSTALL_LIBGCC = install-multilib
diff --git a/gcc/config/mips/t-isa3264 b/gcc/config/mips/t-isa3264
--- a/gcc/config/mips/t-isa3264
+++ b/gcc/config/mips/t-isa3264
@@ -1,5 +1,5 @@
 # Copyright (C) 2001, 2002, 2003, 2004, 2007,
-# 2008 Free Software Foundation, Inc.
+# 2008, 2011 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -17,18 +17,6 @@
 # along with GCC; see the file COPYING3.  If not see
 # <http://www.gnu.org/licenses/>.
 
-# Don't let CTOR_LIST end up in sdata section.
-CRTSTUFF_T_CFLAGS = -G 0
-
-# Assemble startup files.
-$(T)crti.o: $(srcdir)/config/mips/crti.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-	-c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/mips/crti.asm
-
-$(T)crtn.o: $(srcdir)/config/mips/crtn.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-	-c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/mips/crtn.asm
-
 # We must build libgcc2.a with -G 0, in case the user wants to link
 # without the $gp register.
 TARGET_LIBGCC2_CFLAGS = -G 0
@@ -48,7 +36,6 @@ MULTILIB_EXCLUSIONS = !mips32r2/mfp64
 endif
 endif
 MULTILIB_MATCHES = EL=mel EB=meb
-EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crti.o crtn.o
 
 LIBGCC = stmp-multilib
 INSTALL_LIBGCC = install-multilib
diff --git a/gcc/config/mips/t-linux64 b/gcc/config/mips/t-linux64
--- a/gcc/config/mips/t-linux64
+++ b/gcc/config/mips/t-linux64
@@ -19,5 +19,3 @@
 MULTILIB_OPTIONS = mabi=n32/mabi=32/mabi=64
 MULTILIB_DIRNAMES = n32 32 64
 MULTILIB_OSDIRNAMES = ../lib32 ../lib ../lib64
-
-EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
diff --git a/gcc/config/mips/t-r3900 b/gcc/config/mips/t-r3900
--- a/gcc/config/mips/t-r3900
+++ b/gcc/config/mips/t-r3900
@@ -1,5 +1,5 @@
 # Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2007 Free Software Foundation, Inc.
+# 2007, 2011 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -21,10 +21,6 @@
 # without the $gp register.
 TARGET_LIBGCC2_CFLAGS = -G 0
 
-EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o
-# Don't let CTOR_LIST end up in sdata section.
-CRTSTUFF_T_CFLAGS = -G 0
-
 # Build the libraries for both hard and soft floating point
 
 MULTILIB_OPTIONS = msoft-float EL/EB
diff --git a/gcc/config/mips/t-sde b/gcc/config/mips/t-sde
--- a/gcc/config/mips/t-sde
+++ b/gcc/config/mips/t-sde
@@ -1,4 +1,4 @@
-# Copyright (C) 2007, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2007, 2008, 2011 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -16,18 +16,6 @@
 # along with GCC; see the file COPYING3.  If not see
 # <http://www.gnu.org/licenses/>.
 
-# Don't let CTOR_LIST end up in sdata section.
-CRTSTUFF_T_CFLAGS = -G 0
-
-# Assemble startup files.
-$(T)crti.o: $(srcdir)/config/mips/crti.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-	-c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/mips/crti.asm
-
-$(T)crtn.o: $(srcdir)/config/mips/crtn.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-	-c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/mips/crtn.asm
-
 MULTILIB_OPTIONS = EL/EB mips32/mips32r2/mips64/mips64r2 mips16 msoft-float/mfp64 mcode-readable=no
 MULTILIB_DIRNAMES = el eb mips32 mips32r2 mips64 mips64r2 mips16 sof f64 spram
 MULTILIB_MATCHES = EL=mel EB=meb
@@ -46,8 +34,6 @@ else
 MULTILIB_EXCLUSIONS += mips64/mips16 mips64r2/mips16
 endif
 
-EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crti.o crtn.o
-
 # Build the multilibs.
 LIBGCC = stmp-multilib
 INSTALL_LIBGCC = install-multilib
diff --git a/gcc/config/mips/t-sr71k b/gcc/config/mips/t-sr71k
--- a/gcc/config/mips/t-sr71k
+++ b/gcc/config/mips/t-sr71k
@@ -21,19 +21,6 @@
 LIBGCC1 =
 CROSS_LIBGCC1 =
 
-EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crti.o crtn.o
-# Don't let CTOR_LIST end up in sdata section.
-CRTSTUFF_T_CFLAGS = -G 0
-
-# Assemble startup files.
-$(T)crti.o: $(srcdir)/config/mips/crti.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-	-c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/mips/crti.asm
-
-$(T)crtn.o: $(srcdir)/config/mips/crtn.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-	-c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/mips/crtn.asm
-
 # We must build libgcc2.a with -G 0, in case the user wants to link
 # without the $gp register.
 TARGET_LIBGCC2_CFLAGS = -G 0
diff --git a/gcc/config/mips/t-st b/gcc/config/mips/t-st
--- a/gcc/config/mips/t-st
+++ b/gcc/config/mips/t-st
@@ -1,4 +1,4 @@
-# Copyright (C) 2008 Free Software Foundation, Inc.
+# Copyright (C) 2008, 2011 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -28,5 +28,3 @@ MULTILIB_OSDIRNAMES += march.loongson2f/
 MULTILIB_OSDIRNAMES += mabi.n32=../lib32
 MULTILIB_OSDIRNAMES += mabi.32=../lib
 MULTILIB_OSDIRNAMES += mabi.64=../lib64
-
-EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
diff --git a/gcc/config/mips/t-vr b/gcc/config/mips/t-vr
--- a/gcc/config/mips/t-vr
+++ b/gcc/config/mips/t-vr
@@ -1,4 +1,4 @@
-# Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2004, 2005, 2011 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -18,25 +18,12 @@
 
 # BEGIN boiler-plate MIPS stuff
 
-# Don't let CTOR_LIST end up in sdata section.
-CRTSTUFF_T_CFLAGS = -G 0
-
 # We must build libgcc2.a with -G 0, in case the user wants to link
 # without the $gp register.
 TARGET_LIBGCC2_CFLAGS = -G 0
 
 LIB2FUNCS_STATIC_EXTRA = $(srcdir)/config/mips/mips16.S \
 			 $(srcdir)/config/mips/vr4120-div.S
-EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crti.o crtn.o
-
-# Assemble startup files.
-$(T)crti.o: $(srcdir)/config/mips/crti.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-	-c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/mips/crti.asm
-
-$(T)crtn.o: $(srcdir)/config/mips/crtn.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-	-c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/mips/crtn.asm
 
 # END boiler-plate
 
diff --git a/gcc/config/mmix/t-mmix b/gcc/config/mmix/t-mmix
--- a/gcc/config/mmix/t-mmix
+++ b/gcc/config/mmix/t-mmix
@@ -1,4 +1,4 @@
-# Copyright (C) 2001, 2002, 2003, 2010 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2002, 2003, 2010, 2011 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -20,12 +20,5 @@
 
 TARGET_LIBGCC2_CFLAGS = -mlibfuncs -O2
 
-# We need to turn off some assumptions on normality for code in crtstuff.c
-# and crt{i,n}.asm, specifically about execution not continuing past the
-# end of the section in the file being compiled.  Thus we must stop the
-# assembler from generating stubbable PUSHJ relocs, because that will add
-# stubs at the end of the current section when necessary.
-CRTSTUFF_T_CFLAGS = -Wa,--no-stubs
-
 MULTILIB_OPTIONS = mabi=gnu
 MULTILIB_DIRNAMES = gnuabi
diff --git a/gcc/config/moxie/crti.asm b/gcc/config/moxie/crti.asm
deleted file mode 100644
--- a/gcc/config/moxie/crti.asm
+++ /dev/null
@@ -1,40 +0,0 @@
-# crti.asm for moxie
-#
-#   Copyright (C) 2009 Free Software Foundation
-# 
-# This file 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 3, or (at your option) any
-# later version.
-# 
-# This file 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.
-# 
-# Under Section 7 of GPL version 3, you are granted additional
-# permissions described in the GCC Runtime Library Exception, version
-# 3.1, as published by the Free Software Foundation.
-#
-# You should have received a copy of the GNU General Public License and
-# a copy of the GCC Runtime Library Exception along with this program;
-# see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
-# <http://www.gnu.org/licenses/>.
-
-# This file just make a stack frame for the contents of the .fini and
-# .init sections.  Users may put any desired instructions in those
-# sections.
-
-	.file		"crti.asm"
-
-	.section	".init"
-	.global	_init
-	.type	_init, @function	
-	.p2align	1
-_init:
-
-	.section	".fini"
-	.global	_fini
-	.type	_fini,@function
-	.p2align	1
-_fini:
diff --git a/gcc/config/moxie/crtn.asm b/gcc/config/moxie/crtn.asm
deleted file mode 100644
--- a/gcc/config/moxie/crtn.asm
+++ /dev/null
@@ -1,34 +0,0 @@
-# crtn.asm for moxie
-# 
-#   Copyright (C) 2009 Free Software Foundation
-# 
-# This file 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 3, or (at your option) any
-# later version.
-# 
-# This file 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.
-# 
-# Under Section 7 of GPL version 3, you are granted additional
-# permissions described in the GCC Runtime Library Exception, version
-# 3.1, as published by the Free Software Foundation.
-#
-# You should have received a copy of the GNU General Public License and
-# a copy of the GCC Runtime Library Exception along with this program;
-# see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
-# <http://www.gnu.org/licenses/>.
-
-# This file just makes sure that the .fini and .init sections do in
-# fact return.  Users may put any desired instructions in those sections.
-# This file is the last thing linked into any executable.
-
-	.file		"crtn.asm"
-
-	.section	".init"
-	ret
-	
-	.section	".fini"
-	ret
diff --git a/gcc/config/pa/t-linux b/gcc/config/pa/t-linux
--- a/gcc/config/pa/t-linux
+++ b/gcc/config/pa/t-linux
@@ -1,4 +1,4 @@
-# Copyright (C) 1999, 2001, 2002, 2008 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2001, 2002, 2008, 2011 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -32,6 +32,3 @@ LIB2FUNCS_STATIC_EXTRA = $(srcdir)/confi
 fptr.c: $(srcdir)/config/pa/fptr.c
 	rm -f fptr.c
 	cp $(srcdir)/config/pa/fptr.c .
-
-# Compile crtbeginS.o and crtendS.o as PIC.
-CRTSTUFF_T_CFLAGS_S = -fPIC
diff --git a/gcc/config/pa/t-linux64 b/gcc/config/pa/t-linux64
--- a/gcc/config/pa/t-linux64
+++ b/gcc/config/pa/t-linux64
@@ -1,4 +1,4 @@
-# Copyright (C) 2001, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2001, 2008, 2011 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -22,10 +22,6 @@
 LIB1ASMFUNCS =  _divI _divU _remI _remU _div_const _mulI
 LIB1ASMSRC = pa/milli64.S
 
-# Compile crtbeginS.o and crtendS.o as PIC.
-# Actually, hppa64 is always PIC but adding -fPIC does no harm.
-CRTSTUFF_T_CFLAGS_S = -fPIC
-
 LIB2FUNCS_STATIC_EXTRA = $(srcdir)/config/pa/linux-atomic.c
 
 # Compile libgcc2.a as PIC.
diff --git a/gcc/config/pa/t-pa-hpux11 b/gcc/config/pa/t-pa-hpux11
--- a/gcc/config/pa/t-pa-hpux11
+++ b/gcc/config/pa/t-pa-hpux11
@@ -1,31 +1,2 @@
 TARGET_LIBGCC2_CFLAGS = -fPIC -frandom-seed=fixed-seed
 LIB2FUNCS_EXTRA=lib2funcs.asm quadlib.c
-LIBGCCSTUB_OBJS = pthread_default_stacksize_np-stub.o \
-	pthread_mutex_lock-stub.o \
-	pthread_mutex_unlock-stub.o \
-	pthread_once-stub.o
-
-stublib.c: $(srcdir)/config/pa/stublib.c
-	rm -f stublib.c
-	cp $(srcdir)/config/pa/stublib.c .
-
-pthread_default_stacksize_np-stub.o: stublib.c $(GCC_PASSES)
-	$(GCC_FOR_TARGET) -c -O2 -DL_pthread_default_stacksize_np stublib.c \
-	  -o pthread_default_stacksize_np-stub.o
-
-pthread_mutex_lock-stub.o: stublib.c $(GCC_PASSES)
-	$(GCC_FOR_TARGET) -c -O2 -DL_pthread_mutex_lock stublib.c \
-	  -o pthread_mutex_lock-stub.o
-
-pthread_mutex_unlock-stub.o: stublib.c $(GCC_PASSES)
-	$(GCC_FOR_TARGET) -c -O2 -DL_pthread_mutex_unlock stublib.c \
-	  -o pthread_mutex_unlock-stub.o
-
-pthread_once-stub.o: stublib.c $(GCC_PASSES)
-	$(GCC_FOR_TARGET) -c -O2 -DL_pthread_once stublib.c \
-	  -o pthread_once-stub.o
-
-$(T)libgcc_stub.a: $(LIBGCCSTUB_OBJS)
-	-rm -rf $(T)libgcc_stub.a
-	$(AR) rc $(T)libgcc_stub.a $(LIBGCCSTUB_OBJS)
-	$(RANLIB) $(T)libgcc_stub.a
diff --git a/gcc/config/pa/t-pa64 b/gcc/config/pa/t-pa64
--- a/gcc/config/pa/t-pa64
+++ b/gcc/config/pa/t-pa64
@@ -1,5 +1,5 @@
 # Copyright (C) 2000, 2001, 2002, 2004, 2006,
-# 2007, 2010 Free Software Foundation, Inc.
+# 2007, 2010, 2011 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -19,49 +19,3 @@
 
 TARGET_LIBGCC2_CFLAGS = -fPIC -Dpa64=1 -DELF=1 -mlong-calls
 LIB2FUNCS_EXTRA = quadlib.c
-LIBGCCSTUB_OBJS = rfi-stub.o dfi-stub.o jvrc-stub.o cxaf-stub.o \
-	pthread_default_stacksize_np-stub.o \
-	pthread_mutex_lock-stub.o \
-	pthread_mutex_unlock-stub.o \
-	pthread_once-stub.o
-
-stublib.c: $(srcdir)/config/pa/stublib.c
-	rm -f stublib.c
-	cp $(srcdir)/config/pa/stublib.c .
-
-rfi-stub.o: stublib.c $(GCC_PASSES)
-	$(GCC_FOR_TARGET) -c -O2 -DL_register_frame_info stublib.c \
-	  -o rfi-stub.o
-
-dfi-stub.o: stublib.c $(GCC_PASSES)
-	$(GCC_FOR_TARGET) -c -O2 -DL_deregister_frame_info stublib.c \
-	  -o dfi-stub.o
-
-cxaf-stub.o: stublib.c $(GCC_PASSES)
-	$(GCC_FOR_TARGET) -c -O2 -DL_cxa_finalize stublib.c \
-	  -o cxaf-stub.o
-
-jvrc-stub.o: stublib.c $(GCC_PASSES)
-	$(GCC_FOR_TARGET) -c -O2 -DL_Jv_RegisterClasses stublib.c \
-	  -o jvrc-stub.o
-
-pthread_default_stacksize_np-stub.o: stublib.c $(GCC_PASSES)
-	$(GCC_FOR_TARGET) -c -O2 -DL_pthread_default_stacksize_np stublib.c \
-	  -o pthread_default_stacksize_np-stub.o
-
-pthread_mutex_lock-stub.o: stublib.c $(GCC_PASSES)
-	$(GCC_FOR_TARGET) -c -O2 -DL_pthread_mutex_lock stublib.c \
-	  -o pthread_mutex_lock-stub.o
-
-pthread_mutex_unlock-stub.o: stublib.c $(GCC_PASSES)
-	$(GCC_FOR_TARGET) -c -O2 -DL_pthread_mutex_unlock stublib.c \
-	  -o pthread_mutex_unlock-stub.o
-
-pthread_once-stub.o: stublib.c $(GCC_PASSES)
-	$(GCC_FOR_TARGET) -c -O2 -DL_pthread_once stublib.c \
-	  -o pthread_once-stub.o
-
-$(T)libgcc_stub.a: $(LIBGCCSTUB_OBJS)
-	-rm -rf $(T)libgcc_stub.a
-	$(AR) rc $(T)libgcc_stub.a $(LIBGCCSTUB_OBJS)
-	$(RANLIB) $(T)libgcc_stub.a
diff --git a/gcc/config/rs6000/t-lynx b/gcc/config/rs6000/t-lynx
--- a/gcc/config/rs6000/t-lynx
+++ b/gcc/config/rs6000/t-lynx
@@ -32,15 +32,6 @@ MULTILIB_DIRNAMES   += altivec
 
 MULTILIB_EXCEPTIONS = *msoft-float/*maltivec*
 
-EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o 
-
-# If .sdata is enabled __CTOR_{LIST,END}__ go into .sdata instead of
-# .ctors.
-CRTSTUFF_T_CFLAGS = -mno-sdata 
- 
-# Compile crtbeginS.o and crtendS.o with pic. 
-CRTSTUFF_T_CFLAGS_S = -fPIC -mno-sdata 
-
 Local Variables:
 mode: makefile
 End:
diff --git a/gcc/config/rs6000/t-netbsd b/gcc/config/rs6000/t-netbsd
--- a/gcc/config/rs6000/t-netbsd
+++ b/gcc/config/rs6000/t-netbsd
@@ -1,6 +1,6 @@
 # Support for NetBSD PowerPC ELF targets (SVR4 ABI).
 #
-# Copyright (C) 2002, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2002, 2008, 2011 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -45,10 +45,6 @@ crtresxfpr.S: $(srcdir)/config/rs6000/cr
 crtresxgpr.S: $(srcdir)/config/rs6000/crtresxgpr.asm
 	cat $(srcdir)/config/rs6000/crtresxgpr.asm >crtresxgpr.S
 
-# It is important that crtbegin.o, etc., aren't surprised by stuff in .sdata.
-CRTSTUFF_T_CFLAGS += -msdata=none
-CRTSTUFF_T_CFLAGS_S += -msdata=none
-
 # Switch synonyms
 MULTILIB_MATCHES_FLOAT	= msoft-float=mcpu?401 \
 			  msoft-float=mcpu?403 \
@@ -68,8 +64,6 @@ MULTILIB_MATCHES	= ${MULTILIB_MATCHES_FL
 
 LIBGCC = stmp-multilib
 INSTALL_LIBGCC = install-multilib
-EXTRA_MULTILIB_PARTS = crtbegin$(objext) crtend$(objext) \
-  crtbeginS$(objext) crtendS$(objext) crtbeginT$(objext)
 
 $(T)crtsavfpr$(objext): crtsavfpr.S
 	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c crtsavfpr.S -o $(T)crtsavfpr$(objext)
diff --git a/gcc/config/rs6000/t-ppccomm b/gcc/config/rs6000/t-ppccomm
--- a/gcc/config/rs6000/t-ppccomm
+++ b/gcc/config/rs6000/t-ppccomm
@@ -33,43 +33,3 @@ tramp.S: $(srcdir)/config/rs6000/tramp.a
 # Switch synonyms
 MULTILIB_MATCHES_ENDIAN	= mlittle=mlittle-endian mbig=mbig-endian
 MULTILIB_MATCHES_SYSV	= mcall-sysv=mcall-sysv-eabi mcall-sysv=mcall-sysv-noeabi mcall-sysv=mcall-linux mcall-sysv=mcall-netbsd
-
-EXTRA_MULTILIB_PARTS = crtbegin$(objext) crtend$(objext) \
-  crtbeginS$(objext) crtendS$(objext) crtbeginT$(objext) \
-  ecrti$(objext) ecrtn$(objext) \
-  ncrti$(objext) ncrtn$(objext)
-
-# We build {e,n}crti.o and {e,n}crtn.o, which serve to add begin and
-# end labels to all of the special sections used when we link using gcc.
-
-# Assemble startup files.
-ecrti.S: $(srcdir)/config/rs6000/eabi-ci.asm
-	cat $(srcdir)/config/rs6000/eabi-ci.asm >ecrti.S
-
-ecrtn.S: $(srcdir)/config/rs6000/eabi-cn.asm
-	cat $(srcdir)/config/rs6000/eabi-cn.asm >ecrtn.S
-
-ncrti.S: $(srcdir)/config/rs6000/sol-ci.asm
-	cat $(srcdir)/config/rs6000/sol-ci.asm >ncrti.S
-
-ncrtn.S: $(srcdir)/config/rs6000/sol-cn.asm
-	cat $(srcdir)/config/rs6000/sol-cn.asm >ncrtn.S
-
-# Build multiple copies of ?crt{i,n}.o, one for each target switch.
-$(T)ecrti$(objext): ecrti.S
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c ecrti.S -o $(T)ecrti$(objext)
-
-$(T)ecrtn$(objext): ecrtn.S
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c ecrtn.S -o $(T)ecrtn$(objext)
-
-$(T)ncrti$(objext): ncrti.S
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c ncrti.S -o $(T)ncrti$(objext)
-
-$(T)ncrtn$(objext): ncrtn.S
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -c ncrtn.S -o $(T)ncrtn$(objext)
-
-# It is important that crtbegin.o, etc., aren't surprised by stuff in .sdata.
-CRTSTUFF_T_CFLAGS = -msdata=none
-# Make sure crt*.o are built with -fPIC even if configured with 
-# --enable-shared --disable-multilib
-CRTSTUFF_T_CFLAGS_S = -fPIC -msdata=none
diff --git a/gcc/config/rs6000/t-vxworks b/gcc/config/rs6000/t-vxworks
--- a/gcc/config/rs6000/t-vxworks
+++ b/gcc/config/rs6000/t-vxworks
@@ -24,10 +24,6 @@ MULTILIB_DIRNAMES =
 MULTILIB_MATCHES = fPIC=fpic
 MULTILIB_EXCEPTIONS = fPIC*
 
-# This is set from the common config/t-vxworks but clobbered by t-ppccomm
-# on this target.
-EXTRA_MULTILIB_PARTS = 
-
 # Similarily, LIB2FUNCS_EXTRA is set from config/t-vxworks and
 # t-ppccomm *adds* to it, but the common contents are useful to us.
 # In particular the base trampoline_setup bits are expected to be
diff --git a/gcc/config/rx/t-rx b/gcc/config/rx/t-rx
--- a/gcc/config/rx/t-rx
+++ b/gcc/config/rx/t-rx
@@ -30,5 +30,3 @@ MULTILIB_EXTRA_OPTS =
 
 LIBGCC = stmp-multilib
 INSTALL_LIBGCC = install-multilib
-
-EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o
diff --git a/gcc/config/score/t-score-elf b/gcc/config/score/t-score-elf
deleted file mode 100644
--- a/gcc/config/score/t-score-elf
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright (C) 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
-#
-# This file is part of GCC.
-#
-# GCC 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 3, or (at your option)
-# any later version.
-#
-# GCC 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 GCC; see the file COPYING3.  If not see
-# <http://www.gnu.org/licenses/>.
-
-# Assemble startup files.
-$(T)crti.o: $(srcdir)/config/score/crti.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-	-c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/score/crti.asm
-
-$(T)crtn.o: $(srcdir)/config/score/crtn.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-	-c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/score/crtn.asm
diff --git a/gcc/config/sh/t-elf b/gcc/config/sh/t-elf
deleted file mode 100644
--- a/gcc/config/sh/t-elf
+++ /dev/null
@@ -1,10 +0,0 @@
-EXTRA_MULTILIB_PARTS= crt1.o crti.o crtn.o \
-	crtbegin.o crtend.o crtbeginS.o crtendS.o $(IC_EXTRA_PARTS) $(OPT_EXTRA_PARTS)
-
-# Compile crtbeginS.o and crtendS.o with pic.
-CRTSTUFF_T_CFLAGS_S = -fPIC
-
-# Don't compile libgcc with -fpic for now.  It's unlikely that we'll
-# build shared libraries for embedded SH.
-# Linux / Netbsd will already have set TARGET_LIBGCC2_CFLAGS.
-# TARGET_LIBGCC2_CFLAGS = -fpic
diff --git a/gcc/config/sh/t-linux b/gcc/config/sh/t-linux
--- a/gcc/config/sh/t-linux
+++ b/gcc/config/sh/t-linux
@@ -4,5 +4,3 @@ LIB2FUNCS_EXTRA= $(srcdir)/config/sh/lin
 
 MULTILIB_DIRNAMES= 
 MULTILIB_MATCHES = 
-
-EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
diff --git a/gcc/config/sh/t-linux64 b/gcc/config/sh/t-linux64
deleted file mode 100644
--- a/gcc/config/sh/t-linux64
+++ /dev/null
@@ -1,1 +0,0 @@
-EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
diff --git a/gcc/config/sh/t-netbsd b/gcc/config/sh/t-netbsd
--- a/gcc/config/sh/t-netbsd
+++ b/gcc/config/sh/t-netbsd
@@ -20,5 +20,3 @@ TARGET_LIBGCC2_CFLAGS = -fpic -mieee
 LIB1ASMFUNCS_CACHE = _ic_invalidate
 
 LIB2FUNCS_EXTRA=
-
-EXTRA_MULTILIB_PARTS=
diff --git a/gcc/config/sh/t-sh b/gcc/config/sh/t-sh
--- a/gcc/config/sh/t-sh
+++ b/gcc/config/sh/t-sh
@@ -94,55 +94,9 @@ MULTILIB_OSDIRNAMES = \
 LIBGCC = stmp-multilib
 INSTALL_LIBGCC = install-multilib
 
-$(T)crt1.o: $(srcdir)/config/sh/crt1.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crt1.o -x assembler-with-cpp $(srcdir)/config/sh/crt1.asm
-$(T)crti.o: $(srcdir)/config/sh/crti.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/sh/crti.asm
-$(T)crtn.o: $(srcdir)/config/sh/crtn.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/sh/crtn.asm
-
 $(out_object_file): gt-sh.h
 gt-sh.h : s-gtype ; @true
 
-# These are not suitable for COFF.
-# EXTRA_MULTILIB_PARTS= crt1.o crti.o crtn.o crtbegin.o crtend.o
-
-IC_EXTRA_PARTS= libic_invalidate_array_4-100.a libic_invalidate_array_4-200.a \
-libic_invalidate_array_4a.a
-OPT_EXTRA_PARTS= libgcc-Os-4-200.a libgcc-4-300.a
-EXTRA_MULTILIB_PARTS= $(IC_EXTRA_PARTS) $(OPT_EXTRA_PARTS)
-
-$(T)ic_invalidate_array_4-100.o: $(srcdir)/config/sh/lib1funcs.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)ic_invalidate_array_4-100.o -DL_ic_invalidate_array -DWAYS=1 -DWAY_SIZE=0x2000 -x assembler-with-cpp $(srcdir)/config/sh/lib1funcs.asm
-$(T)libic_invalidate_array_4-100.a: $(T)ic_invalidate_array_4-100.o $(GCC_PASSES)
-	$(AR_CREATE_FOR_TARGET) $(T)libic_invalidate_array_4-100.a $(T)ic_invalidate_array_4-100.o
-
-$(T)ic_invalidate_array_4-200.o: $(srcdir)/config/sh/lib1funcs.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)ic_invalidate_array_4-200.o -DL_ic_invalidate_array -DWAYS=2 -DWAY_SIZE=0x2000 -x assembler-with-cpp $(srcdir)/config/sh/lib1funcs.asm
-$(T)libic_invalidate_array_4-200.a: $(T)ic_invalidate_array_4-200.o $(GCC_PASSES)
-	$(AR_CREATE_FOR_TARGET) $(T)libic_invalidate_array_4-200.a $(T)ic_invalidate_array_4-200.o
-
-$(T)ic_invalidate_array_4a.o: $(srcdir)/config/sh/lib1funcs.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)ic_invalidate_array_4a.o -DL_ic_invalidate_array -D__FORCE_SH4A__ -x assembler-with-cpp $(srcdir)/config/sh/lib1funcs.asm
-$(T)libic_invalidate_array_4a.a: $(T)ic_invalidate_array_4a.o $(GCC_PASSES)
-	$(AR_CREATE_FOR_TARGET) $(T)libic_invalidate_array_4a.a $(T)ic_invalidate_array_4a.o
-
-$(T)sdivsi3_i4i-Os-4-200.o: $(srcdir)/config/sh/lib1funcs-Os-4-200.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $@ -DL_sdivsi3_i4i -x assembler-with-cpp $<
-$(T)udivsi3_i4i-Os-4-200.o: $(srcdir)/config/sh/lib1funcs-Os-4-200.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $@ -DL_udivsi3_i4i -x assembler-with-cpp $<
-$(T)unwind-dw2-Os-4-200.o: $(srcdir)/../libgcc/unwind-dw2.c $(srcdir)/../libgcc/unwind-generic.h $(srcdir)/../libgcc/unwind-pe.h $(srcdir)/../libgcc/unwind.inc $(srcdir)/../libgcc/unwind-dw2-fde.h $(srcdir)/../libgcc/unwind-dw2.h $(CONFIG_H) coretypes.h $(TM_H) $(MACHMODE_H) longlong.h config.status stmp-int-hdrs tsystem.h $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) $(LIBGCC2_CFLAGS) $(INCLUDES) $(vis_hide) -fexceptions -Os -c -o $@ $<
-OBJS_Os_4_200=$(T)sdivsi3_i4i-Os-4-200.o $(T)udivsi3_i4i-Os-4-200.o $(T)unwind-dw2-Os-4-200.o
-$(T)libgcc-Os-4-200.a: $(OBJS_Os_4_200) $(GCC_PASSES)
-	$(AR_CREATE_FOR_TARGET) $@ $(OBJS_Os_4_200)
-
-$(T)div_table-4-300.o: $(srcdir)/config/sh/lib1funcs-4-300.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $@ -DL_div_table -x assembler-with-cpp $<
-
-$(T)libgcc-4-300.a: $(T)div_table-4-300.o $(GCC_PASSES)
-	$(AR_CREATE_FOR_TARGET) $@ $(T)div_table-4-300.o
-
 # Local Variables:
 # mode: Makefile
 # End:
diff --git a/gcc/config/sh/t-superh b/gcc/config/sh/t-superh
deleted file mode 100644
--- a/gcc/config/sh/t-superh
+++ /dev/null
@@ -1,33 +0,0 @@
-# Copyright (C) 2005, 2006 Free Software Foundation, Inc.
-#
-# This file is part of GCC.
-#
-# GCC 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 3, or (at your option)
-# any later version.
-#
-# GCC 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 GCC; see the file COPYING3.  If not see
-# <http://www.gnu.org/licenses/>.
-
-EXTRA_MULTILIB_PARTS= crt1.o crti.o crtn.o \
-	crtbegin.o crtend.o crtbeginS.o crtendS.o \
-	crt1-mmu.o gcrt1-mmu.o gcrt1.o $(IC_EXTRA_PARTS) $(OPT_EXTRA_PARTS)
-
-# Compile crt1-mmu.o as crt1.o with -DMMU_SUPPORT
-$(T)crt1-mmu.o: $(srcdir)/config/sh/crt1.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)crt1-mmu.o -DMMU_SUPPORT -x assembler-with-cpp $(srcdir)/config/sh/crt1.asm
-
-# Compile gcrt1-mmu.o as crt1-mmu.o with -DPROFILE
-$(T)gcrt1-mmu.o: $(srcdir)/config/sh/crt1.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)gcrt1-mmu.o -DPROFILE -DMMU_SUPPORT -x assembler-with-cpp $(srcdir)/config/sh/crt1.asm
-
-# For sh4-400: Compile gcrt1.o as crt1.o with -DPROFILE
-$(T)gcrt1.o: $(srcdir)/config/sh/crt1.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -c -o $(T)gcrt1.o -DPROFILE -x assembler-with-cpp $(srcdir)/config/sh/crt1.asm
diff --git a/gcc/config/sh/t-vxworks b/gcc/config/sh/t-vxworks
--- a/gcc/config/sh/t-vxworks
+++ b/gcc/config/sh/t-vxworks
@@ -4,6 +4,3 @@ MULTILIB_OPTIONS = mrtp fPIC m2/m3/m4/m4
 # Don't build -fPIC without -mrtp, or -ml without -m3/-m4.
 MULTILIB_EXCEPTIONS = fPIC* ml* mrtp/ml* mrtp/fPIC/ml* *m2/ml*
 MULTILIB_MATCHES = m2=m4-nofpu fPIC=fpic
-
-# Restore a variable from t-vxworks clobbered by t-elf.
-EXTRA_MULTILIB_PARTS =
diff --git a/gcc/config/sparc/t-linux64 b/gcc/config/sparc/t-linux64
--- a/gcc/config/sparc/t-linux64
+++ b/gcc/config/sparc/t-linux64
@@ -1,5 +1,5 @@
 # Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004,
-# 2006, 2010 Free Software Foundation, Inc.
+# 2006, 2010, 2011 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -30,7 +30,3 @@ MULTILIB_OSDIRNAMES = ../lib64 $(if $(wi
 
 LIBGCC = stmp-multilib
 INSTALL_LIBGCC = install-multilib
-
-CRTSTUFF_T_CFLAGS = `if test x$$($(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) \
-				 -print-multi-os-directory) \
-			= x../lib64; then echo -mcmodel=medany; fi`
diff --git a/gcc/config/spu/t-spu-elf b/gcc/config/spu/t-spu-elf
--- a/gcc/config/spu/t-spu-elf
+++ b/gcc/config/spu/t-spu-elf
@@ -43,43 +43,9 @@ LIB2FUNCS_STATIC_EXTRA = $(srcdir)/confi
 # integer data types.
 LIB2_SIDITI_CONV_FUNCS=yes
 
-# Don't let CTOR_LIST end up in sdata section.
-CRTSTUFF_T_CFLAGS =
-
 # Multi-lib support.
 MULTILIB_OPTIONS=mea64
 
-# Neither gcc or newlib seem to have a standard way to generate multiple
-# crt*.o files.  So we don't use the standard crt0.o name anymore.
-
-EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o libgcc_cachemgr.a libgcc_cachemgr_nonatomic.a \
-	libgcc_cache8k.a libgcc_cache16k.a libgcc_cache32k.a libgcc_cache64k.a libgcc_cache128k.a
-
-$(T)cachemgr.o: $(srcdir)/config/spu/cachemgr.c
-	$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(MULTILIB_CFLAGS) -c $< -o $@
-
-# Specialised rule to add a -D flag.
-$(T)cachemgr_nonatomic.o: $(srcdir)/config/spu/cachemgr.c
-	$(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(MULTILIB_CFLAGS) -DNONATOMIC -c $< -o $@
-
-$(T)libgcc_%.a: $(T)%.o
-	$(AR_FOR_TARGET) -rcs $@ $<
-
-$(T)cache8k.o: $(srcdir)/config/spu/cache.S
-	$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -D__CACHE_SIZE__=8 -o $@ -c $<
-
-$(T)cache16k.o: $(srcdir)/config/spu/cache.S
-	$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -D__CACHE_SIZE__=16 -o $@ -c $<
-
-$(T)cache32k.o: $(srcdir)/config/spu/cache.S
-	$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -D__CACHE_SIZE__=32 -o $@ -c $<
-
-$(T)cache64k.o: $(srcdir)/config/spu/cache.S
-	$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -D__CACHE_SIZE__=64 -o $@ -c $<
-
-$(T)cache128k.o: $(srcdir)/config/spu/cache.S
-	$(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) -D__CACHE_SIZE__=128 -o $@ -c $<
-
 LIBGCC = stmp-multilib
 INSTALL_LIBGCC = install-multilib
 
diff --git a/gcc/config/t-freebsd b/gcc/config/t-freebsd
--- a/gcc/config/t-freebsd
+++ b/gcc/config/t-freebsd
@@ -1,5 +1,2 @@
-# Compile crtbeginS.o and crtendS.o with pic.
-CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -fPIC
-
 # Compile libgcc.a with pic.
 TARGET_LIBGCC2_CFLAGS += -fPIC
diff --git a/gcc/config/t-libc-ok b/gcc/config/t-libc-ok
deleted file mode 100644
--- a/gcc/config/t-libc-ok
+++ /dev/null
@@ -1,1 +0,0 @@
-CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -fPIC
diff --git a/gcc/config/t-linux b/gcc/config/t-linux
--- a/gcc/config/t-linux
+++ b/gcc/config/t-linux
@@ -17,7 +17,5 @@
 # along with GCC; see the file COPYING3.  If not see
 # <http://www.gnu.org/licenses/>.
 
-# Compile crtbeginS.o and crtendS.o with pic.
-CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -fPIC
 # Compile libgcc2.a with pic.
 TARGET_LIBGCC2_CFLAGS = -fPIC
diff --git a/gcc/config/t-lynx b/gcc/config/t-lynx
--- a/gcc/config/t-lynx
+++ b/gcc/config/t-lynx
@@ -1,4 +1,4 @@
-# Copyright (C) 2004, 2007 Free Software Foundation, Inc.
+# Copyright (C) 2004, 2007, 2011 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -16,9 +16,6 @@
 # along with GCC; see the file COPYING3.  If not see
 # <http://www.gnu.org/licenses/>.
 
-# Compile crtbeginS.o and crtendS.o with pic.
-CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -fPIC
-
 # Compile libgcc2.a with pic.
 TARGET_LIBGCC2_CFLAGS = -fPIC
 
diff --git a/gcc/config/t-netbsd b/gcc/config/t-netbsd
deleted file mode 100644
--- a/gcc/config/t-netbsd
+++ /dev/null
@@ -1,2 +0,0 @@
-# Always build crtstuff with PIC.
-CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -fPIC
diff --git a/gcc/config/t-svr4 b/gcc/config/t-svr4
--- a/gcc/config/t-svr4
+++ b/gcc/config/t-svr4
@@ -4,5 +4,4 @@
 # we will be doing that, we just always use -fPIC when compiling the
 # routines in crtstuff.c.  Likewise for libgcc2.c.
 
-CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -fPIC
 TARGET_LIBGCC2_CFLAGS = -fPIC
diff --git a/gcc/config/t-vxworks b/gcc/config/t-vxworks
--- a/gcc/config/t-vxworks
+++ b/gcc/config/t-vxworks
@@ -1,5 +1,5 @@
 # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008,
-# 2009, 2010 Free Software Foundation, Inc.
+# 2009, 2010, 2011 Free Software Foundation, Inc.
 #
 # This file is part of GCC.
 #
@@ -46,8 +46,6 @@ LIBGCC2_INCLUDES = -nostdinc -I \
 # Both the kernel and RTP headers provide limits.h.
 LIMITS_H_TEST = true
 
-EXTRA_MULTILIB_PARTS = 
-
 vxworks.o: $(srcdir)/config/vxworks.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
 	$(TARGET_H) output.h $(TM_H)
 	$(COMPILER) -c $(ALL_COMPILERFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $<
diff --git a/gcc/config/vms/t-vms b/gcc/config/vms/t-vms
--- a/gcc/config/vms/t-vms
+++ b/gcc/config/vms/t-vms
@@ -1,4 +1,4 @@
-# Copyright (C) 2009, 2010
+# Copyright (C) 2009, 2010, 2011
 # Free Software Foundation, Inc.
 #
 # This file is part of GCC.
@@ -24,17 +24,6 @@ LIMITS_H_TEST = false
 # Under VMS, directory names cannot contain dots.
 version:=$(shell echo $(BASEVER_c) | sed -e 's/\./_/g')
 
-VMS_EXTRA_PARTS=vcrt0.o pcrt0.o
-
-# Assemble startup files.
-$(T)vcrt0.o: $(srcdir)/config/vms/vms-ucrt0.c $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-	-c -o $(T)vcrt0.o $(srcdir)/config/vms/vms-ucrt0.c
-
-$(T)pcrt0.o: $(srcdir)/config/vms/vms-ucrt0.c $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-	-c -o $(T)pcrt0.o -DCRT0_POSIX_EXIT $(srcdir)/config/vms/vms-ucrt0.c
-
 vms-crtlmap.h: $(srcdir)/config/vms/vms-crtlmap.map  \
   $(srcdir)/config/vms/make-crtlmap.awk
 	$(AWK) -f $(srcdir)/config/vms/make-crtlmap.awk \
diff --git a/gcc/config/xtensa/t-elf b/gcc/config/xtensa/t-elf
--- a/gcc/config/xtensa/t-elf
+++ b/gcc/config/xtensa/t-elf
@@ -1,6 +1,1 @@
-# Build CRT files and libgcc with the "longcalls" option
-CRTSTUFF_T_CFLAGS += -mlongcalls
-CRTSTUFF_T_CFLAGS_S += -mlongcalls
 TARGET_LIBGCC2_CFLAGS += -mlongcalls
-
-EXTRA_MULTILIB_PARTS = crti.o crtn.o crtbegin.o crtend.o
diff --git a/gcc/config/xtensa/t-linux b/gcc/config/xtensa/t-linux
deleted file mode 100644
--- a/gcc/config/xtensa/t-linux
+++ /dev/null
@@ -1,1 +0,0 @@
-EXTRA_MULTILIB_PARTS = crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
diff --git a/gcc/config/xtensa/t-xtensa b/gcc/config/xtensa/t-xtensa
--- a/gcc/config/xtensa/t-xtensa
+++ b/gcc/config/xtensa/t-xtensa
@@ -31,11 +31,4 @@ LIB1ASMFUNCS = _mulsi3 _divsi3 _modsi3 _
 
 LIB2FUNCS_EXTRA = $(srcdir)/config/xtensa/lib2funcs.S
 
-$(T)crti.o: $(srcdir)/config/xtensa/crti.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-	-c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/xtensa/crti.asm
-$(T)crtn.o: $(srcdir)/config/xtensa/crtn.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-	-c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/xtensa/crtn.asm
-
 $(out_object_file): gt-xtensa.h
diff --git a/gcc/configure.ac b/gcc/configure.ac
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -4947,7 +4947,6 @@ AC_SUBST(user_headers_inc_next_pre)
 AC_SUBST(user_headers_inc_next_post)
 AC_SUBST(extra_headers_list)
 AC_SUBST(extra_objs)
-AC_SUBST(extra_parts)
 AC_SUBST(extra_passes)
 AC_SUBST(extra_programs)
 AC_SUBST(float_h_file)
diff --git a/gcc/po/EXCLUDES b/gcc/po/EXCLUDES
--- a/gcc/po/EXCLUDES
+++ b/gcc/po/EXCLUDES
@@ -23,7 +23,6 @@
 
 #   These files are part of libgcc, or target headers provided by gcc.
 config/vxlib.c
-crtstuff.c
 gbl-ctors.h
 gcov-io.h
 gcov-iov.c
diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in
--- a/libgcc/Makefile.in
+++ b/libgcc/Makefile.in
@@ -50,6 +50,8 @@ target_noncanonical = @target_noncanonic
 # The rules for compiling them should be in the t-* file for the machine.
 EXTRA_PARTS = @extra_parts@
 
+extra-parts = libgcc-extra-parts
+
 # Multilib support variables.
 MULTISRCTOP =
 MULTIBUILDTOP =
@@ -62,6 +64,7 @@ INSTALL = @INSTALL@
 INSTALL_PROGRAM = @INSTALL_PROGRAM@
 INSTALL_DATA = @INSTALL_DATA@
 mkinstalldirs = $(SHELL) $(libgcc_topdir)/mkinstalldirs
+INSTALL_PARTS = $(EXTRA_PARTS)
 
 objext = .o
 
@@ -238,6 +241,16 @@ override CFLAGS := $(filter-out -fprofil
 INTERNAL_CFLAGS = $(CFLAGS) $(LIBGCC2_CFLAGS) $(HOST_LIBGCC2_CFLAGS) \
 		  $(INCLUDES) @set_have_cc_tls@ @set_use_emutls@
 
+# Options to use when compiling crtbegin/end.
+CRTSTUFF_CFLAGS = -O2 $(GCC_CFLAGS) $(INCLUDES) $(MULTILIB_CFLAGS) -g0 \
+  -finhibit-size-directive -fno-inline -fno-exceptions \
+  -fno-zero-initialized-in-bss -fno-toplevel-reorder -fno-tree-vectorize \
+  -fno-stack-protector \
+  $(INHIBIT_LIBC_CFLAGS)
+
+# Extra flags to use when compiling crt{begin,end}.o.
+CRTSTUFF_T_CFLAGS =
+
 MULTIDIR := $(shell $(CC) $(CFLAGS) -print-multi-directory)
 MULTIOSDIR := $(shell $(CC) $(CFLAGS) -print-multi-os-directory)
 
@@ -335,16 +348,6 @@ vis_hide =
 gen-hide-list = echo > \$@
 endif
 
-ifneq ($(EXTRA_PARTS),)
-  extra-parts = libgcc-extra-parts
-  INSTALL_PARTS = $(EXTRA_PARTS)
-else
-ifneq ($(GCC_EXTRA_PARTS),)
-  extra-parts = gcc-extra-parts
-  INSTALL_PARTS = $(GCC_EXTRA_PARTS)
-endif
-endif
-
 LIB2ADD += enable-execute-stack.c
 
 LIB2ADDEH += $(srcdir)/emutls.c
@@ -900,45 +903,39 @@ ALL_CRT_CFLAGS = $(CFLAGS) $(CRTSTUFF_CF
 crt_compile = $(CC) $(ALL_CRT_CFLAGS) -o $@ $(compile_deps)
 
 ifeq ($(CUSTOM_CRTSTUFF),)
-crtbegin$(objext): $(gcc_srcdir)/crtstuff.c
-	$(crt_compile) $(CRTSTUFF_T_CFLAGS) \
-	  -c $(gcc_srcdir)/crtstuff.c -DCRT_BEGIN
+# Compile two additional files that are linked with every program
+# linked using GCC on systems using COFF or ELF, for the sake of C++
+# constructors.
+crtbegin$(objext): $(srcdir)/crtstuff.c
+	$(crt_compile) $(CRTSTUFF_T_CFLAGS) -c $< -DCRT_BEGIN
 
-crtend$(objext): $(gcc_srcdir)/crtstuff.c
-	$(crt_compile) $(CRTSTUFF_T_CFLAGS) \
-	  -c $(gcc_srcdir)/crtstuff.c -DCRT_END
+crtend$(objext): $(srcdir)/crtstuff.c
+	$(crt_compile) $(CRTSTUFF_T_CFLAGS) -c $< -DCRT_END
 
 # These are versions of crtbegin and crtend for shared libraries.
-crtbeginS$(objext): $(gcc_srcdir)/crtstuff.c
-	$(crt_compile) $(CRTSTUFF_T_CFLAGS_S) \
-	  -c $(gcc_srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFS_O
+crtbeginS$(objext): $(srcdir)/crtstuff.c
+	$(crt_compile) $(CRTSTUFF_T_CFLAGS_S) -c $< -DCRT_BEGIN -DCRTSTUFFS_O
 
-crtendS$(objext): $(gcc_srcdir)/crtstuff.c
-	$(crt_compile) $(CRTSTUFF_T_CFLAGS_S) \
-	  -c $(gcc_srcdir)/crtstuff.c -DCRT_END -DCRTSTUFFS_O
+crtendS$(objext): $(srcdir)/crtstuff.c
+	$(crt_compile) $(CRTSTUFF_T_CFLAGS_S) -c $< -DCRT_END -DCRTSTUFFS_O
 
 # This is a version of crtbegin for -static links.
-crtbeginT.o: $(gcc_srcdir)/crtstuff.c
-	$(crt_compile) $(CRTSTUFF_T_CFLAGS) \
-	  -c $(gcc_srcdir)/crtstuff.c -DCRT_BEGIN -DCRTSTUFFT_O
+crtbeginT$(objext): $(srcdir)/crtstuff.c
+	$(crt_compile) $(CRTSTUFF_T_CFLAGS) -c $< -DCRT_BEGIN -DCRTSTUFFT_O
+endif
+
+ifeq ($(CUSTOM_CRTIN),)
+# -x assembler-with-cpp is only needed on case-insensitive filesystem.
+crti$(objext): $(srcdir)/config/$(cpu_type)/crti.S
+	$(crt_compile) -c -x assembler-with-cpp $<
+
+crtn$(objext): $(srcdir)/config/$(cpu_type)/crtn.S
+	$(crt_compile) -c -x assembler-with-cpp $<
 endif
 
 # Build extra startfiles in the libgcc directory.
 .PHONY: libgcc-extra-parts
 libgcc-extra-parts: $(EXTRA_PARTS)
-ifneq ($(GCC_EXTRA_PARTS),)
-ifneq ($(sort $(EXTRA_PARTS)),$(GCC_EXTRA_PARTS))
-	# If the gcc directory specifies which extra parts to
-	# build for this target, and the libgcc configuration also
-	# specifies, make sure they match.  This can be removed
-	# when the gcc directory no longer holds libgcc configuration;
-	# it is useful when migrating a target.
-	@echo "Configuration mismatch!"
-	@echo "Extra parts from gcc directory: $(GCC_EXTRA_PARTS)"
-	@echo "Extra parts from libgcc: $(EXTRA_PARTS)"
-	exit 1
-endif
-endif
 
 	# Early copyback; see "all" above for the rationale.  The
 	# early copy is necessary so that the gcc -B options find
@@ -954,43 +951,6 @@ endif
 	  esac;							\
 	done
 
-# Build extra startfiles in the gcc directory, for unconverted
-# targets.
-.PHONY: gcc-extra-parts
-gcc-extra-parts:
-	# Recursively invoke make in the GCC directory to build any
-	# startfiles (for now).  We must do this just once, passing
-	# it all the GCC_EXTRA_PARTS as simultaneous goal targets,
-	# so that rules which cannot execute simultaneously are properly
-	# serialized.  We indirect through T_TARGET in case any multilib
-	# directories contain an equals sign, to prevent make from
-	# interpreting any of the goals as variable assignments.
-
-	# We must use cd && make rather than make -C, or else the stage
-	# number will be embedded in debug information.
-
-	T=`$(PWD_COMMAND)`/ \
-	&& cd $(gcc_objdir) \
-	&& $(MAKE) GCC_FOR_TARGET="$(CC)" \
-	  MULTILIB_CFLAGS="$(CFLAGS)" \
-	  T=$$T \
-	  T_TARGET="$(patsubst %,$${T}%,$(GCC_EXTRA_PARTS))" \
-	  T_TARGET
-
-	# Early copyback; see "all" above for the rationale.  The
-	# early copy is necessary so that the gcc -B options find
-	# the right startup files when linking shared libgcc.
-	$(mkinstalldirs) $(gcc_objdir)$(MULTISUBDIR)
-	parts="$(GCC_EXTRA_PARTS)";				\
-	for file in $$parts; do					\
-	  rm -f $(gcc_objdir)$(MULTISUBDIR)/$$file;		\
-	  $(INSTALL_DATA) $$file $(gcc_objdir)$(MULTISUBDIR)/;	\
-	  case $$file in 					\
-	    *.a)						\
-	      $(RANLIB) $(gcc_objdir)$(MULTISUBDIR)/$$file ;;	\
-	  esac;							\
-	done
-
 all: $(extra-parts)
 
 install-unwind_h:
diff --git a/libgcc/config.host b/libgcc/config.host
--- a/libgcc/config.host
+++ b/libgcc/config.host
@@ -179,7 +179,8 @@ case ${host} in
   # This is the generic ELF configuration of FreeBSD.  Later
   # machine-specific sections may refine and add to this
   # configuration.
-  tmake_file="$tmake_file t-eh-dw2-dip t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver"
+  tmake_file="$tmake_file t-crtstuff-pic t-eh-dw2-dip t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver"
+  extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
   case ${target_thread_file} in
     posix)
       # Before 5.0, FreeBSD can't bind shared libraries to -lc
@@ -193,15 +194,29 @@ case ${host} in
   esac
   ;;
 *-*-linux* | frv-*-*linux* | *-*-kfreebsd*-gnu | *-*-knetbsd*-gnu | *-*-gnu* | *-*-kopensolaris*-gnu)
-  tmake_file="$tmake_file t-eh-dw2-dip t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-linux"
+  tmake_file="$tmake_file t-crtstuff-pic t-eh-dw2-dip t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-linux"
   extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o"
   ;;
+*-*-lynxos*)
+  tmake_file="$tmake_file $cpu_type/t-crtstuff t-crtstuff-pic"
+  extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
+  ;;
 *-*-netbsd*)
-  tmake_file="$tmake_file t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver"
+  tmake_file="$tmake_file t-crtstuff-pic t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver"
+  # NetBSD 1.7 and later are set up to use GCC's crtstuff for
+  # ELF configurations.  We will clear extra_parts in the
+  # a.out configurations.
+  case ${host} in
+    *-*-netbsd*1.[7-9]* | *-*-netbsd[2-9]* | *-*-netbsdelf[2-9]*)
+      extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o"
+      ;;
+  esac
   ;;
 *-*-openbsd*)
+  tmake_file="$tmake_file t-crtstuff-pic"
   ;;
 *-*-rtems*)
+  extra_parts="crtbegin.o crtend.o"
   ;;
 *-*-solaris2*)
   # Unless linker support and dl_iterate_phdr are present,
@@ -225,14 +240,21 @@ case ${host} in
       extra_parts="$extra_parts crt1.o gcrt1.o"
       ;;
     *)
-      tmake_file="$tmake_file t-crtin"
       extra_parts="$extra_parts crt1.o crti.o crtn.o gcrt1.o"
       ;;
   esac
   ;;
+*-*-uclinux*)
+  extra_parts="crtbegin.o crtend.o"
+  ;;
+*-*-*vms*)
+  tmake_file="vms/t-vms"
+  extra_parts="vcrt0.o pcrt0.o crtbegin.o crtbeginS.o crtend.o crtendS.o"
+  ;;
 *-*-vxworks*)
   ;;
 *-*-elf)
+  extra_parts="crtbegin.o crtend.o"
   ;;
 esac
 
@@ -257,7 +279,7 @@ alpha*-*-linux*)
 	;;
 alpha*-*-freebsd*)
 	tmake_file="${tmake_file} t-crtfm"
-	extra_parts="$extra_parts crtfastmath.o"
+	extra_parts="$extra_parts crtbeginT.o crtfastmath.o"
 	;;
 alpha*-*-netbsd*)
 	;;
@@ -274,15 +296,18 @@ alpha*-dec-osf5.1*)
 	md_unwind_header=alpha/osf5-unwind.h
 	;;
 alpha64-dec-*vms*)
-	tmake_file="vms/t-vms vms/t-vms64 alpha/t-vms t-slibgcc-vms"
+	tmake_file="$tmake_file alpha/t-vms t-slibgcc-vms"
+	extra_parts="$extra_parts vms-dwarf2.o vms-dwarf2eh.o"
 	md_unwind_header=alpha/vms-unwind.h
 	;;
 alpha*-dec-*vms*)
-	tmake_file="vms/t-vms alpha/t-vms t-slibgcc-vms"
+	tmake_file="$tmake_file alpha/t-vms t-slibgcc-vms"
+	extra_parts="$extra_parts vms-dwarf2.o vms-dwarf2eh.o"
 	md_unwind_header=alpha/vms-unwind.h
 	;;
 arm-wrs-vxworks)
-	tmake_file=t-fdpbit
+	tmake_file="$tmake_file t-fdpbit"
+	extra_parts="$extra_parts crti.o crtn.o"
 	;;
 arm*-*-freebsd*)
 	tmake_file="$tmake_file t-fdpbit"
@@ -309,18 +334,22 @@ arm*-*-uclinux*)		# ARM ucLinux
 	  ;;
 	esac
 	tmake_file="$tmake_file t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
+	extra_parts="$extra_parts crti.o crtn.o"
 	;;
 arm*-*-ecos-elf)
 	tmake_file="$tmake_file t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
+	extra_parts="$extra_parts crti.o crtn.o"
 	;;
 arm*-*-eabi* | arm*-*-symbianelf* )
 	tmake_file="${tmake_file} t-fixedpoint-gnu-prefix"
 	case ${host} in
 	arm*-*-eabi*)
 	  tmake_file="${tmake_file} arm/t-bpabi"
+	  extra_parts="crtbegin.o crtend.o crti.o crtn.o"
 	  ;;
 	arm*-*-symbianelf*)
 	  tmake_file="${tmake_file} arm/t-symbian t-slibgcc-nolc-override"
+	  # Symbian OS provides its own startup code.
 	  ;;
 	esac
 	tmake_file="$tmake_file t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
@@ -328,62 +357,85 @@ arm*-*-eabi* | arm*-*-symbianelf* )
 	;;
 arm*-*-rtems*)
 	tmake_file="$tmake_file t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
+	extra_parts="$extra_parts crti.o crtn.o"
 	;;
 arm*-*-elf)
 	tmake_file="$tmake_file t-softfp-sfdf t-softfp-excl arm/t-softfp t-softfp"
+	extra_parts="$extra_parts crti.o crtn.o"
 	;;
 arm*-wince-pe*)
 	;;
 avr-*-rtems*)
 	tmake_file=t-fpbit
+	# Don't use default.
+	extra_parts=
 	;;
 avr-*-*)
 	# Make HImode functions for AVR
 	tmake_file="${cpu_type}/t-avr t-fpbit"
 	;;
 bfin*-elf*)
-	tmke_file=t-fdpbit
+	tmake_file="bfin/t-crtlibid bfin/t-crtstuff t-fdpbit"
+	extra_parts="$extra_parts crtbeginS.o crtendS.o crti.o crtn.o crtlibid.o"
         ;;
 bfin*-uclinux*)
-	tmake_file=t-fdpbit
+	tmake_file="bfin/t-crtlibid bfin/t-crtstuff t-fdpbit"
+	extra_parts="$extra_parts crtbeginS.o crtendS.o crtlibid.o"
 	md_unwind_header=bfin/linux-unwind.h
         ;;
 bfin*-linux-uclibc*)
-	tmake_file="$tmake_file t-fdpbit bfin/t-linux"
+	tmake_file="$tmake_file bfin/t-crtstuff t-fdpbit bfin/t-linux"
 	# No need to build crtbeginT.o on uClibc systems.  Should probably
 	# be moved to the OS specific section above.
 	extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
 	md_unwind_header=bfin/linux-unwind.h
 	;;
 bfin*-rtems*)
-	tmake_file=t-fdpbit
+	tmake_file="$tmake_file t-fdpbit"
+	extra_parts="$extra_parts crti.o crtn.o"
 	;;
 bfin*-*)
-	tmake_file=t-fdpbit
+	tmake_file="$tmake_file t-fdpbit"
+	extra_parts="crtbegin.o crtend.o crti.o crtn.o"
         ;;
-crisv32-*-elf | crisv32-*-none | cris-*-elf | cris-*-none)
+crisv32-*-elf)
+ 	tmake_file=t-fdpbit
+ 	;;
+crisv32-*-none)
 	tmake_file=t-fdpbit
 	extra_parts="crtbegin.o crtend.o"
 	;;
+cris-*-elf)
+	tmake_file="$tmake_file cris/t-elfmulti"
+	;;
+cris-*-none)
+	tmake_file="$tmake_file cris/t-elfmulti"
+ 	extra_parts="crtbegin.o crtend.o"
+	;;
 cris-*-linux* | crisv32-*-linux*)
 	tmake_file="$tmake_file t-fdpbit cris/t-linux"
 	;;
 fido-*-elf)
 	;;
 fr30-*-elf)
-	tmake_file=t-fdpbit
+	tmake_file="$tmake_file t-fdpbit"
+	extra_parts="$extra_parts crti.o crtn.o"
 	;;
 frv-*-elf)
-	tmake_file=t-fdpbit
+	tmake_file="$tmake_file frv/t-frv t-fdpbit"
+	# Don't use crtbegin.o, crtend.o.
+	extra_parts="frvbegin.o frvend.o"
 	;;
 frv-*-*linux*)
 	tmake_file="$tmake_file t-fdpbit frv/t-linux"
 	;;
 h8300-*-rtems*)
-	tmake_file=t-fpbit
+	tmake_file="$tmake_file t-fpbit"
+	extra_parts="$extra_parts crti.o crtn.o"
 	;;
 h8300-*-elf*)
-	tmake_file=t-fpbit
+	tmake_file="$tmake_file t-fpbit"
+	extra_parts="$extra_parts crti.o crtn.o"
 	;;
 hppa*64*-*-linux*)
 	;;
@@ -409,7 +461,7 @@ hppa[12]*-*-hpux10*)
 	md_unwind_header=pa/hpux-unwind.h
 	;;
 hppa*64*-*-hpux11*)
-	tmake_file="$tmake_file t-slibgcc"
+	tmake_file="$tmake_file pa/t-stublib pa/t-stublib64 t-slibgcc"
 	# Set the libgcc version number
 	if test x$enable_sjlj_exceptions = xyes; then
 	    tmake_file="$tmake_file pa/t-slibgcc-sjlj-ver"
@@ -417,10 +469,12 @@ hppa*64*-*-hpux11*)
 	    tmake_file="$tmake_file pa/t-slibgcc-dwarf-ver"
 	fi
 	tmake_file="$tmake_file pa/t-slibgcc-hpux t-slibgcc-hpux"
+	extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o \
+		     libgcc_stub.a"
 	md_unwind_header=pa/hpux-unwind.h
 	;;
 hppa[12]*-*-hpux11*)
-	tmake_file="$tmake_file t-slibgcc"
+	tmake_file="$tmake_file pa/t-stublib t-slibgcc"
 	# Set the libgcc version number
 	if test x$enable_sjlj_exceptions = xyes; then
 	    tmake_file="$tmake_file pa/t-slibgcc-sjlj-ver"
@@ -428,6 +482,7 @@ hppa[12]*-*-hpux11*)
 	    tmake_file="$tmake_file pa/t-slibgcc-dwarf-ver"
 	fi
 	tmake_file="$tmake_file pa/t-slibgcc-hpux t-slibgcc-hpux"
+	extra_parts="libgcc_stub.a"
 	md_unwind_header=pa/hpux-unwind.h
 	;;
 i[34567]86-*-darwin*)
@@ -439,18 +494,21 @@ x86_64-*-darwin*)
 	extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
 	;;
 i[34567]86-*-elf*)
+	tmake_file="$tmake_file i386/t-crtstuff t-crtstuff-pic"
 	;;
 x86_64-*-elf*)
+	tmake_file="$tmake_file i386/t-crtstuff t-crtstuff-pic"
 	;;
 i[34567]86-*-freebsd*)
-	tmake_file="${tmake_file} i386/t-freebsd"
+	tmake_file="${tmake_file} i386/t-freebsd i386/t-crtstuff"
 	;;
 x86_64-*-freebsd*)
-	tmake_file="${tmake_file} i386/t-freebsd"
+	tmake_file="${tmake_file} i386/t-freebsd i386/t-crtstuff"
 	;;
 i[34567]86-*-netbsdelf*)
 	;;
 x86_64-*-netbsd*)
+	tmake_file="${tmake_file} i386/t-crtstuff"
 	;;
 i[34567]86-*-openbsd2.*|i[34567]86-*openbsd3.[0123])
 	;;
@@ -458,31 +516,33 @@ i[34567]86-*-openbsd*)
 	;;
 i[34567]86-*-linux*)
 	extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
-	tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm t-dfprules"
+	tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm i386/t-crtstuff t-dfprules"
 	md_unwind_header=i386/linux-unwind.h
 	;;
 i[34567]86-*-kfreebsd*-gnu | i[34567]86-*-knetbsd*-gnu | i[34567]86-*-gnu* | i[34567]86-*-kopensolaris*-gnu)
 	extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
-	tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm t-dfprules"
+	tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm i386/t-crtstuff t-dfprules"
 	;;
 x86_64-*-linux*)
 	extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
-	tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm t-dfprules"
+	tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm i386/t-crtstuff t-dfprules"
 	md_unwind_header=i386/linux-unwind.h
 	;;
 x86_64-*-kfreebsd*-gnu | x86_64-*-knetbsd*-gnu)
 	extra_parts="$extra_parts crtprec32.o crtprec64.o crtprec80.o crtfastmath.o"
-	tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm t-dfprules"
+	tmake_file="${tmake_file} i386/t-crtpc i386/t-crtfm i386/t-crtstuff t-dfprules"
 	;;
 i[34567]86-pc-msdosdjgpp*)
 	;;
 i[34567]86-*-lynxos*)
 	;;
 i[34567]86-*-nto-qnx*)
+	tmake_file="$tmake_file i386/t-nto"
+	extra_parts=crtbegin.o
 	;;
 i[34567]86-*-rtems*)
-	extra_parts="crtbegin.o crtend.o crti.o crtn.o"
-	tmake_file="${tmake_file} t-crtin i386/t-softfp i386/t-crtstuff t-rtems"
+	extra_parts="$extra_parts crti.o crtn.o"
+	tmake_file="${tmake_file} i386/t-softfp i386/t-crtstuff t-rtems"
 	;;
 i[34567]86-*-solaris2* | x86_64-*-solaris2.1[0-9]*)
 	tmake_file="$tmake_file i386/t-crtpc i386/t-crtfm"
@@ -548,14 +608,15 @@ x86_64-*-mingw*)
 i[34567]86-*-interix3*)
 	;;
 ia64*-*-elf*)
-	extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o"
+	extra_parts="$extra_parts crtbeginS.o crtendS.o crtfastmath.o"
 	tmake_file="ia64/t-ia64 ia64/t-eh-ia64 t-crtfm"
 	;;
 ia64*-*-freebsd*)
-	extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o"
+	extra_parts="$extra_parts crtfastmath.o"
 	tmake_file="$tmake_file ia64/t-ia64 ia64/t-eh-ia64 t-crtfm"
 	;;
 ia64*-*-linux*)
+	# Don't use crtbeginT.o from *-*-linux* default.
 	extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtfastmath.o"
 	tmake_file="$tmake_file ia64/t-ia64 t-crtfm t-softfp-tf ia64/t-softfp t-softfp ia64/t-softfp-compat ia64/t-eh-ia64 t-libunwind ia64/t-linux"
 	if test x$with_system_libunwind != xyes ; then
@@ -567,31 +628,37 @@ ia64*-*-hpux*)
 	tmake_file="ia64/t-hpux t-slibgcc ia64/t-slibgcc-hpux t-slibgcc-hpux"
 	;;
 ia64-hp-*vms*)
-	tmake_file="vms/t-vms vms/t-vms64 ia64/t-eh-ia64 ia64/t-vms t-slibgcc-vms"
+	tmake_file="$tmake_file ia64/t-eh-ia64 ia64/t-vms t-slibgcc-vms"
+	extra_parts="$extra_parts crtinitS.o"
 	md_unwind_header=ia64/vms-unwind.h
 	;;
 iq2000*-*-elf*)
 	tmake_file=t-fdpbit
+	# Don't use default.
+	extra_parts=
         ;;
 lm32-*-elf*|lm32-*-rtems*)
-        extra_parts="crtbegin.o crtend.o crti.o crtn.o"
+        extra_parts="$extra_parts crti.o crtn.o"
         tmake_file="lm32/t-lm32 lm32/t-elf t-softfp-sfdf t-softfp"
 	;;
 lm32-*-uclinux*)
-        extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o"
+        extra_parts="$extra_parts crtbegin.o crtendS.o crtbeginT.o"
         tmake_file="lm32/t-lm32 lm32/t-uclinux t-softfp-sfdf t-softfp"
 	;;	
-m32r-*-elf*|m32r-*-rtems*)
+m32r-*-elf*)
 	tmake_file=t-fdpbit
  	;;
+m32r-*-rtems*)
+	tmake_file="m32r/t-m32r t-fdpbit"
+	;;
 m32rle-*-elf*)
 	tmake_file=t-fdpbit
 	;;
 m32r-*-linux*)
-	tmake_file="$tmake_file t-fdpbit m32r/t-linux"
+	tmake_file="$tmake_file m32r/t-linux t-fdpbit"
  	;;
 m32rle-*-linux*)
-	tmake_file="$tmake_file t-fdpbit m32r/t-linux"
+	tmake_file="$tmake_file m32r/t-linux t-fdpbit"
 	;;
 m68k-*-elf*)
 	;;
@@ -613,15 +680,18 @@ m68k-*-linux*)			# Motorola m68k's runni
 	md_unwind_header=m68k/linux-unwind.h
 	;;
 m68k-*-rtems*)
+	extra_parts="$extra_parts crti.o crtn.o"
 	;;
 mcore-*-elf)
 	tmake_file=t-fdpbit
+	extra_parts="$extra_parts crti.o crtn.o"
 	;;
 microblaze*-linux*)
         tmake_file="$tmake_file t-slibgcc-nolc-override microblaze/t-microblaze t-fdpbit"
 	;;
 microblaze*-*-*)
         tmake_file="microblaze/t-microblaze t-fdpbit"
+	extra_parts="crtbegin.o crtend.o crti.o crtn.o"
 	;;
 mips-sgi-irix6.5*)
 	tmake_file="$tmake_file mips/t-irix6 t-crtfm mips/t-tpbit t-slibgcc mips/t-slibgcc-irix"
@@ -643,47 +713,57 @@ mips*-*-linux*)				# Linux MIPS, either 
 mips*-*-openbsd*)
 	;;
 mips*-sde-elf*)
+	tmake_file="mips/t-crtstuff mips/t-mips16"
 	case "${with_newlib}" in
 	  yes)
 	    # newlib / libgloss.
 	    ;;
 	  *)
 	    # MIPS toolkit libraries.
-	    tmake_file=mips/t-sdemtk
+	    tmake_file="$tmake_file mips/t-sdemtk"
 	    ;;
 	esac
-	tmake_file="$tmake_file mips/t-mips16"
+	extra_parts="$extra_parts crti.o crtn.o"
 	;;
 mipsisa32-*-elf* | mipsisa32el-*-elf* | \
 mipsisa32r2-*-elf* | mipsisa32r2el-*-elf* | \
 mipsisa64-*-elf* | mipsisa64el-*-elf* | \
 mipsisa64r2-*-elf* | mipsisa64r2el-*-elf*)
-	tmake_file="$tmake_file mips/t-mips16"
+	tmake_file="$tmake_file mips/t-crtstuff mips/t-mips16"
+	extra_parts="$extra_parts crti.o crtn.o"
 	;;
 mipsisa64sr71k-*-elf*)
-	tmake_file=t-fdpbit
+	tmake_file="mips/t-crtstuff t-fdpbit"
+	extra_parts="$extra_parts crti.o crtn.o"
         ;;
 mipsisa64sb1-*-elf* | mipsisa64sb1el-*-elf*)
-	tmake_file="$tmake_file mips/t-mips16"
+	tmake_file="$tmake_file mips/t-crtstuff mips/t-mips16"
+	extra_parts="$extra_parts crti.o crtn.o"
 	;;
 mips-*-elf* | mipsel-*-elf*)
-	tmake_file="$tmake_file mips/t-mips16"
+	tmake_file="$tmake_file mips/t-crtstuff mips/t-mips16"
+	extra_parts="$extra_parts crti.o crtn.o"
 	;;
 mips64-*-elf* | mips64el-*-elf*)
-	tmake_file="$tmake_file mips/t-mips16"
+	tmake_file="$tmake_file mips/t-crtstuff mips/t-mips16"
+	extra_parts="$extra_parts crti.o crtn.o"
 	;;
 mips64vr-*-elf* | mips64vrel-*-elf*)
+	tmake_file="$tmake_file mips/t-crtstuff"
+	extra_parts="$extra_parts crti.o crtn.o"
         ;;
 mips64orion-*-elf* | mips64orionel-*-elf*)
-	tmake_file="$tmake_file mips/t-mips16"
+	tmake_file="$tmake_file mips/t-crtstuff mips/t-mips16"
+	extra_parts="$extra_parts crti.o crtn.o"
 	;;
 mips*-*-rtems*)
-	tmake_file="$tmake_file mips/t-mips16"
+	tmake_file="$tmake_file mips/t-crtstuff mips/t-mips16"
+	extra_parts="$extra_parts crti.o crtn.o"
 	;;
 mips-wrs-vxworks)
 	;;
 mipstx39-*-elf* | mipstx39el-*-elf*)
-	tmake_file="$tmake_file mips/t-mips16"
+	tmake_file="$tmake_file mips/t-crtstuff mips/t-mips16"
 	;;
 mmix-knuth-mmixware)
 	extra_parts="crti.o crtn.o crtbegin.o crtend.o"
@@ -692,9 +772,14 @@ mmix-knuth-mmixware)
 mn10300-*-*)
 	tmake_file=t-fdpbit
 	;;
-moxie-*-*)
+moxie-*-elf | moxie-*-uclinux*)
 	tmake_file="moxie/t-moxie t-softfp-sfdf t-softfp-excl t-softfp"
-	extra_parts="crtbegin.o crtend.o crti.o crtn.o"
+	extra_parts="$extra_parts crti.o crtn.o"
+	;;
+moxie-*-rtems*)
+	tmake_file="moxie/t-moxie t-softfp-sfdf t-softfp-excl t-softfp"
+	# Don't use default.
+	extra_parts=
 	;;
 pdp11-*-*)
 	tmake_file=t-fdpbit
@@ -720,52 +805,66 @@ powerpc64-*-darwin*)
 	extra_parts="$extra_parts crt2.o"
 	;;
 powerpc-*-freebsd*)
-	tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-freebsd t-softfp-sfdf t-softfp-excl t-softfp t-slibgcc-libgcc"
+	tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-crtstuff rs6000/t-freebsd t-softfp-sfdf t-softfp-excl t-softfp t-slibgcc-libgcc"
+	extra_parts="$extra_parts crtbeginT.o ecrti.o ecrtn.o ncrti.o ncrtn.o"
 	;;
 powerpc-*-netbsd*)
+	tmake_file="$tmake_file rs6000/t-crtstuff"
 	;;
 powerpc-*-eabispe*)
-	tmake_file="${tmake_file} rs6000/t-ppccomm"
+	tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-crtstuff t-crtstuff-pic"
+	extra_parts="$extra_parts crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o ecrti.o ecrtn.o ncrti.o ncrtn.o"
 	;;
 powerpc-*-eabisimaltivec*)
-	tmake_file="rs6000/t-ppccomm-ldbl t-fdpbit"
+	tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-ppccomm-ldbl rs6000/t-crtstuff t-crtstuff-pic t-fdpbit"
+	extra_parts="$extra_parts crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o ecrti.o ecrtn.o ncrti.o ncrtn.o"
 	;;
 powerpc-*-eabisim*)
-	tmake_file="rs6000/t-ppccomm-ldbl t-fdpbit"
+	tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-ppccomm-ldbl rs6000/t-crtstuff t-crtstuff-pic t-fdpbit"
+	extra_parts="$extra_parts crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o ecrti.o ecrtn.o ncrti.o ncrtn.o"
 	;;
 powerpc-*-elf*)
-	tmake_file="rs6000/t-ppccomm-ldbl t-fdpbit"
+	tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-ppccomm-ldbl rs6000/t-crtstuff t-crtstuff-pic t-fdpbit"
+	extra_parts="$extra_parts crtbeginS.o crtendS.o crtbeginT.o ecrti.o ecrtn.o ncrti.o ncrtn.o"
 	;;
 powerpc-*-eabialtivec*)
-	tmake_file="rs6000/t-ppccomm-ldbl t-fdpbit"
+	tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-ppccomm-ldbl rs6000/t-crtstuff t-crtstuff-pic t-fdpbit"
+	extra_parts="$extra_parts crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o ecrti.o ecrtn.o ncrti.o ncrtn.o"
 	;;
 powerpc-xilinx-eabi*)
-	tmake_file="rs6000/t-ppccomm-ldbl t-fdpbit"
+	tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-ppccomm-ldbl rs6000/t-crtstuff t-crtstuff-pic t-fdpbit"
+	extra_parts="$extra_parts crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o ecrti.o ecrtn.o ncrti.o ncrtn.o"
 	;;
 powerpc-*-eabi*)
-	tmake_file="${tmake_file} rs6000/t-ppccomm t-fdpbit"
+	tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-crtstuff t-crtstuff-pic t-fdpbit"
+	extra_parts="$extra_parts crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o ecrti.o ecrtn.o ncrti.o ncrtn.o"
 	;;
 powerpc-*-rtems*)
-	tmake_file="rs6000/t-ppccomm-ldbl t-fdpbit"
+	tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-ppccomm-ldbl rs6000/t-crtstuff t-crtstuff-pic t-fdpbit"
+	extra_parts="$extra_parts crtbeginS.o crtendS.o crtbeginT.o ecrti.o ecrtn.o ncrti.o ncrtn.o"
 	;;
 powerpc-*-linux* | powerpc64-*-linux*)
-	tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-linux t-softfp-sfdf t-softfp-excl t-dfprules rs6000/t-ppc64-fp t-softfp t-slibgcc-libgcc"
+	tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-crtstuff rs6000/t-linux t-softfp-sfdf t-softfp-excl t-dfprules rs6000/t-ppc64-fp t-softfp t-slibgcc-libgcc"
+	extra_parts="$extra_parts ecrti.o ecrtn.o ncrti.o ncrtn.o"
 	md_unwind_header=rs6000/linux-unwind.h
 	;;
 powerpc-wrs-vxworks|powerpc-wrs-vxworksae)
 	tmake_file="rs6000/t-ppccomm-ldbl t-fdpbit"
 	;;
 powerpc-*-lynxos*)
-	tmake_file=t-fdpbit
+	tmake_file="$tmake_file t-fdpbit"
 	;;
 powerpcle-*-elf*)
-	tmake_file="rs6000/t-ppccomm-ldbl t-fdpbit"
+	tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-ppccomm-ldbl rs6000/t-crtstuff t-crtstuff-pic t-fdpbit"
+	extra_parts="$extra_parts crtbeginS.o crtendS.o crtbeginT.o ecrti.o ecrtn.o ncrti.o ncrtn.o"
 	;;
 powerpcle-*-eabisim*)
-	tmake_file="rs6000/t-ppccomm-ldbl t-fdpbit"
+	tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-ppccomm-ldbl rs6000/t-crtstuff t-crtstuff-pic t-fdpbit"
+	extra_parts="$extra_parts crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o ecrti.o ecrtn.o ncrti.o ncrtn.o"
 	;;
 powerpcle-*-eabi*)
-	tmake_file="rs6000/t-ppccomm-ldbl t-fdpbit"
+	tmake_file="${tmake_file} rs6000/t-ppccomm rs6000/t-ppccomm-ldbl rs6000/t-crtstuff t-crtstuff-pic t-fdpbit"
+	extra_parts="$extra_parts crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o ecrti.o ecrtn.o ncrti.o ncrtn.o"
 	;;
 rs6000-ibm-aix4.[3456789]* | powerpc-ibm-aix4.[3456789]*)
 	md_unwind_header=rs6000/aix-unwind.h
@@ -780,7 +879,6 @@ rs6000-ibm-aix[56789].* | powerpc-ibm-ai
 	tmake_file="t-fdpbit rs6000/t-ppc64-fp rs6000/t-ibm-ldouble rs6000/t-slibgcc-aix"
 	;;
 rx-*-elf)
-	extra_parts="crtbegin.o crtend.o"
 	tmake_file="rx/t-rx t-fdpbit"
 	;;
 s390-*-linux*)
@@ -793,36 +891,45 @@ s390x-*-linux*)
 	;;
 s390x-ibm-tpf*)
 	tmake_file="${tmake_file} s390/t-crtstuff s390/t-tpf t-eh-dw2-dip"
+	extra_parts="crtbeginS.o crtendS.o"
 	md_unwind_header=s390/tpf-unwind.h
 	;;
 score-*-elf)
 	tmake_file="${tmake_file} t-softfp-sfdf t-softfp-excl t-softfp"
+	extra_parts="$extra_parts crti.o crtn.o"
         ;;
-sh-*-elf* | sh[12346l]*-*-elf* | \
-  sh-*-linux* | sh[2346lbe]*-*-linux* | \
-  sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
-   sh64-*-netbsd* | sh64l*-*-netbsd*)
+sh-*-elf* | sh[12346l]*-*-elf*)
+	tmake_file="$tmake_file sh/t-sh t-crtstuff-pic t-fdpbit"
+	extra_parts="$extra_parts crt1.o crti.o crtn.o crtbeginS.o crtendS.o \
+		libic_invalidate_array_4-100.a \
+		libic_invalidate_array_4-200.a \
+		libic_invalidate_array_4a.a \
+		libgcc-Os-4-200.a libgcc-4-300.a"
 	case ${host} in
-	sh*-*-linux*)
-		tmake_file="${tmake_file} t-slibgcc-libgcc sh/t-linux t-fdpbit"
-		md_unwind_header=sh/linux-unwind.h
-		;;
-	sh*-*-netbsd*)
-		# NetBSD's C library includes a fast software FP library that
-		# has support for setting/setting the rounding mode, exception
-		# mask, etc.  Therefore, we don't want to include software FP
-		# in libgcc.
-		;;
-	sh*-*-*)
-	        tmake_file=t-fdpbit
-		;;
-	esac
+	sh*-superh-elf)
+		tmake_file="$tmake_file sh/t-superh"
+		extra_parts="$extra_parts crt1-mmu.o gcrt1-mmu.o gcrt1.o"
+ 		;;
+ 	esac
+	;;
+sh-*-linux* | sh[2346lbe]*-*-linux*)
+	tmake_file="${tmake_file} t-slibgcc-libgcc sh/t-linux t-fdpbit"
+	md_unwind_header=sh/linux-unwind.h
+	;;
+sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
+  sh64-*-netbsd* | sh64l*-*-netbsd*)
+	# NetBSD's C library includes a fast software FP library that
+	# has support for setting/setting the rounding mode, exception
+	# mask, etc.  Therefore, we don't want to include software FP
+	# in libgcc.
 	;;
 sh-*-rtems*)
-	tmake_file=t-fdpbit
+	tmake_file="$tmake_file t-crtstuff-pic t-fdpbit"
+	extra_parts="$extra_parts crt1.o crti.o crtn.o crtbeginS.o crtendS.o \
+		$sh_ic_extra_parts $sh_opt_extra_parts"
 	;;
 sh-wrs-vxworks)
-	tmake_file=t-fdpbit
+	tmake_file="$tmake_file t-crtstuff-pic t-fdpbit"
 	;;
 sparc-*-netbsdelf*)
 	;;
@@ -836,10 +943,11 @@ sparc-*-elf*)
 	  	tmake_file="sparc/t-softmul"
 	  	;;
 	esac
-	tmake_file="${tmake_file} t-fdpbit t-crtin t-crtfm"
-	extra_parts="crtbegin.o crtend.o crti.o crtn.o crtfastmath.o"
+	tmake_file="${tmake_file} t-fdpbit t-crtfm"
+	extra_parts="$extra_parts crti.o crtn.o crtfastmath.o"
 	;;
 sparc-*-linux*)		# SPARC's running GNU/Linux, libc6
+	tmake_file="${tmake_file} t-crtfm sparc/t-linux64"
 	case ${host} in
 	*-leon*)
 		tmake_file="${tmake_file} t-fdpbit"
@@ -849,12 +957,11 @@ sparc-*-linux*)		# SPARC's running GNU/L
 		;;
 	esac
 	extra_parts="$extra_parts crtfastmath.o"
-	tmake_file="${tmake_file} t-crtfm"
 	md_unwind_header=sparc/linux-unwind.h
 	;;
 sparc-*-rtems*)
-	tmake_file="sparc/t-elf t-crtin t-crtfm t-rtems t-fdpbit"
-	extra_parts="crtbegin.o crtend.o crti.o crtn.o crtfastmath.o"
+	tmake_file="sparc/t-elf t-crtfm t-rtems t-fdpbit"
+	extra_parts="$extra_parts crti.o crtn.o crtfastmath.o"
 	;;
 sparc*-*-solaris2*)
 	tmake_file="$tmake_file t-crtfm"
@@ -862,35 +969,41 @@ sparc*-*-solaris2*)
 	md_unwind_header=sparc/sol2-unwind.h
 	;;
 sparc64-*-elf*)
-	tmake_file="${tmake_file} t-crtin t-crtfm"
-	extra_parts="crtbegin.o crtend.o crti.o crtn.o crtfastmath.o"
+	tmake_file="${tmake_file} t-crtfm"
+	extra_parts="$extra_parts crti.o crtn.o crtfastmath.o"
 	;;
 sparc64-*-rtems*)
-	tmake_file="sparc/t-elf t-crtin t-crtfm t-rtems"
-	extra_parts="crtbegin.o crtend.o crti.o crtn.o crtfastmath.o"
+	tmake_file="sparc/t-elf t-crtfm t-rtems"
+	extra_parts="$extra_parts crti.o crtn.o crtfastmath.o"
 	;;
 sparc-wrs-vxworks)
 	;;
 sparc64-*-freebsd*|ultrasparc-*-freebsd*)
 	tmake_file="$tmake_file t-crtfm"
-	extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o crtfastmath.o"
+	extra_parts="$extra_parts crtfastmath.o"
 	;;
 sparc64-*-linux*)		# 64-bit SPARC's running GNU/Linux
 	extra_parts="$extra_parts crtfastmath.o"
-	tmake_file="${tmake_file} t-crtfm sparc/t-linux"
+	tmake_file="${tmake_file} t-crtfm sparc/t-linux sparc/t-linux64"
 	md_unwind_header=sparc/linux-unwind.h
 	;;
 sparc64-*-netbsd*)
 	;;
 spu-*-elf*)
-	tmake_file="t-fdpbit spu/t-elf"
+	tmake_file="$tmake_file spu/t-elf t-fdpbit"
+	extra_parts="$extra_parts \
+		libgcc_cachemgr.a libgcc_cachemgr_nonatomic.a \
+		libgcc_cache8k.a libgcc_cache16k.a libgcc_cache32k.a \
+		libgcc_cache64k.a libgcc_cache128k.a"
 	;;
 tic6x-*-uclinux)
-	tmake_file="${tmake_file} t-softfp-sfdf t-softfp-excl t-softfp c6x/t-elf t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-gnu-prefix"
+	tmake_file="${tmake_file} t-softfp-sfdf t-softfp-excl t-softfp c6x/t-elf  c6x/t-uclinux t-crtstuff-pic t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver t-gnu-prefix"
+	extra_parts="crtbeginS.o crtendS.o crti.o crtn.o"
 	unwind_header=config/c6x/unwind-c6x.h
 	;;
-tic6x-*-*)
-	tmake_file="${tmake_file} t-softfp-sfdf t-softfp-excl t-softfp c6x/t-elf t-gnu-prefix"
+tic6x-*-elf)
+	tmake_file="${tmake_file} t-softfp-sfdf t-softfp-excl t-softfp t-gnu-prefix c6x/t-elf"
+	extra_parts="$extra_parts crtbeginS.o crtendS.o crti.o crtn.o"
 	unwind_header=config/c6x/unwind-c6x.h
 	;;
 v850*-*-*)
@@ -906,20 +1019,23 @@ xstormy16-*-elf)
 	tmake_file=t-fdpbit
 	;;
 xtensa*-*-elf*)
-	tmake_file=xtensa/t-xtensa
+	tmake_file="$tmake_file xtensa/t-xtensa xtensa/t-elf"
+	extra_parts="$extra_parts crti.o crtn.o"
 	;;
 xtensa*-*-linux*)
 	tmake_file="$tmake_file xtensa/t-xtensa xtensa/t-linux"
 	md_unwind_header=xtensa/linux-unwind.h
 	;;
 am33_2.0-*-linux*)
+	# Don't need crtbeginT.o from *-*-linux* default.
 	extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o"
 	tmake_file="$tmake_file t-fdpbit"
 	;;
 m32c-*-elf*|m32c-*-rtems*)
  	;;
 mep*-*-*)
-	tmake_file=t-fdpbit
+	tmake_file="mep/t-mep t-fdpbit"
+	extra_parts="crtbegin.o crtend.o"
 	;;
 *)
 	echo "*** Configuration ${host} not supported" 1>&2
diff --git a/libgcc/config/alpha/t-vms b/libgcc/config/alpha/t-vms
new file mode 100644
--- /dev/null
+++ b/libgcc/config/alpha/t-vms
@@ -0,0 +1,7 @@
+# This object must be linked with in order to make the executable debuggable.
+# vms-ld handles it automatically when passed -g.
+vms-dwarf2.o: $(srcdir)/config/alpha/vms-dwarf2.S
+	$(gcc_compile) -c -x assembler-with-cpp $<
+
+vms-dwarf2eh.o: $(srcdir)/config/alpha/vms-dwarf2eh.S
+	$(gcc_compile) -c -x assembler-with-cpp $<
diff --git a/gcc/config/alpha/vms-dwarf2.asm b/libgcc/config/alpha/vms-dwarf2.S
rename from gcc/config/alpha/vms-dwarf2.asm
rename to libgcc/config/alpha/vms-dwarf2.S
diff --git a/gcc/config/alpha/vms-dwarf2eh.asm b/libgcc/config/alpha/vms-dwarf2eh.S
rename from gcc/config/alpha/vms-dwarf2eh.asm
rename to libgcc/config/alpha/vms-dwarf2eh.S
diff --git a/gcc/config/arm/crti.asm b/libgcc/config/arm/crti.S
rename from gcc/config/arm/crti.asm
rename to libgcc/config/arm/crti.S
--- a/gcc/config/arm/crti.asm
+++ b/libgcc/config/arm/crti.S
@@ -1,4 +1,4 @@
-#   Copyright (C) 2001, 2008, 2009, 2010 Free Software Foundation, Inc.
+#   Copyright (C) 2001, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
 #   Written By Nick Clifton
 # 
 # This file is free software; you can redistribute it and/or modify it
@@ -46,7 +46,7 @@
 #endif /* __ARM_EABI__ */
 
 	# Note - this macro is complemented by the FUNC_END macro
-	# in crtn.asm.  If you change this macro you must also change
+	# in crtn.S.  If you change this macro you must also change
 	# that macro match.
 .macro FUNC_START
 #ifdef __thumb__
@@ -83,4 +83,4 @@ _init:
 _fini:
 	FUNC_START
 	
-# end of crti.asm
+# end of crti.S
diff --git a/gcc/config/arm/crtn.asm b/libgcc/config/arm/crtn.S
rename from gcc/config/arm/crtn.asm
rename to libgcc/config/arm/crtn.S
--- a/gcc/config/arm/crtn.asm
+++ b/libgcc/config/arm/crtn.S
@@ -1,4 +1,5 @@
-#   Copyright (C) 2001, 2004, 2008, 2009, 2010 Free Software Foundation, Inc.
+#   Copyright (C) 2001, 2004, 2008, 2009, 2010, 2011
+#   Free Software Foundation, Inc.
 #   Written By Nick Clifton
 # 
 # This file is free software; you can redistribute it and/or modify it
@@ -41,7 +42,7 @@
 # This file is the last thing linked into any executable.
 
 	# Note - this macro is complemented by the FUNC_START macro
-	# in crti.asm.  If you change this macro you must also change
+	# in crti.S.  If you change this macro you must also change
 	# that macro match.
 	#
 	# Note - we do not try any fancy optimizations of the return
@@ -79,4 +80,4 @@
 	;;
 	FUNC_END
 	
-# end of crtn.asm
+# end of crtn.S
diff --git a/gcc/config/bfin/crti.s b/libgcc/config/bfin/crti.S
rename from gcc/config/bfin/crti.s
rename to libgcc/config/bfin/crti.S
diff --git a/gcc/config/bfin/crtlibid.s b/libgcc/config/bfin/crtlibid.S
rename from gcc/config/bfin/crtlibid.s
rename to libgcc/config/bfin/crtlibid.S
diff --git a/gcc/config/bfin/crtn.s b/libgcc/config/bfin/crtn.S
rename from gcc/config/bfin/crtn.s
rename to libgcc/config/bfin/crtn.S
diff --git a/libgcc/config/bfin/t-crtlibid b/libgcc/config/bfin/t-crtlibid
new file mode 100644
--- /dev/null
+++ b/libgcc/config/bfin/t-crtlibid
@@ -0,0 +1,3 @@
+# Assemble startup files.
+crtlibid.o: $(srcdir)/config/bfin/crtlibid.S
+	$(gcc_compile) -c -x assembler-with-cpp $<
diff --git a/libgcc/config/bfin/t-crtstuff b/libgcc/config/bfin/t-crtstuff
new file mode 100644
--- /dev/null
+++ b/libgcc/config/bfin/t-crtstuff
@@ -0,0 +1,1 @@
+CRTSTUFF_T_CFLAGS = -fpic
diff --git a/gcc/config/c6x/crti.s b/libgcc/config/c6x/crti.S
rename from gcc/config/c6x/crti.s
rename to libgcc/config/c6x/crti.S
diff --git a/gcc/config/c6x/crtn.s b/libgcc/config/c6x/crtn.S
rename from gcc/config/c6x/crtn.s
rename to libgcc/config/c6x/crtn.S
diff --git a/libgcc/config/c6x/t-elf b/libgcc/config/c6x/t-elf
--- a/libgcc/config/c6x/t-elf
+++ b/libgcc/config/c6x/t-elf
@@ -1,1 +1,15 @@
+# Cannot use default rules due to $(CRTSTUFF_T_CFLAGS).
+CUSTOM_CRTIN = yes
+
+# Assemble startup files.
+crti.o: $(srcdir)/config/c6x/crti.S
+	$(crt_compile) -c $(CRTSTUFF_T_CFLAGS) $<
+
+crtn.o: $(srcdir)/config/c6x/crtn.S
+	$(crt_compile) -c $(CRTSTUFF_T_CFLAGS) $<
+
+# Avoid failures when the user's GOT becomes too large.
+CRTSTUFF_T_CFLAGS = -msdata=none
+CRTSTUFF_T_CFLAGS_S = -msdata=none
+
 SHLIB_MAPFILES += $(srcdir)/config/c6x/libgcc-eabi.ver
diff --git a/libgcc/config/c6x/t-uclinux b/libgcc/config/c6x/t-uclinux
new file mode 100644
--- /dev/null
+++ b/libgcc/config/c6x/t-uclinux
@@ -0,0 +1,1 @@
+CRTSTUFF_T_CFLAGS += -fPIC
diff --git a/libgcc/config/cris/t-elfmulti b/libgcc/config/cris/t-elfmulti
new file mode 100644
--- /dev/null
+++ b/libgcc/config/cris/t-elfmulti
@@ -0,0 +1,1 @@
+CRTSTUFF_T_CFLAGS = -moverride-best-lib-options
diff --git a/libgcc/config/cris/t-linux b/libgcc/config/cris/t-linux
--- a/libgcc/config/cris/t-linux
+++ b/libgcc/config/cris/t-linux
@@ -1,2 +1,4 @@
+CRTSTUFF_T_CFLAGS_S = $(HOST_LIBGCC2_CFLAGS)
+
 # Override t-linux default.
 SHLIB_MAPFILES = libgcc-std.ver $(srcdir)/config/cris/libgcc-glibc.ver
diff --git a/gcc/config/fr30/crti.asm b/libgcc/config/fr30/crti.S
rename from gcc/config/fr30/crti.asm
rename to libgcc/config/fr30/crti.S
diff --git a/gcc/config/fr30/crtn.asm b/libgcc/config/fr30/crtn.S
rename from gcc/config/fr30/crtn.asm
rename to libgcc/config/fr30/crtn.S
--- a/gcc/config/fr30/crtn.asm
+++ b/libgcc/config/fr30/crtn.S
@@ -1,6 +1,6 @@
-# crtn.asm for ELF 
+# crtn.S for ELF 
 
-#   Copyright (C) 1992, 1999, 2008, 2009 Free Software Foundation, Inc.
+#   Copyright (C) 1992, 1999, 2008, 2009, 2011 Free Software Foundation, Inc.
 #   Written By David Vinayak Henkel-Wallace, June 1992
 # 
 # This file is free software; you can redistribute it and/or modify it
diff --git a/gcc/config/frv/frvbegin.c b/libgcc/config/frv/frvbegin.c
rename from gcc/config/frv/frvbegin.c
rename to libgcc/config/frv/frvbegin.c
diff --git a/gcc/config/frv/frvend.c b/libgcc/config/frv/frvend.c
rename from gcc/config/frv/frvend.c
rename to libgcc/config/frv/frvend.c
diff --git a/libgcc/config/frv/t-frv b/libgcc/config/frv/t-frv
new file mode 100644
--- /dev/null
+++ b/libgcc/config/frv/t-frv
@@ -0,0 +1,9 @@
+# Compile two additional files that are linked with every program
+# linked using GCC on systems using COFF or ELF, for the sake of C++
+# constructors.
+
+frvbegin$(objext): $(srcdir)/config/frv/frvbegin.c
+	$(gcc_compile) -c $<
+
+frvend$(objext): $(srcdir)/config/frv/frvend.c
+	$(gcc_compile) -c $<
diff --git a/libgcc/config/frv/t-linux b/libgcc/config/frv/t-linux
--- a/libgcc/config/frv/t-linux
+++ b/libgcc/config/frv/t-linux
@@ -1,1 +1,3 @@
+CRTSTUFF_T_CFLAGS = -fPIC
+
 SHLIB_MAPFILES = libgcc-std.ver $(srcdir)/config/frv/libgcc-glibc.ver
diff --git a/gcc/config/h8300/crti.asm b/libgcc/config/h8300/crti.S
rename from gcc/config/h8300/crti.asm
rename to libgcc/config/h8300/crti.S
--- a/gcc/config/h8300/crti.asm
+++ b/libgcc/config/h8300/crti.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2002, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2002, 2009, 2011 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -23,11 +23,11 @@ see the files COPYING3 and COPYING.RUNTI
 
 /* The code in sections .init and .fini is supposed to be a single
    regular function.  The function in .init is called directly from
-   start in crt0.asm.  The function in .fini is atexit()ed in crt0.asm
+   start in crt0.S.  The function in .fini is atexit()ed in crt0.S
    too.
 
-   crti.asm contributes the prologue of a function to these sections,
-   and crtn.asm comes up the epilogue.  STARTFILE_SPEC should list
+   crti.S contributes the prologue of a function to these sections,
+   and crtn.S comes up the epilogue.  STARTFILE_SPEC should list
    crti.o before any other object files that might add code to .init
    or .fini sections, and ENDFILE_SPEC should list crtn.o after any
    such object files.  */
diff --git a/gcc/config/h8300/crtn.asm b/libgcc/config/h8300/crtn.S
rename from gcc/config/h8300/crtn.asm
rename to libgcc/config/h8300/crtn.S
--- a/gcc/config/h8300/crtn.asm
+++ b/libgcc/config/h8300/crtn.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2009, 2011 Free Software Foundation, Inc.
    This file was adapted from glibc sources.
 
 This file is part of GCC.
@@ -22,7 +22,7 @@ a copy of the GCC Runtime Library Except
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
-/* See an explanation about .init and .fini in crti.asm.  */
+/* See an explanation about .init and .fini in crti.S.  */
 
 #ifdef __H8300H__
 #ifdef __NORMAL_MODE__
diff --git a/gcc/config/i386/cygming-crtbegin.c b/libgcc/config/i386/cygming-crtbegin.c
rename from gcc/config/i386/cygming-crtbegin.c
rename to libgcc/config/i386/cygming-crtbegin.c
diff --git a/gcc/config/i386/cygming-crtend.c b/libgcc/config/i386/cygming-crtend.c
rename from gcc/config/i386/cygming-crtend.c
rename to libgcc/config/i386/cygming-crtend.c
diff --git a/libgcc/config/i386/t-cygming b/libgcc/config/i386/t-cygming
--- a/libgcc/config/i386/t-cygming
+++ b/libgcc/config/i386/t-cygming
@@ -1,11 +1,9 @@
 CUSTOM_CRTSTUFF = yes
 
-crtbegin.o: $(gcc_srcdir)/config/i386/cygming-crtbegin.c
-	$(crt_compile) -fno-omit-frame-pointer  -c \
-	$(gcc_srcdir)/config/i386/cygming-crtbegin.c
+crtbegin.o: $(srcdir)/config/i386/cygming-crtbegin.c
+	$(crt_compile) -fno-omit-frame-pointer  -c $<
 
 # We intentionally use a implementation-reserved init priority of 0,
 # so allow the warning.
-crtend.o: $(gcc_srcdir)/config/i386/cygming-crtend.c
-	$(crt_compile) -fno-omit-frame-pointer -Wno-error -c \
-	$(gcc_srcdir)/config/i386/cygming-crtend.c
+crtend.o: $(srcdir)/config/i386/cygming-crtend.c
+	$(crt_compile) -fno-omit-frame-pointer -Wno-error -c $<
diff --git a/libgcc/config/i386/t-nto b/libgcc/config/i386/t-nto
new file mode 100644
--- /dev/null
+++ b/libgcc/config/i386/t-nto
@@ -0,0 +1,1 @@
+CRTSTUFF_T_CFLAGS = -fno-omit-frame-pointer -fPIC
diff --git a/gcc/config/ia64/crtbegin.asm b/libgcc/config/ia64/crtbegin.S
rename from gcc/config/ia64/crtbegin.asm
rename to libgcc/config/ia64/crtbegin.S
diff --git a/gcc/config/ia64/crtend.asm b/libgcc/config/ia64/crtend.S
rename from gcc/config/ia64/crtend.asm
rename to libgcc/config/ia64/crtend.S
diff --git a/gcc/config/ia64/crti.asm b/libgcc/config/ia64/crti.S
rename from gcc/config/ia64/crti.asm
rename to libgcc/config/ia64/crti.S
--- a/gcc/config/ia64/crti.asm
+++ b/libgcc/config/ia64/crti.S
@@ -1,4 +1,4 @@
-# Copyright (C) 2000, 2001, 2008, 2009 Free Software Foundation, Inc.
+# Copyright (C) 2000, 2001, 2008, 2009, 2011 Free Software Foundation, Inc.
 #   Written By Timothy Wall
 #
 # This file is free software; you can redistribute it and/or modify it
@@ -50,4 +50,4 @@ _fini:
 	mov	r33 = b0
 	.body
 
-# end of crti.asm
+# end of crti.S
diff --git a/gcc/config/ia64/crtn.asm b/libgcc/config/ia64/crtn.S
rename from gcc/config/ia64/crtn.asm
rename to libgcc/config/ia64/crtn.S
--- a/gcc/config/ia64/crtn.asm
+++ b/libgcc/config/ia64/crtn.S
@@ -1,4 +1,4 @@
-#   Copyright (C) 2000, 2001, 2008, 2009 Free Software Foundation, Inc.
+#   Copyright (C) 2000, 2001, 2008, 2009, 2011 Free Software Foundation, Inc.
 #   Written By Timothy Wall
 #
 # This file is free software; you can redistribute it and/or modify it
@@ -40,4 +40,4 @@
 	mov	r12 = r35
 	br.ret.sptk.many b0
 
-# end of crtn.asm
+# end of crtn.S
diff --git a/libgcc/config/ia64/t-ia64 b/libgcc/config/ia64/t-ia64
--- a/libgcc/config/ia64/t-ia64
+++ b/libgcc/config/ia64/t-ia64
@@ -1,17 +1,15 @@
 CUSTOM_CRTSTUFF = yes
 
 # Assemble startup files.
-crtbegin.o: $(gcc_srcdir)/config/ia64/crtbegin.asm
+# FIXME: -I$(gcc_objdir) is necessary to find auto-host.h.  Really?
+crtbegin.o: $(srcdir)/config/ia64/crtbegin.S
+	$(CC) $(compile_deps) -I. -I$(gcc_objdir) -c -x assembler-with-cpp $<
+crtend.o: $(srcdir)/config/ia64/crtend.S
+	$(CC) $(compile_deps) -I. -I$(gcc_objdir) -c -x assembler-with-cpp $<
+crtbeginS.o: $(srcdir)/config/ia64/crtbegin.S
+	$(CC) $(compile_deps) -I. -I$(gcc_objdir) -c -x assembler-with-cpp \			-o $@ -DSHARED $<
+crtendS.o: $(srcdir)/config/ia64/crtend.S
 	$(CC) $(compile_deps) -I. -I$(gcc_objdir) -c -x assembler-with-cpp \
-		-o $@ $(gcc_srcdir)/config/ia64/crtbegin.asm
-crtend.o: $(gcc_srcdir)/config/ia64/crtend.asm
-	$(CC) $(compile_deps) -I. -I$(gcc_objdir) -c -x assembler-with-cpp \
-		-o $@ $(gcc_srcdir)/config/ia64/crtend.asm
-crtbeginS.o: $(gcc_srcdir)/config/ia64/crtbegin.asm
-	$(CC) $(compile_deps) -I. -I$(gcc_objdir) -c -x assembler-with-cpp \
-		-o $@ -DSHARED $(gcc_srcdir)/config/ia64/crtbegin.asm
-crtendS.o: $(gcc_srcdir)/config/ia64/crtend.asm
-	$(CC) $(compile_deps) -I. -I$(gcc_objdir) -c -x assembler-with-cpp \
-		-o $@ -DSHARED $(gcc_srcdir)/config/ia64/crtend.asm
+		-o $@ -DSHARED $<
 
 SHLIB_MAPFILES += $(srcdir)/config/ia64/libgcc-ia64.ver
diff --git a/libgcc/config/ia64/t-vms b/libgcc/config/ia64/t-vms
--- a/libgcc/config/ia64/t-vms
+++ b/libgcc/config/ia64/t-vms
@@ -1,1 +1,7 @@
+CRTSTUFF_T_CFLAGS = -O0
+CRTSTUFF_T_CFLAGS_S = -O0
+
+crtinitS.o: $(srcdir)/config/ia64/vms-crtinit.S
+	$(gcc_compile) -c -x assembler-with-cpp $<
+
 LIB2ADDEH += $(srcdir)/config/ia64/fde-vms.c
diff --git a/gcc/config/ia64/vms-crtinit.asm b/libgcc/config/ia64/vms-crtinit.S
rename from gcc/config/ia64/vms-crtinit.asm
rename to libgcc/config/ia64/vms-crtinit.S
diff --git a/libgcc/config/lm32/t-elf b/libgcc/config/lm32/t-elf
--- a/libgcc/config/lm32/t-elf
+++ b/libgcc/config/lm32/t-elf
@@ -1,12 +1,2 @@
-# Assemble startup files.
-
-$(T)crti.o: $(srcdir)/config/lm32/crti.S $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-	-c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/lm32/crti.S
-
-$(T)crtn.o: $(srcdir)/config/lm32/crtn.S $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-	-c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/lm32/crtn.S
-
 CRTSTUFF_T_CFLAGS = -G 0 -msign-extend-enabled
 HOST_LIBGCC2_CFLAGS = -G 0 -msign-extend-enabled
diff --git a/gcc/config/m32r/initfini.c b/libgcc/config/m32r/initfini.c
rename from gcc/config/m32r/initfini.c
rename to libgcc/config/m32r/initfini.c
diff --git a/libgcc/config/m32r/t-m32r b/libgcc/config/m32r/t-m32r
new file mode 100644
--- /dev/null
+++ b/libgcc/config/m32r/t-m32r
@@ -0,0 +1,19 @@
+# We need to use -fpic when we are using gcc to compile the routines in
+# initfini.c.  This is only really needed when we are going to use gcc/g++
+# to produce a shared library, but since we don't know ahead of time when
+# we will be doing that, we just always use -fpic when compiling the
+# routines in initfini.c.
+# -fpic currently isn't supported for the m32r.
+# FIXME: No longer true.  Empty CRTSTUFF_T_CFLAGS is the default.
+CRTSTUFF_T_CFLAGS =
+
+# .init/.fini section routines
+crtinit.o: $(srcdir)/config/m32r/initfini.c
+	$(crt_compile) $(CRTSTUFF_T_CFLAGS) -DCRT_INIT \
+	-finhibit-size-directive -fno-inline-functions -g0 \
+	-mmodel=medium -c $<
+
+crtfini.o: $(srcdir)/config/m32r/initfini.c
+	$(crt_compile) $(CRTSTUFF_T_CFLAGS) -DCRT_FINI \
+	-finhibit-size-directive -fno-inline-functions -g0 \
+	-mmodel=medium -c $<
diff --git a/gcc/config/m68k/crti.s b/libgcc/config/m68k/crti.S
rename from gcc/config/m68k/crti.s
rename to libgcc/config/m68k/crti.S
diff --git a/gcc/config/m68k/crtn.s b/libgcc/config/m68k/crtn.S
rename from gcc/config/m68k/crtn.s
rename to libgcc/config/m68k/crtn.S
diff --git a/gcc/config/mcore/crti.asm b/libgcc/config/mcore/crti.S
rename from gcc/config/mcore/crti.asm
rename to libgcc/config/mcore/crti.S
--- a/gcc/config/mcore/crti.asm
+++ b/libgcc/config/mcore/crti.S
@@ -1,6 +1,7 @@
-# crti.asm for ELF based systems
+# crti.S for ELF based systems
 
-#   Copyright (C) 1992, 1998, 1999, 2008, 2009 Free Software Foundation, Inc.
+#   Copyright (C) 1992, 1998, 1999, 2008, 2009, 2011
+#   Free Software Foundation, Inc.
 #   Written By David Vinayak Henkel-Wallace, June 1992
 # 
 # This file is free software; you can redistribute it and/or modify it
diff --git a/gcc/config/mcore/crtn.asm b/libgcc/config/mcore/crtn.S
rename from gcc/config/mcore/crtn.asm
rename to libgcc/config/mcore/crtn.S
--- a/gcc/config/mcore/crtn.asm
+++ b/libgcc/config/mcore/crtn.S
@@ -1,7 +1,8 @@
-# crtn.asm for ELF based systems
+# crtn.S for ELF based systems
 
-# Copyright (C) 1992, 1999, 2000, 2008, 2009 Free Software Foundation, Inc.
-#   Written By David Vinayak Henkel-Wallace, June 1992
+# Copyright (C) 1992, 1999, 2000, 2008, 2009, 2011
+# Free Software Foundation, Inc.
+# Written By David Vinayak Henkel-Wallace, June 1992
 # 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by the
diff --git a/libgcc/config/mep/t-mep b/libgcc/config/mep/t-mep
new file mode 100644
--- /dev/null
+++ b/libgcc/config/mep/t-mep
@@ -0,0 +1,2 @@
+# Use -O0 instead of -O2 so we don't get complex relocations
+CRTSTUFF_CFLAGS += -O0
diff --git a/gcc/config/microblaze/crti.s b/libgcc/config/microblaze/crti.S
rename from gcc/config/microblaze/crti.s
rename to libgcc/config/microblaze/crti.S
diff --git a/gcc/config/microblaze/crtn.s b/libgcc/config/microblaze/crtn.S
rename from gcc/config/microblaze/crtn.s
rename to libgcc/config/microblaze/crtn.S
diff --git a/libgcc/config/microblaze/t-microblaze b/libgcc/config/microblaze/t-microblaze
--- a/libgcc/config/microblaze/t-microblaze
+++ b/libgcc/config/microblaze/t-microblaze
@@ -8,5 +8,3 @@ LIB2ADD += \
         $(srcdir)/config/microblaze/udivsi3.asm \
         $(srcdir)/config/microblaze/umodsi3.asm \
         $(srcdir)/config/microblaze/divsi3_table.c
-
-MULTILIB_OPTIONS = mxl-barrel-shift mno-xl-soft-mul mxl-multiply-high
diff --git a/gcc/config/mips/crti.asm b/libgcc/config/mips/crti.S
rename from gcc/config/mips/crti.asm
rename to libgcc/config/mips/crti.S
diff --git a/gcc/config/mips/crtn.asm b/libgcc/config/mips/crtn.S
rename from gcc/config/mips/crtn.asm
rename to libgcc/config/mips/crtn.S
diff --git a/libgcc/config/mips/t-crtstuff b/libgcc/config/mips/t-crtstuff
new file mode 100644
--- /dev/null
+++ b/libgcc/config/mips/t-crtstuff
@@ -0,0 +1,2 @@
+# Don't let CTOR_LIST end up in sdata section.
+CRTSTUFF_T_CFLAGS = -G 0
diff --git a/gcc/config/mmix/crti.asm b/libgcc/config/mmix/crti.S
rename from gcc/config/mmix/crti.asm
rename to libgcc/config/mmix/crti.S
--- a/gcc/config/mmix/crti.asm
+++ b/libgcc/config/mmix/crti.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2002, 2011 Free Software Foundation, Inc.
    Contributed by Hans-Peter Nilsson <hp@bitrange.com>
 
 This file is free software; you can redistribute it and/or modify it
@@ -57,7 +57,7 @@ Main	SETL	$255,32
 	PUT	rG,$255
 
 % Initialize the stack pointer.  It is supposedly made a global
-% zero-initialized (allowed to change) register in crtn.asm; we use the
+% zero-initialized (allowed to change) register in crtn.S; we use the
 % explicit number.
 	GETA	$255,stackpp
 	LDOU	$254,$255,0
diff --git a/gcc/config/mmix/crtn.asm b/libgcc/config/mmix/crtn.S
rename from gcc/config/mmix/crtn.asm
rename to libgcc/config/mmix/crtn.S
diff --git a/libgcc/config/mmix/t-mmix b/libgcc/config/mmix/t-mmix
--- a/libgcc/config/mmix/t-mmix
+++ b/libgcc/config/mmix/t-mmix
@@ -1,14 +1,20 @@
+# We need to turn off some assumptions on normality for code in crtstuff.c
+# and crt{i,n}.S, specifically about execution not continuing past the
+# end of the section in the file being compiled.  Thus we must stop the
+# assembler from generating stubbable PUSHJ relocs, because that will add
+# stubs at the end of the current section when necessary.
+CRTSTUFF_T_CFLAGS = -Wa,--no-stubs
+
 # Don't use global registers in libraries.
 # FIXME: Not applied at "root" level, so disabled at the moment to stop
 # incorrect comparisons with -mabi=gnu.
 #MULTILIB_EXTRA_OPTS = mno-base-addresses
 
-$(T)crti.o: $(gcc_srcdir)/config/mmix/crti.asm $(GCC_PASSES)
-	$(crt_compile) $(INCLUDES) \
-	$(CRTSTUFF_T_CFLAGS) -c -x assembler-with-cpp \
-	$(gcc_srcdir)/config/mmix/crti.asm
+# Cannot use default rules due to $(CRTSTUFF_T_CFLAGS).
+CUSTOM_CRTIN = yes
 
-$(T)crtn.o: $(gcc_srcdir)/config/mmix/crtn.asm $(GCC_PASSES)
-	$(crt_compile) $(INCLUDES) \
-	$(CRTSTUFF_T_CFLAGS) -c -x assembler-with-cpp \
-	$(gcc_srcdir)/config/mmix/crtn.asm
+crti.o: $(srcdir)/config/mmix/crti.S
+	$(crt_compile) $(CRTSTUFF_T_CFLAGS) -c $<
+
+crtn.o: $(srcdir)/config/mmix/crtn.S
+	$(crt_compile) $(CRTSTUFF_T_CFLAGS) -c $<
diff --git a/libgcc/config/moxie/crti.asm b/libgcc/config/moxie/crti.S
rename from libgcc/config/moxie/crti.asm
rename to libgcc/config/moxie/crti.S
--- a/libgcc/config/moxie/crti.asm
+++ b/libgcc/config/moxie/crti.S
@@ -1,6 +1,6 @@
-# crti.asm for moxie
+# crti.S for moxie
 #
-#   Copyright (C) 2009 Free Software Foundation
+#   Copyright (C) 2009, 2011 Free Software Foundation
 # 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by the
@@ -25,7 +25,7 @@
 # .init sections.  Users may put any desired instructions in those
 # sections.
 
-	.file		"crti.asm"
+	.file		"crti.S"
 
 	.section	".init"
 	.global	_init
diff --git a/libgcc/config/moxie/crtn.asm b/libgcc/config/moxie/crtn.S
rename from libgcc/config/moxie/crtn.asm
rename to libgcc/config/moxie/crtn.S
--- a/libgcc/config/moxie/crtn.asm
+++ b/libgcc/config/moxie/crtn.S
@@ -1,6 +1,6 @@
-# crtn.asm for moxie
+# crtn.S for moxie
 # 
-#   Copyright (C) 2009 Free Software Foundation
+#   Copyright (C) 2009, 2011 Free Software Foundation
 # 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by the
@@ -25,7 +25,7 @@
 # fact return.  Users may put any desired instructions in those sections.
 # This file is the last thing linked into any executable.
 
-	.file		"crtn.asm"
+	.file		"crtn.S"
 
 	.section	".init"
 	ret
diff --git a/libgcc/config/moxie/t-moxie b/libgcc/config/moxie/t-moxie
deleted file mode 100644
--- a/libgcc/config/moxie/t-moxie
+++ /dev/null
@@ -1,9 +0,0 @@
-# Assemble startup files.
-
-$(T)crti.o: $(srcdir)/config/moxie/crti.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-	-c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/moxie/crti.asm
-
-$(T)crtn.o: $(srcdir)/config/moxie/crtn.asm $(GCC_PASSES)
-	$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-	-c -o $(T)crtn.o -x assembler-with-cpp $(srcdir)/config/moxie/crtn.asm
diff --git a/gcc/config/pa/stublib.c b/libgcc/config/pa/stublib.c
rename from gcc/config/pa/stublib.c
rename to libgcc/config/pa/stublib.c
diff --git a/libgcc/config/pa/t-stublib b/libgcc/config/pa/t-stublib
new file mode 100644
--- /dev/null
+++ b/libgcc/config/pa/t-stublib
@@ -0,0 +1,21 @@
+LIBGCCSTUB_OBJS = pthread_default_stacksize_np-stub.o \
+	pthread_mutex_lock-stub.o \
+	pthread_mutex_unlock-stub.o \
+	pthread_once-stub.o
+
+pthread_default_stacksize_np-stub.o: $(srcdir)/config/pa/stublib.c
+	$(gcc_compile) -c -O2 -DL_pthread_default_stacksize_np $<
+
+pthread_mutex_lock-stub.o: $(srcdir)/config/pa/stublib.c
+	$(gcc_compile) -c -O2 -DL_pthread_mutex_lock $<
+
+pthread_mutex_unlock-stub.o: $(srcdir)/config/pa/stublib.c
+	$(gcc_compile) -c -O2 -DL_pthread_mutex_unlock $<
+
+pthread_once-stub.o: $(srcdir)/config/pa/stublib.c
+	$(gcc_compile) -c -O2 -DL_pthread_once $<
+
+libgcc_stub.a: $(LIBGCCSTUB_OBJS)
+	-rm -rf $@
+	$(AR) rc $@ $<
+	$(RANLIB) $@
diff --git a/libgcc/config/pa/t-stublib64 b/libgcc/config/pa/t-stublib64
new file mode 100644
--- /dev/null
+++ b/libgcc/config/pa/t-stublib64
@@ -0,0 +1,13 @@
+LIBGCCSTUB_OBJS += rfi-stub.o dfi-stub.o jvrc-stub.o cxaf-stub.o
+
+rfi-stub.o: $(srcdir)/config/pa/stublib.c
+	$(gcc_compile) -c -O2 -DL_register_frame_info $<
+
+dfi-stub.o: $(srcdir)/config/pa/stublib.c
+	$(gcc_compile) -c -O2 -DL_deregister_frame_info $<
+
+cxaf-stub.o: $(srcdir)/config/pa/stublib.c
+	$(gcc_compile) -c -O2 -DL_cxa_finalize $<
+
+jvrc-stub.o: $(srcdir)/config/pa/stublib.c
+	$(gcc_compile) -c -O2 -DL_Jv_RegisterClasses $<
diff --git a/gcc/config/rs6000/eabi-ci.asm b/libgcc/config/rs6000/eabi-ci.S
rename from gcc/config/rs6000/eabi-ci.asm
rename to libgcc/config/rs6000/eabi-ci.S
diff --git a/gcc/config/rs6000/eabi-cn.asm b/libgcc/config/rs6000/eabi-cn.S
rename from gcc/config/rs6000/eabi-cn.asm
rename to libgcc/config/rs6000/eabi-cn.S
diff --git a/gcc/config/rs6000/sol-ci.asm b/libgcc/config/rs6000/sol-ci.S
rename from gcc/config/rs6000/sol-ci.asm
rename to libgcc/config/rs6000/sol-ci.S
diff --git a/gcc/config/rs6000/sol-cn.asm b/libgcc/config/rs6000/sol-cn.S
rename from gcc/config/rs6000/sol-cn.asm
rename to libgcc/config/rs6000/sol-cn.S
diff --git a/libgcc/config/rs6000/t-crtstuff b/libgcc/config/rs6000/t-crtstuff
new file mode 100644
--- /dev/null
+++ b/libgcc/config/rs6000/t-crtstuff
@@ -0,0 +1,3 @@
+# If .sdata is enabled __CTOR_{LIST,END}__ go into .sdata instead of
+# .ctors.
+CRTSTUFF_T_CFLAGS = -msdata=none
diff --git a/libgcc/config/rs6000/t-ppccomm b/libgcc/config/rs6000/t-ppccomm
--- a/libgcc/config/rs6000/t-ppccomm
+++ b/libgcc/config/rs6000/t-ppccomm
@@ -17,26 +17,10 @@ LIB2ADD_ST += crtsavfpr.S crtresfpr.S \
   e500crtsavg64gpr.S \
   e500crtsavg64gprctr.S
 
-EXTRA_PARTS += crtbegin$(objext) crtend$(objext) \
-  crtbeginS$(objext) crtendS$(objext) crtbeginT$(objext) \
-  ecrti$(objext) ecrtn$(objext) ncrti$(objext) ncrtn$(objext)
-
 # We build {e,n}crti.o and {e,n}crtn.o, which serve to add begin and
 # end labels to all of the special sections used when we link using gcc.
 
 # Assemble startup files.
-ecrti.S: $(gcc_srcdir)/config/rs6000/eabi-ci.asm
-	cat $(gcc_srcdir)/config/rs6000/eabi-ci.asm >ecrti.S
-
-ecrtn.S: $(gcc_srcdir)/config/rs6000/eabi-cn.asm
-	cat $(gcc_srcdir)/config/rs6000/eabi-cn.asm >ecrtn.S
-
-ncrti.S: $(gcc_srcdir)/config/rs6000/sol-ci.asm
-	cat $(gcc_srcdir)/config/rs6000/sol-ci.asm >ncrti.S
-
-ncrtn.S: $(gcc_srcdir)/config/rs6000/sol-cn.asm
-	cat $(gcc_srcdir)/config/rs6000/sol-cn.asm >ncrtn.S
-
 crtsavfpr.S: $(gcc_srcdir)/config/rs6000/crtsavfpr.asm
 	cat $(gcc_srcdir)/config/rs6000/crtsavfpr.asm >crtsavfpr.S
 
@@ -94,14 +78,14 @@ e500crtsavg64gpr.S: $(gcc_srcdir)/config
 e500crtsavg64gprctr.S: $(gcc_srcdir)/config/rs6000/e500crtsavg64gprctr.asm
 	cat $(gcc_srcdir)/config/rs6000/e500crtsavg64gprctr.asm >e500crtsavg64gprctr.S
 
-ecrti$(objext): ecrti.S
+ecrti$(objext): $(srcdir)/config/rs6000/eabi-ci.S
 	$(crt_compile) -c ecrti.S
 
-ecrtn$(objext): ecrtn.S
+ecrtn$(objext): $(srcdir)/config/rs6000/eabi-cn.S
 	$(crt_compile) -c ecrtn.S
 
-ncrti$(objext): ncrti.S
+ncrti$(objext): $(srcdir)/config/rs6000/sol-ci.S
 	$(crt_compile) -c ncrti.S
 
-ncrtn$(objext): ncrtn.S
+ncrtn$(objext): $(srcdir)/config/rs6000/sol-cn.S
 	$(crt_compile) -c ncrtn.S
diff --git a/gcc/config/score/crti.asm b/libgcc/config/score/crti.S
rename from gcc/config/score/crti.asm
rename to libgcc/config/score/crti.S
--- a/gcc/config/score/crti.asm
+++ b/libgcc/config/score/crti.S
@@ -1,6 +1,6 @@
-# crti.asm for Sunplus S+CORE
+# crti.S for Sunplus S+CORE
 #
-#   Copyright (C) 2005, 2009, 2010 Free Software Foundation, Inc.
+#   Copyright (C) 2005, 2009, 2010, 2011 Free Software Foundation, Inc.
 #
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by the
diff --git a/gcc/config/score/crtn.asm b/libgcc/config/score/crtn.S
rename from gcc/config/score/crtn.asm
rename to libgcc/config/score/crtn.S
--- a/gcc/config/score/crtn.asm
+++ b/libgcc/config/score/crtn.S
@@ -1,6 +1,6 @@
-# crtn.asm for Sunplus S+CORE
+# crtn.S for Sunplus S+CORE
 
-#   Copyright (C) 2005, 2009, 2010 Free Software Foundation, Inc.
+#   Copyright (C) 2005, 2009, 2010, 2011 Free Software Foundation, Inc.
 #
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by the
diff --git a/gcc/config/sh/crt1.asm b/libgcc/config/sh/crt1.S
rename from gcc/config/sh/crt1.asm
rename to libgcc/config/sh/crt1.S
--- a/gcc/config/sh/crt1.asm
+++ b/libgcc/config/sh/crt1.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2001, 2003, 2004, 2005, 2006, 2009
+/* Copyright (C) 2000, 2001, 2003, 2004, 2005, 2006, 2009, 2011
    Free Software Foundation, Inc.
    This file was pretty much copied from newlib.
 
@@ -36,7 +36,7 @@ __timer_stack:
 #endif /* MMU_SUPPORT */
 	
 	/* ;----------------------------------------
-	Normal newlib crt1.asm */
+	Normal newlib crt1.S */
 
 #ifdef __SH5__
 	.section .data,"aw"
diff --git a/gcc/config/sh/crti.asm b/libgcc/config/sh/crti.S
rename from gcc/config/sh/crti.asm
rename to libgcc/config/sh/crti.S
--- a/gcc/config/sh/crti.asm
+++ b/libgcc/config/sh/crti.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2001, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001, 2009, 2011 Free Software Foundation, Inc.
    This file was adapted from glibc sources.
 
 This file is part of GCC.
@@ -25,11 +25,11 @@ see the files COPYING3 and COPYING.RUNTI
 
 /* The code in sections .init and .fini is supposed to be a single
    regular function.  The function in .init is called directly from
-   start in crt1.asm.  The function in .fini is atexit()ed in crt1.asm
+   start in crt1.S.  The function in .fini is atexit()ed in crt1.S
    too.
 
-   crti.asm contributes the prologue of a function to these sections,
-   and crtn.asm comes up the epilogue.  STARTFILE_SPEC should list
+   crti.S contributes the prologue of a function to these sections,
+   and crtn.S comes up the epilogue.  STARTFILE_SPEC should list
    crti.o before any other object files that might add code to .init
    or .fini sections, and ENDFILE_SPEC should list crtn.o after any
    such object files.  */
diff --git a/gcc/config/sh/crtn.asm b/libgcc/config/sh/crtn.S
rename from gcc/config/sh/crtn.asm
rename to libgcc/config/sh/crtn.S
--- a/gcc/config/sh/crtn.asm
+++ b/libgcc/config/sh/crtn.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2001, 2009 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001, 2009, 2011 Free Software Foundation, Inc.
    This file was adapted from glibc sources.
 
 This file is part of GCC.
@@ -22,7 +22,7 @@ a copy of the GCC Runtime Library Except
 see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 <http://www.gnu.org/licenses/>.  */
 
-/* See an explanation about .init and .fini in crti.asm.  */
+/* See an explanation about .init and .fini in crti.S.  */
 
 	.section .init
 #if __SHMEDIA__
diff --git a/gcc/config/sh/lib1funcs-4-300.asm b/libgcc/config/sh/lib1funcs-4-300.S
rename from gcc/config/sh/lib1funcs-4-300.asm
rename to libgcc/config/sh/lib1funcs-4-300.S
diff --git a/gcc/config/sh/lib1funcs-Os-4-200.asm b/libgcc/config/sh/lib1funcs-Os-4-200.S
rename from gcc/config/sh/lib1funcs-Os-4-200.asm
rename to libgcc/config/sh/lib1funcs-Os-4-200.S
diff --git a/libgcc/config/sh/t-sh b/libgcc/config/sh/t-sh
new file mode 100644
--- /dev/null
+++ b/libgcc/config/sh/t-sh
@@ -0,0 +1,53 @@
+# Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2006, 2008, 2009, 2011 Free Software Foundation, Inc.
+#
+# This file is part of GCC.
+#
+# GCC 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 3, or (at your option)
+# any later version.
+#
+# GCC 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 GCC; see the file COPYING3.  If not see
+# <http://www.gnu.org/licenses/>.
+
+crt1.o: $(srcdir)/config/sh/crt1.S
+	$(gcc_compile) -c $<
+
+ic_invalidate_array_4-100.o: $(gcc_srcdir)/config/sh/lib1funcs.asm
+	$(gcc_compile) -c -DL_ic_invalidate_array -DWAYS=1 -DWAY_SIZE=0x2000 $<
+libic_invalidate_array_4-100.a: ic_invalidate_array_4-100.o
+	$(AR_CREATE_FOR_TARGET) $@ $<
+
+ic_invalidate_array_4-200.o: $(gcc_srcdir)/config/sh/lib1funcs.asm
+	$(gcc_compile) -c -DL_ic_invalidate_array -DWAYS=2 -DWAY_SIZE=0x2000 $<
+libic_invalidate_array_4-200.a: ic_invalidate_array_4-200.o
+	$(AR_CREATE_FOR_TARGET) $@ $<
+
+ic_invalidate_array_4a.o: $(gcc_srcdir)/config/sh/lib1funcs.asm
+	$(gcc_compile) -c -DL_ic_invalidate_array -D__FORCE_SH4A__ $<
+libic_invalidate_array_4a.a: ic_invalidate_array_4a.o
+	$(AR_CREATE_FOR_TARGET) $@ $<
+
+sdivsi3_i4i-Os-4-200.o: $(srcdir)/config/sh/lib1funcs-Os-4-200.S
+	$(gcc_compile) -c -DL_sdivsi3_i4i $<
+udivsi3_i4i-Os-4-200.o: $(srcdir)/config/sh/lib1funcs-Os-4-200.S
+	$(gcc_compile) -c -DL_udivsi3_i4i $<
+unwind-dw2-Os-4-200.o: $(gcc_srcdir)/unwind-dw2.c
+	$(gcc_compile) $(LIBGCC2_CFLAGS) $(vis_hide) -fexceptions -Os -c $<
+
+OBJS_Os_4_200=sdivsi3_i4i-Os-4-200.o udivsi3_i4i-Os-4-200.o unwind-dw2-Os-4-200.o
+libgcc-Os-4-200.a: $(OBJS_Os_4_200)
+	$(AR_CREATE_FOR_TARGET) $@ $(OBJS_Os_4_200)
+
+div_table-4-300.o: $(srcdir)/config/sh/lib1funcs-4-300.S
+	$(gcc_compile) -c -DL_div_table $<
+
+libgcc-4-300.a: div_table-4-300.o
+	$(AR_CREATE_FOR_TARGET) $@ div_table-4-300.o
diff --git a/libgcc/config/sh/t-superh b/libgcc/config/sh/t-superh
new file mode 100644
--- /dev/null
+++ b/libgcc/config/sh/t-superh
@@ -0,0 +1,11 @@
+# Compile crt1-mmu.o as crt1.o with -DMMU_SUPPORT
+crt1-mmu.o: $(srcdir)/config/sh/crt1.S
+	$(gcc_compile) -c -DMMU_SUPPORT $<
+
+# Compile gcrt1-mmu.o as crt1-mmu.o with -DPROFILE
+gcrt1-mmu.o: $(srcdir)/config/sh/crt1.S
+	$(gcc_compile) -c -DPROFILE -DMMU_SUPPORT $<
+
+# For sh4-400: Compile gcrt1.o as crt1.o with -DPROFILE
+gcrt1.o: $(srcdir)/config/sh/crt1.S
+	$(gcc_compile) -c -DPROFILE $<
diff --git a/libgcc/config/sparc/t-linux64 b/libgcc/config/sparc/t-linux64
new file mode 100644
--- /dev/null
+++ b/libgcc/config/sparc/t-linux64
@@ -0,0 +1,2 @@
+CRTSTUFF_T_CFLAGS = `if test x$$($(CC) -print-multi-os-directory) \
+			= x../lib64; then echo -mcmodel=medany; fi`
diff --git a/gcc/config/spu/cache.S b/libgcc/config/spu/cache.S
rename from gcc/config/spu/cache.S
rename to libgcc/config/spu/cache.S
diff --git a/gcc/config/spu/cachemgr.c b/libgcc/config/spu/cachemgr.c
rename from gcc/config/spu/cachemgr.c
rename to libgcc/config/spu/cachemgr.c
diff --git a/libgcc/config/spu/t-elf b/libgcc/config/spu/t-elf
--- a/libgcc/config/spu/t-elf
+++ b/libgcc/config/spu/t-elf
@@ -1,3 +1,35 @@
+# Don't let CTOR_LIST end up in sdata section.
+# FIXME: This is the default.
+CRTSTUFF_T_CFLAGS =
+
+# Neither gcc or newlib seem to have a standard way to generate multiple
+# crt*.o files.  So we don't use the standard crt0.o name anymore.
+
+cachemgr.o: $(srcdir)/config/spu/cachemgr.c
+	$(gcc_compile) -c $<
+
+# Specialised rule to add a -D flag.
+cachemgr_nonatomic.o: $(srcdir)/config/spu/cachemgr.c
+	$(gcc_compile) -DNONATOMIC -c $<
+
+libgcc_%.a: %.o
+	$(AR_FOR_TARGET) -rcs $@ $<
+
+cache8k.o: $(srcdir)/config/spu/cache.S
+	$(gcc_compile) -D__CACHE_SIZE__=8 -c $<
+
+cache16k.o: $(srcdir)/config/spu/cache.S
+	$(gcc_compile) -D__CACHE_SIZE__=16 -c $<
+
+cache32k.o: $(srcdir)/config/spu/cache.S
+	$(gcc_compile) -D__CACHE_SIZE__=32 -c $<
+
+cache64k.o: $(srcdir)/config/spu/cache.S
+	$(gcc_compile) -D__CACHE_SIZE__=64 -c $<
+
+cache128k.o: $(srcdir)/config/spu/cache.S
+	$(gcc_compile) -D__CACHE_SIZE__=128 -c $<
+
 # We provide our own version of __divdf3 that performs better and has
 # better support for non-default rounding modes.
 DPBIT_FUNCS := $(filter-out _div_df, $(DPBIT_FUNCS))
diff --git a/libgcc/config/t-crtin b/libgcc/config/t-crtin
deleted file mode 100644
--- a/libgcc/config/t-crtin
+++ /dev/null
@@ -1,4 +0,0 @@
-crti.o: $(srcdir)/config/$(cpu_type)/sol2-ci.S
-	$(crt_compile) -c $<
-crtn.o: $(srcdir)/config/$(cpu_type)/sol2-cn.S
-	$(crt_compile) -c $<
diff --git a/libgcc/config/t-crtstuff-pic b/libgcc/config/t-crtstuff-pic
new file mode 100644
--- /dev/null
+++ b/libgcc/config/t-crtstuff-pic
@@ -0,0 +1,2 @@
+# Compile crtbeginS.o and crtendS.o with pic.
+CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -fPIC
diff --git a/libgcc/config/t-sol2 b/libgcc/config/t-sol2
--- a/libgcc/config/t-sol2
+++ b/libgcc/config/t-sol2
@@ -20,10 +20,16 @@
 gmon.o:	$(srcdir)/config/gmon-sol2.c
 	$(gcc_compile) -c $<
 
+CUSTOM_CRTIN = yes
+
 # Assemble startup files.
 crt1.o: $(srcdir)/config/$(cpu_type)/sol2-c1.S
 	$(crt_compile) -c $<
 gcrt1.o: $(srcdir)/config/$(cpu_type)/sol2-c1.S
 	$(crt_compile) -c -DGCRT1 $<
+crti.o: $(srcdir)/config/$(cpu_type)/sol2-ci.S
+	$(crt_compile) -c $<
+crtn.o: $(srcdir)/config/$(cpu_type)/sol2-cn.S
+	$(crt_compile) -c $<
 
 HOST_LIBGCC2_CFLAGS = -fPIC
diff --git a/libgcc/config/vms/t-vms b/libgcc/config/vms/t-vms
new file mode 100644
--- /dev/null
+++ b/libgcc/config/vms/t-vms
@@ -0,0 +1,6 @@
+# Assemble startup files.
+vcrt0.o: $(srcdir)/config/vms/vms-ucrt0.c
+	$(gcc_compile) -c $<
+
+pcrt0.o: $(srcdir)/config/vms/vms-ucrt0.c
+	$(gcc_compile) -c -DCRT0_POSIX_EXIT $<
diff --git a/gcc/config/vms/vms-ucrt0.c b/libgcc/config/vms/vms-ucrt0.c
rename from gcc/config/vms/vms-ucrt0.c
rename to libgcc/config/vms/vms-ucrt0.c
diff --git a/gcc/config/xtensa/crti.asm b/libgcc/config/xtensa/crti.S
rename from gcc/config/xtensa/crti.asm
rename to libgcc/config/xtensa/crti.S
diff --git a/gcc/config/xtensa/crtn.asm b/libgcc/config/xtensa/crtn.S
rename from gcc/config/xtensa/crtn.asm
rename to libgcc/config/xtensa/crtn.S
diff --git a/libgcc/config/xtensa/t-elf b/libgcc/config/xtensa/t-elf
new file mode 100644
--- /dev/null
+++ b/libgcc/config/xtensa/t-elf
@@ -0,0 +1,3 @@
+# Build CRT files and libgcc with the "longcalls" option
+CRTSTUFF_T_CFLAGS += -mlongcalls
+CRTSTUFF_T_CFLAGS_S += -mlongcalls
diff --git a/gcc/crtstuff.c b/libgcc/crtstuff.c
rename from gcc/crtstuff.c
rename to libgcc/crtstuff.c

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]