head	1.2;
access;
symbols
	perseant-exfatfs-base-20250801:1.2
	perseant-exfatfs-base-20240630:1.2
	perseant-exfatfs:1.2.0.46
	perseant-exfatfs-base:1.2
	cjep_sun2x:1.2.0.44
	cjep_sun2x-base:1.2
	cjep_staticlib_x-base1:1.2
	cjep_staticlib_x:1.2.0.42
	cjep_staticlib_x-base:1.2
	phil-wifi-20200421:1.2
	phil-wifi-20200411:1.2
	phil-wifi-20200406:1.2
	pgoyette-compat-merge-20190127:1.2
	pgoyette-compat-20190127:1.2
	pgoyette-compat-20190118:1.2
	pgoyette-compat-1226:1.2
	pgoyette-compat-1126:1.2
	pgoyette-compat-1020:1.2
	pgoyette-compat-0930:1.2
	pgoyette-compat-0906:1.2
	pgoyette-compat-0728:1.2
	pgoyette-compat-0625:1.2
	pgoyette-compat-0521:1.2
	pgoyette-compat-0502:1.2
	pgoyette-compat-0422:1.2
	pgoyette-compat-0415:1.2
	pgoyette-compat-0407:1.2
	pgoyette-compat-0330:1.2
	pgoyette-compat-0322:1.2
	pgoyette-compat-0315:1.2
	pgoyette-compat:1.2.0.40
	pgoyette-compat-base:1.2
	perseant-stdc-iso10646:1.2.0.38
	perseant-stdc-iso10646-base:1.2
	prg-localcount2-base3:1.2
	prg-localcount2-base2:1.2
	prg-localcount2-base1:1.2
	prg-localcount2:1.2.0.36
	prg-localcount2-base:1.2
	pgoyette-localcount-20170426:1.2
	bouyer-socketcan-base1:1.2
	pgoyette-localcount-20170320:1.2
	bouyer-socketcan:1.2.0.34
	bouyer-socketcan-base:1.2
	pgoyette-localcount-20170107:1.2
	pgoyette-localcount-20161104:1.2
	localcount-20160914:1.2
	pgoyette-localcount-20160806:1.2
	pgoyette-localcount-20160726:1.2
	pgoyette-localcount:1.2.0.32
	pgoyette-localcount-base:1.2
	netbsd-5-2-3-RELEASE:1.2
	netbsd-5-1-5-RELEASE:1.2
	yamt-pagecache-base9:1.2
	yamt-pagecache-tag8:1.2
	tls-earlyentropy:1.2.0.28
	tls-earlyentropy-base:1.2
	riastradh-xf86-video-intel-2-7-1-pre-2-21-15:1.2
	riastradh-drm2-base3:1.2
	netbsd-5-2-2-RELEASE:1.2
	netbsd-5-1-4-RELEASE:1.2
	netbsd-5-2-1-RELEASE:1.2
	netbsd-5-1-3-RELEASE:1.2
	agc-symver:1.2.0.30
	agc-symver-base:1.2
	tls-maxphys-base:1.2
	yamt-pagecache-base8:1.2
	netbsd-5-2:1.2.0.26
	yamt-pagecache-base7:1.2
	netbsd-5-2-RELEASE:1.2
	netbsd-5-2-RC1:1.2
	yamt-pagecache-base6:1.2
	yamt-pagecache-base5:1.2
	yamt-pagecache-base4:1.2
	netbsd-5-1-2-RELEASE:1.2
	netbsd-5-1-1-RELEASE:1.2
	yamt-pagecache-base3:1.2
	yamt-pagecache-base2:1.2
	yamt-pagecache:1.2.0.24
	yamt-pagecache-base:1.2
	bouyer-quota2-nbase:1.2
	bouyer-quota2:1.2.0.22
	bouyer-quota2-base:1.2
	matt-nb5-pq3:1.2.0.20
	matt-nb5-pq3-base:1.2
	netbsd-5-1:1.2.0.18
	netbsd-5-1-RELEASE:1.2
	netbsd-5-1-RC4:1.2
	netbsd-5-1-RC3:1.2
	netbsd-5-1-RC2:1.2
	netbsd-5-1-RC1:1.2
	netbsd-5-0-2-RELEASE:1.2
	netbsd-5-0-1-RELEASE:1.2
	jym-xensuspend-nbase:1.2
	netbsd-5-0:1.2.0.16
	netbsd-5-0-RELEASE:1.2
	netbsd-5-0-RC4:1.2
	netbsd-5-0-RC3:1.2
	netbsd-5-0-RC2:1.2
	jym-xensuspend:1.2.0.14
	jym-xensuspend-base:1.2
	netbsd-5-0-RC1:1.2
	netbsd-5:1.2.0.12
	netbsd-5-base:1.2
	mjf-devfs2:1.2.0.10
	mjf-devfs2-base:1.2
	netbsd-4-0-1-RELEASE:1.1.16.1
	yamt-pf42-base4:1.2
	yamt-pf42-base3:1.2
	hpcarm-cleanup-nbase:1.2
	yamt-pf42-base2:1.2
	yamt-pf42:1.2.0.8
	yamt-pf42-base:1.2
	keiichi-mipv6:1.2.0.6
	keiichi-mipv6-base:1.2
	wrstuden-fixsa-base-1:1.1.16.1
	netbsd-4-0:1.1.16.1.0.2
	netbsd-4-0-RELEASE:1.1.16.1
	cube-autoconf:1.2.0.4
	cube-autoconf-base:1.2
	netbsd-4-0-RC5:1.1.16.1
	netbsd-4-0-RC4:1.1.16.1
	netbsd-4-0-RC3:1.1.16.1
	netbsd-4-0-RC2:1.1.16.1
	netbsd-4-0-RC1:1.1.16.1
	hpcarm-cleanup:1.2.0.2
	hpcarm-cleanup-base:1.2
	netbsd-3-1-1-RELEASE:1.1
	netbsd-3-0-3-RELEASE:1.1
	wrstuden-fixsa:1.1.0.18
	wrstuden-fixsa-base:1.1.16.1
	abandoned-netbsd-4-base:1.1
	abandoned-netbsd-4:1.1.0.12
	netbsd-3-1:1.1.0.14
	netbsd-3-1-RELEASE:1.1
	netbsd-3-0-2-RELEASE:1.1
	netbsd-3-1-RC4:1.1
	netbsd-3-1-RC3:1.1
	netbsd-3-1-RC2:1.1
	netbsd-3-1-RC1:1.1
	netbsd-4:1.1.0.16
	netbsd-4-base:1.1
	netbsd-3-0-1-RELEASE:1.1
	netbsd-3-0:1.1.0.10
	netbsd-3-0-RELEASE:1.1
	netbsd-3-0-RC6:1.1
	netbsd-3-0-RC5:1.1
	netbsd-3-0-RC4:1.1
	netbsd-3-0-RC3:1.1
	netbsd-3-0-RC2:1.1
	netbsd-3-0-RC1:1.1
	netbsd-2-0-3-RELEASE:1.1
	netbsd-2-1:1.1.0.8
	netbsd-2-1-RELEASE:1.1
	netbsd-2-1-RC6:1.1
	netbsd-2-1-RC5:1.1
	netbsd-2-1-RC4:1.1
	netbsd-2-1-RC3:1.1
	netbsd-2-1-RC2:1.1
	netbsd-2-1-RC1:1.1
	netbsd-2-0-2-RELEASE:1.1
	netbsd-3:1.1.0.6
	netbsd-3-base:1.1
	netbsd-2-0-1-RELEASE:1.1
	netbsd-2:1.1.0.4
	netbsd-2-base:1.1
	netbsd-2-0-RELEASE:1.1
	netbsd-2-0-RC5:1.1
	netbsd-2-0-RC4:1.1
	netbsd-2-0-RC3:1.1
	netbsd-2-0-RC2:1.1
	netbsd-2-0-RC1:1.1
	netbsd-2-0:1.1.0.2
	netbsd-2-0-base:1.1;
