[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem Installing Orca/C 1.3 - Unresolved Reference Label



In article <1993Feb12.084258.29554@ee.rochester.edu> seah@ee.rochester.edu (David Seah) writes:
> In article <1993Feb11.215254.4704@actrix.gen.nz> David.Empson@bbs.actrix.gen.nz writes:
> >To avoid having to reboot, use the RENAME command to move the affected
> >files out of the library directory, then move them back in, in the
> >correct order.
> 
> There is also a built-in command SWITCH which will switch the entries
> in the directory around.  

The SWITCH and COMPRESS commands cannot be used on HFS or Appleshare
volumes, or on your boot volume.  They involve block-level reads and
writes to change the directory, and GS/OS doesn't let you do block
writes to disks that have open files.  Other file systems aren't
supported because these commands 'know' only the ProDOS directory
structure (and AppleShare doesn't allow block read/write anyway).

If you want to use these commands on your first hard drive partition,
you'll have to boot from floppy first.

> Related question:  Is there really any good reason for Orca/C to depend
> on the order of files in a directory structure?  It seems kind of lame,
> but maybe, just maybe, there's a really excellent reason for it.

Well, it isn't ORCA/C, it's the linker.  Your C program calls library
routines (which are in ORCALIB), and the compiler also generates calls
to some runtime support routines (which are in SYSLIB).  In addition,
the routines in ORCALIB might call other routines in SYSLIB.

The linker reads the libraries in directory order, pulling in any
function that contains a symbol which is presently undefined.  It
doesn't go back to scan them a second time, so if you have the
libraries in the wrong order (SYSLIB first), any calls made by ORCALIB
to SYSLIB will cause undefined symbol errors.

This is basically how linkers work on most systems.  If you specify
the libraries in the wrong order, you might get linker errors.  A
smarter linker might make an extra pass of the libraries to fix up any
backward references, but in really bad cases (libraries created with
the segments in the wrong order), this might require a large number of
passes.  Given enough memory, the linker could save all of the library
dictionaries, I suppose.

Maybe someone should suggest it to Mike.  :-)

In the meantime, just make sure your standard ORCA-supplied libraries
are in alphabetic order (O, P, S), and if you have any libraries of
your own that replace standard ORCA libraries, they must go first.
-- 
David Empson

Internet: David.Empson@bbs.actrix.gen.nz    EMPSON_D@kosmos.wcc.govt.nz
Snail mail: P.O. Box 27-103, Wellington, New Zealand