head	1.10;
access;
symbols
	perseant-exfatfs-base-20261102:1.10
	perseant-exfatfs-base-20250801:1.10
	perseant-exfatfs-base-20240630:1.10
	perseant-exfatfs:1.10.0.24
	perseant-exfatfs-base:1.10
	cjep_sun2x:1.10.0.22
	cjep_sun2x-base:1.10
	cjep_staticlib_x-base1:1.10
	cjep_staticlib_x:1.10.0.20
	cjep_staticlib_x-base:1.10
	phil-wifi-20200421:1.10
	phil-wifi-20200411:1.10
	phil-wifi-20200406:1.10
	pgoyette-compat-merge-20190127:1.10
	pgoyette-compat-20190127:1.10
	pgoyette-compat-20190118:1.10
	pgoyette-compat-1226:1.10
	pgoyette-compat-1126:1.10
	pgoyette-compat-1020:1.10
	pgoyette-compat-0930:1.10
	pgoyette-compat-0906:1.10
	pgoyette-compat-0728:1.10
	pgoyette-compat-0625:1.10
	pgoyette-compat-0521:1.10
	pgoyette-compat-0502:1.10
	pgoyette-compat-0422:1.10
	pgoyette-compat-0415:1.10
	pgoyette-compat-0407:1.10
	pgoyette-compat-0330:1.10
	pgoyette-compat-0322:1.10
	pgoyette-compat-0315:1.10
	pgoyette-compat:1.10.0.18
	pgoyette-compat-base:1.10
	perseant-stdc-iso10646:1.10.0.16
	perseant-stdc-iso10646-base:1.10
	prg-localcount2-base3:1.10
	prg-localcount2-base2:1.10
	prg-localcount2-base1:1.10
	prg-localcount2:1.10.0.14
	prg-localcount2-base:1.10
	pgoyette-localcount-20170426:1.10
	bouyer-socketcan-base1:1.10
	pgoyette-localcount-20170320:1.10
	bouyer-socketcan:1.10.0.12
	bouyer-socketcan-base:1.10
	pgoyette-localcount-20170107:1.10
	pgoyette-localcount-20161104:1.10
	localcount-20160914:1.10
	pgoyette-localcount-20160806:1.10
	pgoyette-localcount-20160726:1.10
	pgoyette-localcount:1.10.0.10
	pgoyette-localcount-base:1.10
	netbsd-5-2-3-RELEASE:1.9
	netbsd-5-1-5-RELEASE:1.9
	yamt-pagecache-base9:1.10
	yamt-pagecache-tag8:1.10
	tls-earlyentropy:1.10.0.6
	tls-earlyentropy-base:1.10
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.10
	riastradh-drm2-base3:1.10
	netbsd-5-2-2-RELEASE:1.9
	netbsd-5-1-4-RELEASE:1.9
	netbsd-5-2-1-RELEASE:1.9
	netbsd-5-1-3-RELEASE:1.9
	agc-symver:1.10.0.8
	agc-symver-base:1.10
	tls-maxphys-base:1.10
	yamt-pagecache-base8:1.10
	netbsd-5-2:1.9.0.38
	yamt-pagecache-base7:1.10
	netbsd-5-2-RELEASE:1.9
	netbsd-5-2-RC1:1.9
	yamt-pagecache-base6:1.10
	yamt-pagecache-base5:1.10
	yamt-pagecache-base4:1.10
	netbsd-5-1-2-RELEASE:1.9
	netbsd-5-1-1-RELEASE:1.9
	yamt-pagecache-base3:1.10
	yamt-pagecache-base2:1.10
	yamt-pagecache:1.10.0.4
	yamt-pagecache-base:1.10
	bouyer-quota2-nbase:1.10
	bouyer-quota2:1.10.0.2
	bouyer-quota2-base:1.10
	matt-nb5-mips64-premerge-20101231:1.9
	matt-nb5-pq3:1.9.0.36
	matt-nb5-pq3-base:1.9
	netbsd-5-1:1.9.0.34
	netbsd-5-1-RELEASE:1.9
	netbsd-5-1-RC4:1.9
	matt-nb5-mips64-k15:1.9
	netbsd-5-1-RC3:1.9
	netbsd-5-1-RC2:1.9
	netbsd-5-1-RC1:1.9
	netbsd-5-0-2-RELEASE:1.9
	matt-nb5-mips64-premerge-20091211:1.9
	matt-premerge-20091211:1.9
	matt-nb5-mips64-u2-k2-k4-k7-k8-k9:1.9
	matt-nb4-mips64-k7-u2a-k9b:1.9
	matt-nb5-mips64-u1-k1-k5:1.9
	matt-nb5-mips64:1.9.0.32
	netbsd-5-0-1-RELEASE:1.9
	jym-xensuspend-nbase:1.9
	netbsd-5-0:1.9.0.30
	netbsd-5-0-RELEASE:1.9
	netbsd-5-0-RC4:1.9
	netbsd-5-0-RC3:1.9
	netbsd-5-0-RC2:1.9
	jym-xensuspend:1.9.0.28
	jym-xensuspend-base:1.9
	netbsd-5-0-RC1:1.9
	netbsd-5:1.9.0.26
	netbsd-5-base:1.9
	matt-mips64-base2:1.9
	matt-mips64:1.9.0.24
	mjf-devfs2:1.9.0.22
	mjf-devfs2-base:1.9
	netbsd-4-0-1-RELEASE:1.9
	wrstuden-revivesa-base-3:1.9
	wrstuden-revivesa-base-2:1.9
	wrstuden-fixsa-newbase:1.9
	wrstuden-revivesa-base-1:1.9
	yamt-pf42-base4:1.9
	yamt-pf42-base3:1.9
	hpcarm-cleanup-nbase:1.9
	yamt-pf42-baseX:1.9
	yamt-pf42-base2:1.9
	wrstuden-revivesa:1.9.0.20
	wrstuden-revivesa-base:1.9
	yamt-pf42:1.9.0.18
	yamt-pf42-base:1.9
	keiichi-mipv6:1.9.0.16
	keiichi-mipv6-base:1.9
	matt-armv6-nbase:1.9
	matt-armv6-prevmlocking:1.9
	wrstuden-fixsa-base-1:1.9
	netbsd-4-0:1.9.0.14
	netbsd-4-0-RELEASE:1.9
	cube-autoconf:1.9.0.12
	cube-autoconf-base:1.9
	netbsd-4-0-RC5:1.9
	netbsd-4-0-RC4:1.9
	netbsd-4-0-RC3:1.9
	netbsd-4-0-RC2:1.9
	netbsd-4-0-RC1:1.9
	matt-armv6:1.9.0.10
	matt-armv6-base:1.9
	matt-mips64-base:1.9
	hpcarm-cleanup:1.9.0.8
	hpcarm-cleanup-base:1.9
	netbsd-3-1-1-RELEASE:1.6
	netbsd-3-0-3-RELEASE:1.6
	wrstuden-fixsa:1.9.0.6
	wrstuden-fixsa-base:1.9
	abandoned-netbsd-4-base:1.9
	abandoned-netbsd-4:1.9.0.2
	netbsd-3-1:1.6.0.14
	netbsd-3-1-RELEASE:1.6
	netbsd-3-0-2-RELEASE:1.6
	netbsd-3-1-RC4:1.6
	netbsd-3-1-RC3:1.6
	netbsd-3-1-RC2:1.6
	netbsd-3-1-RC1:1.6
	netbsd-4:1.9.0.4
	netbsd-4-base:1.9
	netbsd-3-0-1-RELEASE:1.6
	netbsd-3-0:1.6.0.12
	netbsd-3-0-RELEASE:1.6
	netbsd-3-0-RC6:1.6
	netbsd-3-0-RC5:1.6
	netbsd-3-0-RC4:1.6
	netbsd-3-0-RC3:1.6
	netbsd-3-0-RC2:1.6
	netbsd-3-0-RC1:1.6
	netbsd-2-0-3-RELEASE:1.6
	netbsd-2-1:1.6.0.10
	netbsd-2-1-RELEASE:1.6
	netbsd-2-1-RC6:1.6
	netbsd-2-1-RC5:1.6
	netbsd-2-1-RC4:1.6
	netbsd-2-1-RC3:1.6
	netbsd-2-1-RC2:1.6
	netbsd-2-1-RC1:1.6
	netbsd-2-0-2-RELEASE:1.6
	netbsd-3:1.6.0.8
	netbsd-3-base:1.6
	netbsd-2-0-1-RELEASE:1.6
	netbsd-2:1.6.0.6
	netbsd-2-base:1.6
	netbsd-2-0-RELEASE:1.6
	netbsd-2-0-RC5:1.6
	netbsd-2-0-RC4:1.6
	netbsd-2-0-RC3:1.6
	netbsd-2-0-RC2:1.6
	netbsd-2-0-RC1:1.6
	netbsd-2-0:1.6.0.4
	netbsd-2-0-base:1.6
	netbsd-1-6-PATCH002-RELEASE:1.6
	netbsd-1-6-PATCH002:1.6
	netbsd-1-6-PATCH002-RC4:1.6
	netbsd-1-6-PATCH002-RC3:1.6
	netbsd-1-6-PATCH002-RC2:1.6
	netbsd-1-6-PATCH002-RC1:1.6
	netbsd-1-6-PATCH001:1.6
	netbsd-1-6-PATCH001-RELEASE:1.6
	netbsd-1-6-PATCH001-RC3:1.6
	netbsd-1-6-PATCH001-RC2:1.6
	netbsd-1-6-PATCH001-RC1:1.6
	fvdl_fs64_base:1.6
	netbsd-1-6-RELEASE:1.6
	netbsd-1-6-RC3:1.6
	netbsd-1-6-RC2:1.6
	netbsd-1-6-RC1:1.6
	netbsd-1-6:1.6.0.2
	netbsd-1-6-base:1.6
	netbsd-1-5-PATCH003:1.4.10.1
	netbsd-1-5-PATCH002:1.4
	netbsd-1-5-PATCH001:1.4
	netbsd-1-5-RELEASE:1.4
	netbsd-1-5-BETA2:1.4
	netbsd-1-5-BETA:1.4
	netbsd-1-4-PATCH003:1.4
	netbsd-1-5-ALPHA2:1.4
	netbsd-1-5:1.4.0.10
	netbsd-1-5-base:1.4
	minoura-xpg4dl:1.4.0.8
	minoura-xpg4dl-base:1.4
	netbsd-1-4-PATCH002:1.4
	wrstuden-devbsize-19991221:1.4
	wrstuden-devbsize:1.4.0.6
	wrstuden-devbsize-base:1.4
	comdex-fall-1999:1.4.0.4
	comdex-fall-1999-base:1.4
	netbsd-1-4-PATCH001:1.4
	netbsd-1-4-RELEASE:1.4
	netbsd-1-4:1.4.0.2
	netbsd-1-4-base:1.4;