locks; strict;
comment	@# @;


1.2
date	2007.04.08.09.35.50;	author scw;	state dead;
branches;
next	1.1;

1.1
date	2003.03.25.13.11.54;	author scw;	state Exp;
branches
	1.1.16.1
	1.1.18.1;
next	;

1.1.16.1
date	2007.07.19.15.24.42;	author liamjfoy;	state dead;
branches;
next	;

1.1.18.1
date	2007.09.03.07.02.26;	author wrstuden;	state dead;
branches;
next	;


desc
@@


1.2
log
@Remove support for NetBSD/{,evb}sh5.
@
text
@/*	$NetBSD: rtld_start.S,v 1.1 2003/03/25 13:11:54 scw Exp $	*/

/*
 * Copyright 2003 Wasabi Systems, Inc.
 * All rights reserved.
 *
 * Written by Steve C. Woodford for Wasabi Systems, Inc.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *      This product includes software developed for the NetBSD Project by
 *      Wasabi Systems, Inc.
 * 4. The name of Wasabi Systems, Inc. may not be used to endorse
 *    or promote products derived from this software without specific prior
 *    written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL WASABI SYSTEMS, INC
 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#include <machine/asm.h>

#ifdef _LP64
#define	PTRSZ	8
#else
#define	PTRSZ	4
#endif


#define	RTLD_START_FR_R2		0x00
#define	RTLD_START_FR_R3		0x08
#define	RTLD_START_FR_R4		0x10
#define	RTLD_START_FR_R7		0x18
#define	RTLD_START_FR_R28		0x20
#define	RTLD_START_FR_CLEANUP		0x28
#define	RTLD_START_FR_OBJ		(RTLD_START_FR_CLEANUP+PTRSZ)
#define	RTLD_START_FR_SIZE		(RTLD_START_FR_OBJ+PTRSZ)

ASENTRY_NOPROFILE(.rtld_start)
	addi	r15, -RTLD_START_FR_SIZE, r15
	st.q	r15, RTLD_START_FR_R2, r2
	st.q	r15, RTLD_START_FR_R3, r3
	st.q	r15, RTLD_START_FR_R4, r4
	st.q	r15, RTLD_START_FR_R7, r7
	st.q	r15, RTLD_START_FR_R28, r28

	pt/u	datalabel _GLOBAL_OFFSET_TABLE_, tr0
	gettr	tr0, r0
	pt/u	datalabel _DYNAMIC, tr1
	LDPTR	r0, 0, r28
	gettr	tr1, r2			/* &_DYNAMIC */
	sub	r2, r28, r28
	or	r28, r63, r3		/* relocbase */

	pt/l	_C_LABEL(_rtld_relocate_nonplt_self), tr0
	blink	tr0, r18
	add	r28, r63, r3		/* relocbase */
	addi	r15, RTLD_START_FR_CLEANUP, r2
	pt/l	_C_LABEL(_rtld), tr0
	blink	tr0, r18
	ptabs/l	r2, tr0

	ld.q	r15, RTLD_START_FR_R2, r2		/* argc */
	ld.q	r15, RTLD_START_FR_R3, r3		/* argv */
	ld.q	r15, RTLD_START_FR_R4, r4		/* envp */
	ld.q	r15, RTLD_START_FR_R7, r7		/* pstrings */
	ld.q	r15, RTLD_START_FR_R28, r28
	LDPTR	r15, RTLD_START_FR_CLEANUP, r5		/* cleanup */
	LDPTR	r15, RTLD_START_FR_OBJ, r6		/* obj */
	addi	r15, RTLD_START_FR_SIZE, r15
	blink	tr0, r63
	.size	_ASM_LABEL(.rtld_start),.-_ASM_LABEL(.rtld_start)


