Path: utzoo!censor!geac!torsqnt!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!ncar!gatech!rutgers!cbmvax!peter From: peter@cbmvax.commodore.com (Peter Cherna) Newsgroups: comp.sys.amiga.tech Subject: Re: SAS Library Message-ID: <17232@cbmvax.commodore.com> Date: 8 Jan 91 17:14:21 GMT References: <56669.663204707@atronx.OCUnix.On.Ca> Reply-To: peter@cbmvax.commodore.com (Peter Cherna) Organization: Commodore, West Chester, PA Lines: 43 In article <56669.663204707@atronx.OCUnix.On.Ca> rwm@atronx.OCUnix.On.Ca (Russell McOrmond) writes: > > Here is a message from a friend that has a question: If possible could >you respond to: David.Jones@p8.f109.n163.z1.fidonet.org > >For some reason, BLINK is not correctly generating the offset to the global >data (stored off A4) from the value present in A6. I have tried to make a >very small "test" library. The offset generated by BLINK is always zero, >i.e. the function prologue is > >LEA LinkerDB(A6),A4 > >and the linker seems to be using zero for LinkerDB. The funny thing is >that I linked my test library a few days ago and nothing has changed - the >sources are directly from the SAS source directory. Two questions: You must link in the order libent.o+libinit.o+yourstuff.o LinkerDB is evaluated when libinit.o is linked, and is not valid until AFTER libinit.o is linked. Therefore, you cannot access any global data inside libinit.o or any modules linked prior to it, unless you access them off your library base. In particular, ignore the comment in libinit.c that states: "Do library specific public initialization here" If you have any of that to do, do it as a separate routine called from this point, with the routine itself located in another module. It's a little arcane. > Russell McOrmond rwm@Atronx.OCUnix.On.Ca {tigris,alzabo,...}!atronx!rwm > FidoNet 1:163/109 Net Support: (613) 230-2282 > Amiga-Fidonet Support 1:1/109 Peter -- Peter Cherna, Software Engineer, Commodore-Amiga, Inc. {uunet|rutgers}!cbmvax!peter peter@cbmvax.commodore.com My opinions do not necessarily represent the opinions of my employer. "Oh, PIN-compatible! I thought you wanted me to make it IN-compatible!"