locks; strict;
comment	@# @;


1.10
date	2010.08.07.18.01.33;	author joerg;	state dead;
branches;
next	1.9;

1.9
date	2006.05.19.19.11.12;	author christos;	state Exp;
branches;
next	1.8;

1.8
date	2006.05.17.17.02.16;	author christos;	state Exp;
branches;
next	1.7;

1.7
date	2006.05.17.17.01.12;	author christos;	state Exp;
branches;
next	1.6;

1.6
date	2001.07.17.03.56.48;	author thorpej;	state Exp;
branches;
next	1.5;

1.5
date	2001.05.11.22.44.15;	author ross;	state Exp;
branches;
next	1.4;

1.4
date	99.03.20.00.32.40;	author thorpej;	state Exp;
branches
	1.4.10.1;
next	1.3;

1.3
date	99.03.19.23.34.50;	author thorpej;	state Exp;
branches;
next	1.2;

1.2
date	99.03.19.23.16.17;	author thorpej;	state Exp;
branches;
next	1.1;

1.1
date	99.01.10.17.16.06;	author christos;	state Exp;
branches;
next	;

1.4.10.1
date	2001.12.09.17.17.55;	author he;	state Exp;
branches;
next	;


desc
@@


1.10
log
@Switch i386 and x86_64 to the new CRT layout. The crt0.c body is shared
between all platforms and a small assembler stub in crt0.S is used for
setting up the proper stack and whatever else MD needs.

