[comp.sys.3b1] Problems with ld

zaft@suned1.nswses.navy.mil (Gordon C Zaft) (04/25/91)

	This is a weird one.  I have been playing with this for a while.

	Basically, I can't link anything.  The setup: UnixPC, 2.5M,
40meg disk, 3.51m OS, 3.51 Dev. Set.

	cc works fine, I can compile things to my heart's content; but
when I run ld I don't get anything.  When I tried a makefile (exercise,
in this case) the makefile said:

	ld -s -o exercise exercise.o /lib/crt0s.o /lib/shlib.ifile
*** Error Code 13.
Stop.

	Anyone got any brilliant ideas?  This is a serious problem,
obviously, and it's driving me crazy.
--
+  Gordon Zaft                        |  zaft@suned1.nswses.navy.mil         +
+  NSWSES, Code 4Y33                  |  suned1!zaft@elroy.jpl.nasa.gov      +
+  Port Hueneme, CA 93043-5007        |  Phone: (805) 982-0684 FAX: 982-8768 +
** ..et resurrexit tertia die secundum scripturas, et ascendit in coelum.. ***

clewis@ferret.ocunix.on.ca (Chris Lewis) (04/26/91)

In article <9395@suned1.Nswses.Navy.MIL> zaft@suned1.nswses.navy.mil (Gordon C Zaft) writes:

>	cc works fine, I can compile things to my heart's content; but
>when I run ld I don't get anything.  When I tried a makefile (exercise,
>in this case) the makefile said:

>	ld -s -o exercise exercise.o /lib/crt0s.o /lib/shlib.ifile
>*** Error Code 13.
>Stop.

I'm not entirely familiar with linking with shared libraries, but the
crt usually goes first in the listing of objects.
-- 
Chris Lewis, Phone: (613) 832-0541, Domain: clewis@ferret.ocunix.on.ca
UUCP: ...!cunews!latour!ecicrl!clewis; Ferret Mailing List:
ferret-request@eci386; Psroff (not Adobe Transcript) enquiries:
psroff-request@eci386 or Canada 416-832-0541.  Psroff 3.0 in c.s.u soon!

dnichols@ceilidh.beartrack.com (DoN Nichols) (04/26/91)

In article <9395@suned1.Nswses.Navy.MIL> zaft@suned1.nswses.navy.mil (Gordon C Zaft) writes:
>
>	This is a weird one.  I have been playing with this for a while.
>
>	Basically, I can't link anything.  The setup: UnixPC, 2.5M,
>40meg disk, 3.51m OS, 3.51 Dev. Set.
>
>	cc works fine, I can compile things to my heart's content; but
>when I run ld I don't get anything.  When I tried a makefile (exercise,

	[ ... ]

	Have you considered that your copy of 'ld' might be corrupted?  I've
got essentially the same software, and running 'sum' on my ld gives:

	32230 75 /bin/ld

You might want to check through your /usr/adm/syslog for signs of any HDERR
entries.

Also, you should check your libraries for damage as well.  I just ran
'strings' on /bin/ld, and got this:

	sky/m68020
	sky/m68020/m68881
	software/m68881
	software/sky
	m68020/sky
	/lib
	/usr/lib
	/ifile.0
	/ifile.0
	/dev/null

For completeness, you should check the libraries that it tried to use,
although I would think that there would be a better error message if ld
tried to access one and failed.  Here's the sum on the two libs that you
tried to use, but /lib/crt0s.o may differ, since I ran the program to fix
the dst switchover problem on mine, and don't have readily accessable an old
version to sum.

>	ld -s -o exercise exercise.o /lib/crt0s.o /lib/shlib.ifile

	12641 1 /lib/crt0s.o
	7715 11 /lib/shlib.ifile

	It looks as though /bin/ld has some Sun ancestry, since the above
strings from ld that mention sky imply the 'sky' board which put a 68881
into the sun-2 series of workstations.  (The ones built on the Intel
Multibus - I've just added one to my collection of machines, and hope to get
a 'sky' board for it.)

	I guess that you won't need to check the sum on one file from the
'strings' output above, /dev/null :-)

	Good Luck
		DoN.
-- 
Donald Nichols (DoN.)		| Voice (Days):	(703) 664-1585
D&D Data			| Voice (Eves):	(703) 938-4564
Disclaimer: from here - None	| Email:     <dnichols@ceilidh.beartrack.com>
	--- Black Holes are where God is dividing by zero ---

bruce@balilly (Bruce Lilly) (04/27/91)

In article <9395@suned1.Nswses.Navy.MIL> zaft@suned1.nswses.navy.mil (Gordon C Zaft) writes:
>
>	ld -s -o exercise exercise.o /lib/crt0s.o /lib/shlib.ifile
>*** Error Code 13.
>Stop.

Error 13 is EACCES. Check permissions of /bin/ld, the directory you're
working in, the object file, /lib/crt0s.o, and /lib/shlib.ifile.
-- 
	Bruce Lilly		blilly!balilly!bruce@sonyd1.Broadcast.Sony.COM