#define	RTLD_BIND_START_FR_R2		0x00
#define	RTLD_BIND_START_FR_R3		0x08
#define	RTLD_BIND_START_FR_R4		0x10
#define	RTLD_BIND_START_FR_R5		0x18
#define	RTLD_BIND_START_FR_R6		0x20
#define	RTLD_BIND_START_FR_R7		0x28
#define	RTLD_BIND_START_FR_R8		0x30
#define	RTLD_BIND_START_FR_R9		0x38
#define	RTLD_BIND_START_FR_DR0		0x40
#define	RTLD_BIND_START_FR_DR2		0x48
#define	RTLD_BIND_START_FR_DR4		0x50
#define	RTLD_BIND_START_FR_DR6		0x58
#define	RTLD_BIND_START_FR_DR8		0x60
#define	RTLD_BIND_START_FR_DR10		0x68
#define	RTLD_BIND_START_FR_SIZE		0x70

	/*
	 * On entry:
	 * r12 -> _GLOBAL_OFFSET_TABLE_ + GOT_BIAS (0x8000)
	 * r17 -> Obj_Entry *
	 * r21 -> reloff
	 */
ASENTRY_NOPROFILE(_rtld_bind_start)
	LINK_FRAME(RTLD_BIND_START_FR_SIZE)
	st.q	r14, RTLD_BIND_START_FR_R2, r2
	st.q	r14, RTLD_BIND_START_FR_R3, r3
	st.q	r14, RTLD_BIND_START_FR_R4, r4
	st.q	r14, RTLD_BIND_START_FR_R5, r5
	st.q	r14, RTLD_BIND_START_FR_R6, r6
	st.q	r14, RTLD_BIND_START_FR_R7, r7
	st.q	r14, RTLD_BIND_START_FR_R8, r8
	st.q	r14, RTLD_BIND_START_FR_R9, r9
	fst.d	r14, RTLD_BIND_START_FR_DR0, dr0
	fst.d	r14, RTLD_BIND_START_FR_DR2, dr2
	fst.d	r14, RTLD_BIND_START_FR_DR4, dr4
	fst.d	r14, RTLD_BIND_START_FR_DR6, dr6
	fst.d	r14, RTLD_BIND_START_FR_DR8, dr8
	fst.d	r14, RTLD_BIND_START_FR_DR10, dr10
	pt/l	_C_LABEL(_rtld_bind), tr0
	add	r17, r63, r2
	add	r21, r63, r3
	blink	tr0, r18
	ptabs/l	r2, tr0
	ld.q	r14, RTLD_BIND_START_FR_R2, r2
	ld.q	r14, RTLD_BIND_START_FR_R3, r3
	ld.q	r14, RTLD_BIND_START_FR_R4, r4
	ld.q	r14, RTLD_BIND_START_FR_R5, r5
	ld.q	r14, RTLD_BIND_START_FR_R6, r6
	ld.q	r14, RTLD_BIND_START_FR_R7, r7
	ld.q	r14, RTLD_BIND_START_FR_R8, r8
	ld.q	r14, RTLD_BIND_START_FR_R9, r9
	fld.d	r14, RTLD_BIND_START_FR_DR0, dr0
	fld.d	r14, RTLD_BIND_START_FR_DR2, dr2
	fld.d	r14, RTLD_BIND_START_FR_DR4, dr4
	fld.d	r14, RTLD_BIND_START_FR_DR6, dr6
	fld.d	r14, RTLD_BIND_START_FR_DR8, dr8
	fld.d	r14, RTLD_BIND_START_FR_DR10, dr10
	UNLINK_FRAME(RTLD_BIND_START_FR_SIZE)
	blink	tr0, r63
	.size	_ASM_LABEL(_rtld_bind_start),.-_ASM_LABEL(_rtld_bind_start)
@


1.1
log
@Add support for shared libraries/dynamically linked binaries on sh5.
With the latest SuperH toolchain, NetBSD/evbsh5 can now
run with a fully dynamic userland (modulo a few remaining
gremlins affecting a couple of binaries).
@
text
@d1 1
a1 1
/*	$NetBSD$	*/
@


1.1.18.1
log
@Sync w/ NetBSD-4-RC_1
@
text
@d1 1
a1 1
/*	$NetBSD: rtld_start.S,v 1.1 2003/03/25 13:11:54 scw Exp $	*/
@


1.1.16.1
log
@Remove evbsh5 files. Bye!

ok core@@
@
text
@d1 1
a1 1
/*	$NetBSD: rtld_start.S,v 1.1 2003/03/25 13:11:54 scw Exp $	*/
@