Extract crti.S and crtn. from the old dot_init.h files. Prepare other
platforms that use the 6-argument form of __(_)start for this.

Rewrite the crtbegin and crtend modules in assembler to make them
compiler independent. Document the interface in README.
@
text
@#	$NetBSD: Makefile,v 1.9 2006/05/19 19:11:12 christos Exp $

#Uncomment the next line to enable the new .init fallthru
CPPFLAGS+=	-I${.CURDIR}

.include "${.CURDIR}/../common_elf/Makefile.inc"
@


1.9
log
@Instead of using -I- -I${.CURDIR} and #include "dot_init.h", use:
-I${.CURDIR} and #include <dot_init.h>, since -I- is obsoleted in gcc-4,
and it is too confusing anyway.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.8 2006/05/17 17:02:16 christos Exp $
@


1.8
log
@Back out accidental commit that changed -I-
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.7 2006/05/17 17:01:12 christos Exp $
d4 1
a4 1
CPPFLAGS+=	-I- -I${.CURDIR}
@


1.7
log
@Fool gcc to compare against a null variable instead of the NULL constant
so that it does not optimize the &_DYNAMIC == NULL away. Idea from Matt.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.6 2001/07/17 03:56:48 thorpej Exp $
d4 1
a4 1
CPPFLAGS+=	-iquote -I${.CURDIR}
@


