!****************************************************************************
!*
!*	Copyright (C) 1984-2004 Micro Focus International Ltd.
!*
!*	All rights reserved.  Unpublished, all rights reserved under
!*	copyright law and international treaty.  Use of a copyright notice
!*	is precautionary only and does not imply publication or disclosure.
!*	This software contains confidential information and trade secrets of
!*	Micro Focus Ltd. and no part of this program or publication may be
!*	reproduced, transmitted, transcribed, stored in a retrieval system,
!*	or translated into any language or computer language, in any form
!*	or by any means, electronic, mechanical, magnetic, optical, chemical,
!*	manual or otherwise, without the prior written permission of:
!*
!*	Micro Focus Ltd,
!*	The Lawn, Old Bath Road, Newbury, Berkshire, RG14 1QN, UK.
!*	(01635) 32646
!*
!*	RESTRICTED RIGHTS LEGEND
!*	Use, duplication, or disclosure by the Government is subject to
!*	restrictions as set forth in subparagraph (c)(1)(ii) of the Rights
!*	in Technical Data and Computer Software clause at DFARS 52.227-7013
!*	or subparagraphs (c)(1) and (2) of Commercial Computer Software -
!*	Restricted Rights at 48 CFR 52.227-19, as applicable.  Contact
!*	Micro Focus Incorporated, 1001 W. Maude Avenue, Sunnyvale, California 94085, USA
!*
!*	Assembler files for use in Genesis Unix builds.
!*
!*	Source Module preload.sun.app	Sccs Identification 5.3
!*
!*	Last Modified on 04/06/24 at 15:45:13
!*
!****************************************************************************/
!** Start of source module preload.sun.app **
!**
!** NOTE WELL: This module can be simply renamed to dynload.s when 
!**            cob and the build system are setup to handle it
!**
	.section        ".text",#alloc,#execinstr
	.global 	&mFNAME
	.type 		&mFNAME,2
	.align 		4
&mFNAME:
	save    %sp,-0x60,%sp
1:
	call	2f
	sethi	%hi(_GLOBAL_OFFSET_TABLE_ + (. - 1b)), %l1
2:
	or	%l1,%lo(_GLOBAL_OFFSET_TABLE_ + (. - 1b)),%l1
	add	%o7,%l1,%l7
	sethi	%hi(D.&mFNAME),%o3
	add     %o3,%lo(D.&mFNAME),%o3
	ld    [%l7+%o3],%o3
	ld	[%o3],%o0
	subcc   %o0,0,%g0
	bne     .L2.&mFNAME
	nop
	sethi   %hi(L.&mFNAME),%o0
	or      %o0,%lo(L.&mFNAME),%o0
	ld      [%o0+%l7],%o0
	sethi	%hi(S.&mFNAME),%o1
	or	%o1,%lo(S.&mFNAME),%o1
	ld      [%o1+%l7],%o1
	sethi   %hi(&mFNAME),%o2
	or      %o2,%lo(&mFNAME),%o2
	ld      [%o2+%l7],%o2
	call    _mFdynload
	or      %g0,&mFflag,%o4
.L2.&mFNAME:
	jmpl	%o0,%g0	    ! jump to routine with old frame
	restore
	.section        ".data",#alloc,#execinstr
	.align 		8
D.&mFNAME:
	.word	0
S.&mFNAME:
	.asciz	"&mFNAME"
L.&mFNAME:
	.asciz	"&mFNAM2"
