Sys V f77 compiler generates unlinkable code

John Pierce jwp at chem.ucsd.edu
Sat May 14 16:38:07 AEST 1988


On various Sys V related f77 compilers, including a 3B/15, the f77 compiler
generates unlinkable code for the following source (original problem much
reduced):

	subroutine op1()

	character*80 help
	integer result

	read(help,*) result
	end

The loader complaint is:

	test.f:
	   op1:
	undefined			first referenced
	 symbol  			    in file
	s_rsli                              test.o
	e_rsli                              test.o
	MAIN__                              /usr/lib/libF77.a
	ld fatal: Symbol referencing errors. No output written to a.out

The problem is that 's_rsli' and 'e_rsli' do not, but obviously should, exist
in the Sys V library even though the compiler generates calls to them.  This
problem does not exist in BSD f77.

In case anyone cares, the assembly language output for the above source (for
a 3B/15) is

	.file	"test.f"
	.data
	.align	4
.L16:
	.word	3
	.align	4
.L17:
	.word	1
	.bss	v.1,80,4
	.bss	v.3,4,4
	.data
	.data
	.globl	op1_
	.globl	s_rsli
	.globl	do_lio
	.globl	e_rsli
	.align	4
	.data
v.2:
	.word	0
	.word	v.1
	.word	0
	.word	0
	.word	80
	.word	1
	.zero	4
	.text
	.align	4
op1_:
	save	&.R1
	addw2	&.F1,%sp
	jmp	.L13
.L14:
	pushw	&v.2
	call	&1,s_rsli
	pushaw	.L16
	pushaw	.L17
	pushw	&v.3
	pushw	&4
	call	&4,do_lio
	call	&0,e_rsli
.L12:
.L11:
	.set	.R1,0
	ret	&0
	.set	.FSP1,4
.L13:
	.set	.F1,0+.FSP1
	jmp	.L14
	.text

-- 
   John Pierce	Chemistry, B-032, UCSD, La Jolla,  CA 92093
		jwp at chem.ucsd.edu  jwpierce at ucsd  +1 619 534 0203



More information about the Comp.unix.wizards mailing list