1.6
log
@Enable the new (working) .init/.fini magic.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.5 2001/05/11 22:44:15 ross Exp $
d4 1
a4 1
CPPFLAGS+=	-I- -I${.CURDIR}
@


1.5
log
@Reorganization of crtbegin/crtend.
o  Primary mod: alpha and i386 code for .init and .fini section fallthroughs
o  Actual fallthru is not yet enabled, see csu/{alpha,i386_elf}/Makefile
o  When enabled, should fix bin/12865 & should fix at least one WINE bug,
   see http://www.winehq.com/hypermail/wine-devel/2001/05/0021.html
o  Also, removed the function pointer hack put in to prevent gcc from
   incorrectly attempting to do short calls over section boundaries,
   on some architectures, rather, simply simply move ctors() and dtors()
   into .init and .fini.
Other notes.
o  Our crtbegin.c and crtend.c were completely in C, despite
   the fact that .init and .fini section fallthroughs require machine code.
   These modules implement the gnu ctors/dtors mechanism directly, eliminating
   in part the need for the elf .init/.fini section fallthrough. However,
   if we ever want to use the gnu-provided constructor support, we need to
   do the fallthrough, at least one program (WINE) apparently uses the
   feature independently, and other compilers may depend on the mechanism.
o  It is amusing that the previous NetBSD _init() and _fini() were put
   into the .init and .fini sections, because nothing is gained over
   plain .text if they don't fall through. Cargo cult!
o  Other elf ports will need to copy the alpha and i386 example mods.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.4 1999/03/20 00:32:40 thorpej Exp $
d4 1
a4 1
#CPPFLAGS+=	-I- -I${.CURDIR}
@


