!**
!** 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,-0xc0,%sp
1:
	rd	%pc,%l7
	sethi	%hh(_GLOBAL_OFFSET_TABLE_ + (. - 1b)), %l0
	sethi	%lm(_GLOBAL_OFFSET_TABLE_ + (. - 1b)), %l1
	or	%l0,%hm(_GLOBAL_OFFSET_TABLE_ + (. - 1b)),%l0
	or	%l1,%lo(_GLOBAL_OFFSET_TABLE_ + (. - 1b)),%l1
	sllx	%l0,32,%l0
	or	%l0,%l1,%l0
	add 	%l7,%l0,%l7
	sethi	%hi(D.&mFNAME),%o3
	add     %o3,%lo(D.&mFNAME),%o3
	ldx    [%l7+%o3],%o3
	ldx	[%o3],%o0
	subcc   %o0,0,%g0
	bne     .L2.&mFNAME
	nop
	sethi   %hi(L.&mFNAME),%o0
	or      %o0,%lo(L.&mFNAME),%o0
	ldx      [%o0+%l7],%o0
	sethi	%hi(S.&mFNAME),%o1
	or	%o1,%lo(S.&mFNAME),%o1
	ldx      [%o1+%l7],%o1
	sethi   %hi(&mFNAME),%o2
	or      %o2,%lo(&mFNAME),%o2
	ldx      [%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:
	.xword	0
S.&mFNAME:
	.asciz	"&mFNAME"
L.&mFNAME:
	.asciz	"&mFNAM2"
