home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 2: PC
/
frozenfish_august_1995.bin
/
bbs
/
d09xx
/
d0933.lha
/
PhxLnk
/
PhxLnk.doc
< prev
next >
Wrap
Text File
|
1993-12-20
|
4KB
|
139 lines
P h x L n k
AMIGA-DOS Module Linker
Contents
--------
I. Introduction
II. Usage
III. Bugs
I. Introduction
===============
PhxLnk was written in pure assembler-code, assembled with PhxAss and linked
with BLink (first version) and PhxLnk itself. It supports all features of a
standard Amiga-DOS linker (like BLink), except of overlay hunks (HUNK_OVERLAY)
and library hunks (HUNK_LIB, HUNK_INDEX).
PhxLnk is FREEWARE and copyright ⌐ 1992,93 by Frank Wille.
Commercial usage of this program is strictly forbidden!
II. Usage
=========
The linker can be used from CLI only. You may copy it to the C-directory of
your workdisk, then type :
PhxLnk [<-options>] <object- or library-module names ...>
to start PhxLnk. Starting PhxLnk with no argument or with a single '?' will
display a short instruction.
There are two types of modules which can be linked:
o Object modules with extension ".o" or ".obj" which normally consist of one
unit. PhxLnk also links object modules with several units.
o Library modules with extension ".lib" which can consist of any number of
units. PhxLnk will only include units, if at least one ext_def-symbol is
referenced in an object module unit or in an already included library unit.
The module names can appear in any order, provided the first is an object
module which contains the startup code.
Options:
-o<Name> Sets the name of the output file. If not specified, the output
name is the name of the first module without extension,
e.g. "phxlnk prog1.o prog2.o c.lib m.lib" will produce a load-
file with the name "prog1".
-a This option forces all sections to be loaded to Chip-Memory.
-c Normally only the sections of the same type and name will be
linked together. -c ignores the names of the Code sections,
they will be linked to one large Code section. Usually -c is set
when using small-code model.
-d As with -c the section names are ignored, but now for the Data and
Bss sections. Data and Bss will not be mixed! This large section
will contain first all the Data and then all the Bss.
Important! When PhxLnk creates the load-file, only the Data-part of
this section will be written.
After a LoadSegment() the Bss-part is completely uninitialized!
You will have to clear it using the special Linker-Symbols
_DATA_BAS_, _DATA_LEN_ and _BSS_LEN_ (see Linker-Symbols for more
information).
All references to, or symbols of this section will be calculated
as if the Bss sections were directly behind the Data.
-d will be needed when using the near-data model for both Data and
Bss sections.
-s The hunk_symbol($3f0) and hunk_debug($3f1) blocks which contain
information for a debugger will not be written to the load-file.
-b<num> Sets the maximum number of sections per unit to <num>. The default
value is 16 (which should be enough for most cases).
Linker-Symbols:
The linker itself creates one ext_def($01xxxxxx) and two ext_abs($02xxxxxx)
symbols which will be needed by the startup code of a program using the small-
data model.
_DATA_BAS_ (ext_def) Base address of the small-data section.
_DATA_LEN_ (ext_abs) Length of the Data-part of the small-data section.
_BSS_LEN_ (ext_abs) Length of the Bss-part of the small-data section.
Small-Data:
Small-data symbols can be accessed in a range of 65534 ($fffe) bytes. When a
symbol is outside of this range, the linker will display an error.
The small-data model must be initialized by the startup code. When you're
using A4 as small-data pointer, the initialization would look like this:
lea SmallDataBase,a4
lea 32766(a4),a4
Don't write "lea SmallDataBase+32766,a4". Some assemblers could change this
address during optimization.
I chose 32766 instead of 32768, because this is the way most assemblers and
linkers do it (e.g. DICE).
III. Bugs
=========
None?
The linker does not support overlay- and library-hunks, something which could
be added in future updates.
If any errors or questions occur, please write to :
Frank Wille
Auf dem Dreische 45
32049 Herford
GERMANY
__
///
///
///
__ ///
\\\ ///
\\\ ///
\\\///
\XX/ A M I G A F O R E V E R !