1.4
log
@Pull together common Makefile fragments for ELF crt0 files, and use it
across the board.
@
text
@d1 4
a4 1
#	$NetBSD: Makefile,v 1.3 1999/03/19 23:34:50 thorpej Exp $
@


1.4.10.1
log
@Pull up revisions 1.5-1.6 (requested by skrll):
  Add init/fini section support in crtbegin and crtend, and introduce
  support for DWARF2 exception handling.  Fixes PR#12865, PR#13488,
  PR#13489, and PR#13491.  Also fix ld.elf_so to deal appropriately.
@
text
@d1 1
a1 4
#	$NetBSD: Makefile,v 1.4 1999/03/20 00:32:40 thorpej Exp $

#Uncomment the next line to enable the new .init fallthru
CPPFLAGS+=	-I- -I${.CURDIR}
@


1.3
log
@Put a good chunk of code common to all ELF crt0.c files into a common
location, and use it.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.2 1999/03/19 23:16:17 thorpej Exp $
d3 1
a3 45
CPPFLAGS+=	-DLIBC_SCCS -DPIC -DDYNAMIC -DELFSIZE=32
CPPFLAGS+=	-I${.CURDIR}/../../../libexec/ld.elf_so
CPPFLAGS+=	-I${.CURDIR}/../common_elf
COPTS+=		-fPIC

.PATH:		${.CURDIR}/../common_elf

OBJS=		crt0.o gcrt0.o crtbegin.o crtend.o

CLEANFILES+=	core a.out

all: ${OBJS}

crt0.o: crt0.c
	@@echo "${COMPILE.c} -DCRT0 ${.ALLSRC} -o ${.TARGET}"
	@@${COMPILE.c} -DCRT0 ${.ALLSRC} -o ${.TARGET}.o
	@@${LD} -x -r -o ${.TARGET} ${.TARGET}.o
	@@rm -f ${.TARGET}.o

gcrt0.o: crt0.c
	@@echo "${COMPILE.c} -DMCRT0 ${.ALLSRC} -o ${.TARGET}"
	@@${COMPILE.c} -DMCRT0 ${.ALLSRC} -o ${.TARGET}.o
	@@${LD} -x -r -o ${.TARGET} ${.TARGET}.o
	@@rm -f ${.TARGET}.o

crtbegin.o: crtbegin.c
	@@echo "${COMPILE.c} ${.ALLSRC} -o ${.TARGET}"
	@@${COMPILE.c} ${.ALLSRC} -o ${.TARGET}.o
	@@${LD} -x -r -o ${.TARGET} ${.TARGET}.o
	@@rm -f ${.TARGET}.o

crtend.o: crtend.c
	@@echo "${COMPILE.c} ${.ALLSRC} -o ${.TARGET}"
	@@${COMPILE.c} ${.ALLSRC} -o ${.TARGET}.o
	@@${LD} -x -r -o ${.TARGET} ${.TARGET}.o
	@@rm -f ${.TARGET}.o

install:
	${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m 444 ${OBJS} \
	    ${DESTDIR}/usr/lib
	rm -f ${DESTDIR}/usr/lib/crtbeginS.o ${DESTDIR}/usr/lib/crtendS.o
	ln ${DESTDIR}/usr/lib/crtbegin.o ${DESTDIR}/usr/lib/crtbeginS.o
	ln ${DESTDIR}/usr/lib/crtend.o ${DESTDIR}/usr/lib/crtendS.o

.include <bsd.prog.mk>
@


1.2
log
@Move crtbegin.c and crtend.c from alpha subdir to common_elf subdir via
repository copy, remove all redundant copies of these files, and make all
ELF platforms use the common versions.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.1 1999/01/10 17:16:06 christos Exp $
d5 1
@


1.1
log
@First pass at csu stuff for i386/elf.
@
text
@d1 1
a1 1
#	$NetBSD: Makefile,v 1.16 1998/03/28 00:52:06 cgd Exp $
d6 2
@

