🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #7902

SAS Library

#7902
From: Russell McOrmond
Date: Sun, 06 Jan 1991 17:31
78 lines
2637 bytes
  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:

What preconditions are necessary for Blink to correctly generate the value
for LinkerDB?  I am including libinit.o as the second module and libent.o
as the first module.  I am using the LIBFD keyword as well.

How does Blink determine the value to give LinkerDB?  LinkerDB must be
equal to the size of the library base structure, which, in the SAS
libinit.c file, is 50 bytes in length.  Is this length hard coded?  Or is
it derived from the object code somehow (one likely possibility is that
Blink looks at the first longword in the first data hunk in the second
module which explains why libinit.o MUST be the second module.)

Here are listings of all source files other than those provided by SAS:

makefile: 
--------

test.library: libfuncs.o libent.o libinit.o lib.fd
  blink LIBFD lib.fd TO libs:test.library FROM libent.o libinit.o
libfuncs.o LIB lib:lc.lib

libfuncs.o: libfuncs.c 
  lc -ml -v libfuncs.c

libent.o: libent.a
  asm -iinclude: -u libent.a

libinit.o: libinit.c
  lc -ml -v libinit.c

lib.h: lib.fd
  fd2pragma lib.fd lib.h
  

lib.fd: 
------

##base _TestBase 
##bias 30 
Double(x)(D0) 
Square(x)(D0) 
PutV(x)(D0) 
##end

libfuncs.c: 
----------

int globV;

int __saveds __asm Double(register __d0 int x) {
  return(x << 1); }

int __saveds __asm Square(register __d0 int x) {
  return(x * x); }

void __saveds __asm PutV(register __d0 int v) {
  globV = v; }

---
  Opinions expressed in this message are my Own.  My Employer does not even
know what these networks ARE.

  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
Technical Details
Message-ID: <56669.663204707@atronx.OCUnix.On.Ca>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!cunews!micor!latour!atronx!rwm

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!cunews!micor!latour!atronx!rwm
From: rwm@atronx.OCUnix.On.Ca (Russell McOrmond)
Newsgroups: comp.sys.amiga.tech
Subject: SAS Library
Message-ID: <56669.663204707@atronx.OCUnix.On.Ca>
Date: Sun Jan 06 17:31:47 1991
Followup-To: comp.sys.amiga.tech