Recent Changes to Link (with effect from version 4.03 (A.R.M.) [May  3 1991])
======================


Changes to Version 4.44 (A.R.M.) [Oct 27 1993] Release 1.6
----------------------------------------------

There are five minor improvements, none of which are very visible to users:

 -  On the Macintosh, armlink now allocates 'temporary memory' rather than
    requiring a very large MPW memory partition to run in.

 -  Hash table sizes have been adjusted to be kinder to large link steps. A
    small amount more memory is used as a result. A small improvement in
    performance may be seen in very large link steps.

 -  While reading of an object file, area names are hashed rather than
    looked up by linear search. This gives usefully better performance if
    objects have been compiled one AREA per function (-zO). It has no effect
    on 'traditional' 3 AREAs/object objects. The impact on memory usage is
    negligible.

 -  Armlink no longer warns about use of the FP3 floating point instruction
    set, now that this is the preferred standard. The warning can be
    reinstated (for last-ditch debugging) by using the command line option:
        -MATCH 32

 -  Symbols defined in unused AREAs eliminated by armlink are no longer
    listed by the -Symbols command line options.



Changes to Version 4.42 (A.R.M.) [Oct 20 1993]
----------------------------------------------

There are no user-visible changes. The internal changes are:

 -  Improved PC hosting by introducing BINARY_OPEN_MODE into hostdep.h.

 -  Prevented instruction sequence relocation being appliced to AREAs from
    objects whose AOF version number is less than 310. Similarly, removed
    the inference that pcrel => len=3 if the AOF version number is >= 310
    (this obsoletes the configurability introduced in armlink Version 4.33
    [Mar 29 1993]).



Changes to Version 4.41 (A.R.M.) [Oct 13 1993]
----------------------------------------------

Further improvements to sharable library format and to the help text:

 -  Sharable libraries now support a data in library option (with a zero-
    initialised place holder in the stub, filled at run time by dynamic
    linking or library initialisation code).

 -  Sharable library description files now permit comments more freely.

 -  Help text now includes -RO-base, -RW-base and -SPLIT.



Changes to Version 4.40 (A.R.M.) [Oct  8 1993]
----------------------------------------------

Shared library image format has been repaired and improved:

 -  Many minor infelicities fixed and improvements made.

 -  Relocation of LDR/STR (only used in reentrant code) has been fixed -
    previously instr_offset() set the LDR/STR offset to 0 always (fault
    probably introduced in version 4.33).

 -  *** Incompatible changes to unpublished behaviour ***

    The symbols EFT$$Offset EFT$$Params are no longer present in the stub;
    they are internal symbols for use while building a sharable library.

    Input areas of type SHL_DATA (other stub data areas) are no longer
    copied to the output stub.

    These changes support working with multiple sharable libraries.



Changes to Version 4.39 (A.R.M.) [Oct  8 1993]
----------------------------------------------

Internal changes to support a future scatter-load image format based on
overlays:

 -  Use of overfile != NULL to mean overflag has been reworked into
    scatterflag == OVERLAY.
                           
 -  There is a new, hidden command-line option -SCATTER. When used, overlay
    segments <must> have a base address specified in the overlay file. These
    features have not ben released.



Changes to Version 4.38 (A.R.M.) [Sep  1 1993]
----------------------------------------------

Diagnose the incompatibility of -DATA/RW_base with -IHF (unless -SPLIT is
used).

Add an option to output a shared library binary into a separate chunk of the
stub AOF file rather than to a separate file. This enabled via the shl file
control line:

    > library_name(-)

That is, "-" as the shared library binary file name denotes a deliberately
omitted name and that the shared library binary should be writted to the
SHL_LIBY chunk of the stub.



Changes to Version 4.37 (A.R.M.) [Jul 14 1993]
----------------------------------------------

Fix the cache mismanagement problem which arises when there is insufficient
memory. Fixed by introducing lock_in_cache() and unlock_cache_block(), used
to bracket calls from load1() and load_lib().



Changes to Version 4.36 (A.R.M.) [May 18 1993]
----------------------------------------------

Added a -SPLIT option, currently only effective for -BIN and -IHF output
formats, which allows the read-only and read-write sections to be generated
in two separate files. If the output file given to -Output is called
'image', then the output segment file names used are as follows:

    armlink command line options            read-only       read-write

    -Base N     -DATA M    -SPLIT           image           image.dat
    -Base N     -RW-base M -SPLIT           image           image.rw
    -RO-base N  -RW-base M -SPLIT           image.ro        image.rw

Without -SPLIT, the 2 segments will be concatenated in a single output file,
as before. For now, there is no diagnosis of invalid option combinations.

There has also been an internal reorganisation of messages to better support
native languages and the separation of message text into an application
resource.



Changes to Version 4.35 (A.R.M.) [Apr 19 1993] (Release 1.5)
----------------------------------------------

Area$$Base and $$Limit symbols were found to be broken because they were
absolute symbols with an associated area. Result: the area base was added in
twice instead of once. The fix is to remove the linksymxxx_with_area()
nonsesne which breaks the assertion that ABSAT <=iff=> area==NULL.

This problem introduced by changes made to add_area() in Version 4.30
(A.R.M.) [Dec  8 1992] to fix the phase error in last-gasp symbol matching
and is not present in R1.4.

Instr_reloc() was found to be broken when relocating non-branch instruction
sequences pc-relative. The relocation value passed to instr_reloc() is
already an offset in this case, so v_orig must be zeroed. This problem was
introduced in Version 4.33 (A.R.M.) [Mar 29 1993].

Library re-scanning was found to be broken, probably since before release
1.00. The attempt to fix this in Version 4.17 (A.R.M.) [Nov 17 1991] was
only partly successful. This version uses a more direct and robust fix. The
fault appears to be very rare.



Changes to Version 4.34 (A.R.M.) [Apr  2 1993]
----------------------------------------------

Minor bug-fixes to the handling of COMREF: COMREF now implies 0INIT (done
in addarea()). This flushed out a latent bug in map_areas as well as
simplifying code elsewhere.



Changes to Version 4.33 (A.R.M.) [Mar 29 1993]
----------------------------------------------

This is a major change version:

 -  The default matching of unmatched symbols using the rules:
        ref _sym matches def sym;
        ref sym matches def _sym;
        ref Module_Fn matches def Module.Fn;
    has been made configurable (default - is no match) and controllable from
    the command line using -MATCH n (n = 1, 2, 4, ... to select each of
    these options - n = 7 restores the old behaviour). A new default match
    has been added for C++:
        ref sym__type matches def sym
    This is enabled using -MATCH 8, or by using the config tool.

 -  The default implication that a PC-relative relocation means an
    instruction is being relocated (len = 3) is now configurable (default is
    on). From the command line -MATCH 16 enables.

 -  The command line option -MATCH has been added (see above). This is
    understood by the configuration tools.

 -  The handling of COMDEF, COMREF and SHLDATA areas has been clarified and
    simplified. COMDEF/SHLDATA areas may now be multiply defined provided
    the definitions are identical. This allows, for example, many identical
    copies of an area to be input into a link step, provided each has a
    COMxxx attribute. This change is in support of C++ v-tables and
    out-of-line in-line functions.

 -  Mutiple identical definitions of global symbols are now permitted
    (required by the above).
                            
 -  There have been numerous improvements to the diagnostics produced by the
    armlink and the safety of much code has been improved (more care not to
    overflow character buffers, for example).

 -  -LIST <listing-file> hs been added to allow stdout to be re-directed
    from the command line (affects the output of -MAP and -Xref). -S - sets
    the file for the symbol table listing to be stdout. This allows an Xref
    listing, an area map and a symbol table to be generated in one file.

 -  Support has been added for restricting the length of a sequence of
    instructions to be relocated to 1, 2, or 3 by setting bits 29 and 30 of
    the flags word of a relocation directive (a value of 0 means relocate at
    most 4 words, compatible with previous practice).

 -  The implementation of instruction relocation has been improved - it now
    tries harder to preserve pre-existing values in subject instructions and
    the implementation is now more transparent.



Changes to Version 4.31 (A.R.M.) [Mar  3 1993]
----------------------------------------------

There are three minor improvements in this release:

 -  An infelicity in writebytes() has been mended. Previously, the noted
    stream position after a write would only be correct after a sequence of
    writes starting at the beginning of the file. The consequence was that
    there would be unneeded seeks following a non-sequential write. Because
    almost all writes are/were sequential, this change is rather pedantic.

 -  When producing an AIF output (or -AIF -BIN), if any input object file
    (but NOT library) contains DEBUG data, then the debug flag is turned on
    automatically (so high-level debugging data are propagated to the output
    image and low-level debugging data are generated).

 -  Extra, often more meaningful, synonyms have been introduced for -Base
    and -DATAbase, respectively:
        -Read-Only              (abbreviation -ro)
        -Read-Write             (abbreviation -rw)



Changes to Version 4.30 (A.R.M.) [Dec  8 1992]
----------------------------------------------

-NOUNUSED now <turns off> unused area stripping, as always intended.

The phase error in last-gasp symbol matching has been removed - it's now
done after unused area elimination.



Changes to Version 4.30 (A.R.M.) [Aug 17 1992] (Release 1.4)
----------------------------------------------

A loop on fputc() in writedirect() has been changed to a single call to
fwrite(). This performs better on some hosts (e.g. Macintosh) and is safer
in the pc286 variant (the length written is now compared with the length
requested to be written).

Support for AREA alignment has been added (the ALIGN=x argument to the
assembler's AREA directive; the alignment attribute of AOF AREAs). Alignment
can be to any power of 2 between 2 and 31. Aligned AREAs are places with
their base at the next multiple of the requested alignment boundary.



Changes to Version 4.28 (A.R.M.) [Jul 21 1992]
----------------------------------------------

Major revisions and improvements, mostly internal:

 -  A new class of storage hunk is used to cache object files and libraries.
    When memory is in short supply, cache memory is re-used as global or
    temporary stack space, as appropriate. This avoids the need to partition
    the memory space when the linker starts up and reduces the chance that
    the linker will have too read some of its inputs twice.

 -  -First and -Last object(area) allow an AREA to be designated as coming
    first or last in the output image.

 -  -VIA now works correctly and accepts any command line options in the via
    file. Previously arguments to -O, etc., were botched (static pointers to
    non-static strings...).

 -  -Entry now accepts an address or an offset, specified as n+object(area).
    In the latter form, the entry AREA is set to 'area' from 'object' and
    the entry offset within this area is set to <n>.

 -  A symbol defined in an empty elided AREA no longer causes the linker to
    core dump when partial linking (this is really an input data constraint
    violation, but...).

 -  Debuging data are now correctly included in the root segment of an
    overlaid image. Previously, the root PCIT was overwritten. The base
    addresses shown for DEBUG AREAs by -MAP have also been corrected.

 -  Partial linking (-AOF) now works for AREAs of type DEBUG; previously,
    such AREAs were discarded.

 -  A new option, -NOUNUSEDareas forces the elimination of unused AREAs. By
    default, unused AREAs are removed from images of type -AIF (and -AIF
    -BIN) provided (i) there is an AREA containing an entry point (not just
    an entry point address) and (ii) debugging data have not been included.

 -  Some internal coding faults have been fixed (eg. there was a fault in
    the counting of COMMON areas...).



Changes to Version 4.27 (A.R.M.) [Jun 16 1992]
----------------------------------------------

Fixed several infelicities in unused AREA elimination, introduced for Apple.

 -  only eliminate areas if the output type is AIF (i.e. an image), as well
    as only if the input contains an entry AREA;

 -  remove symbols defined in removed areas from output symbol tables.



Changes to Version 4.26 (A.R.M.) [Jun  3 1992]
----------------------------------------------

Add elimination of unused AREAs: an AREA is unused unless it is referred to
from some AREA referred to from... from the AREA containing the entry point.



Changes to Version 4.25 (A.R.M.) [Apr 27 1992] (Release 1.3)
----------------------------------------------

This is a minor bug-fix release:

 - armlink with no arguments now gives help.

 - armlink -ERRORS <file> re-directs stderr to <file>. This in defference to
   the PC environment.

 - armlink -DATA nnn sets the base of the data segment of an AIF image to
   nnn rather than to base + codesize. There is a check that the resulting
   data area does not overlap the code. If -data is given then the base is
   written to the AIF header (0x34) and a bit 8 is set in the address_mode/
   flags word at offset 0x30.

 - Multiply defined symbols are now better diagnosed (the names of the
   objects in which they are defined are given in the dianostics).

 - Relocatable overlay segments are now linked as if the root segment were
   linked at 0, removing the need to know the linked base of the root at run
   time (it is always 0).

 - The help text has been broken down into chunks of < 512 bytes, in
   deference to MPW C.

 - When an instruction sequence such as:
      ADD  rx, sb/pc, #n
      ADD  rx, rx, #m
      LDR  rd, [rx, #k]
   gets relocated, armlink now preserves #k if at all possible. This avoids
   damaging sequences like:
      ADRL rx, SomeExternalLabel
      LDR  rd, [rx, #k]
      ...
      LDR  ry, [rx, #k2]
   Thus inter-AREA ADR/Ls are now possible (but currently forbidden). Note:
   if the #k value can't be preserved then the ADR/L can't be expanded in
   1/2 instructions. However, a further warning diagnosic is needed before a
   more genral ADR/L is supported.



Changes to Version 4.24 (A.R.M.) [Apr 13 1992]
----------------------------------------------

Most of the changes to this release are internal:
 - More careful use of stream output (and writing things out in the correct
   order) rather than using raw I/O and horrid buffering.

Externally visible changes include:

 - Cross-byte-order linking of overlays and shared libraries (previously
   broken) has been mended.

 - Relocation directives are now output in a more rational order. Thus
   partially linked objects and relocatable images may not be binary
   identical to those produced by earlier linkers.

 - Help info is now output to stdout, not stderr, (deference to the PC).

 - The fault in -IHF output which caused the base address rather than the
   ROM address to be output, has been mended. ROM addresses now start at 0,
   independently of the base address (ROM address == address within ROM).

 - Relocatable, dynamically loaded overlay segments are now supported by the
   linker (-ov <over-desc> -r), but not yet by the standard overlay manager.
   Contact Advanced RISC Machines for details of a simple overlay manager.

 - Overlay segments may now have more flexible names of the form X_Y,
   provided the total name length is 10 characters or less. All segments
   with the same prefix share the same memory (and so can't be coresident).
   Previously only names of the form N_M, with N, M decimal integers, were
   allowed.

 - A fault in sorting areas by attribute, which broke the linking of shared
   library stubs with clients, has been fixed.



Changes to Version 4.23 (A.R.M.) [Jan 31 1992]
----------------------------------------------

Fixed bugs in the partial-linking case of write_symt which caused the fields
of a symbol table not to be sexed properly.



Changes to Version 4.22 (A.R.M.) [Jan 17 1992]
----------------------------------------------

The incompatibility of -bin and -d is diagnosed and -d is ignored when -bin
is specified (previosuly, the output was garbled).



Changes to Version 4.20 (A.R.M.) [Nov 26 1991] (Release 1.0)
----------------------------------------------

This is the major release version and implements the following changes:

 -  The help text has been tidied and restructured.
 -  -Entry may now be abbreviated to -E (not just -EN).
 -  A plain binary image now has its 0-initialised data fully expanded
    (previously it was omitted from the image file).
 -  Bad integer parameter-block values from shared library descriptions are
    now diagnosed (used to be silently zeroed).
 -  The default base for binary and -IHF images is now 0.
 -  An entry address not in an image's code or initialised data, is faulted.
 -  -Symbols is now recognised in full.
 -  Unresolved symbol references may now be resolved to a single, defined,
    global symbol using -Uresolved sym.
 -  The builtin AIF header code, module relocation code and AIF relocation
    code has been revised to follow the latest defition of AIF and to be
    neutral with respect to 26/32-bit operation.
 -  If the first object file in the object list has a special form (contains
    areas named AIF_HDR (of size 128), AIF_RELOC, AMF_RELOC, with attributes
    CODE, READONLY), the builtin code can be overridden. Note that certain
    structural features of the code cannot be changed.
 -  A new image type -BIN -AIF has been introduced. It is a plain binary
    image preceded by an AIF heaader which describes it. It is distinguished
    from an executable AIF image by the entry instruction being an entry
    offset. The AIF header is not part of the image.
 -  A bug in the sorting of areas of type CODE, READ-WRITE has been fixed
    (previously the linker did not believe in such areas and allocated the
    wrong base addresses to them).
 -  The diagnosis of failed relocation of instruction sequences (e.g. B to
    unaligned destination, LDR offset out of range) has been improved.
 -  The diagnosis of attribute conflicts between areas has been improved
    and AIF images are now marked 26-bit or 32-bit.



Changes to Version 4.17 (A.R.M.) [Nov 17 1991]
----------------------------------------------

Version 4.17 fixes the following bug: a weak reference upgraded to non-weak
by inclusion of a library module, was not causing the library to be
re-scanned. This apparently left the weak reference unsatisfied.



Changes to Version 4.16 (A.R.M.) [Oct ?? 1991]
----------------------------------------------

The byte order of the ASD tables was finally fixed correctly, independently
of the hosts's byte order.



Changes to Version 4.15 (A.R.M.) [Oct  9 1991]
----------------------------------------------

In vsn 4.14, when there were debugging areas in the input, but not in the
output (no -d) then addarea() returned NULL which was derefernced.

In v4.14, when linking -relocatable, the length of the string table
containing low-level symbol names was not being rounded up to a multiple of
4, with fatal consequences for the immediately following relocation code.

The length word of the string table was always being written in the host
byte sex, rather than the target byte sex.

The ASD debug items are not written in the correct byte order unless target
sex == host sex. This bug remains.



Changes to Version 4.14 (A.R.M.) [Sep 23 1991]
----------------------------------------------

Fixed a bug in partial linking (-aof) whereby the symbol number in an output
relocation directive had not been reconstructed to take account of the the
conversion of local-symbol-relative directives to area-base-relative
directives. This caused by a rationalisation of the code in load2() which
failed to hoist symno = sy->symno high enough...



Changes to Version 4.13 (A.R.M.) [Sep 16 1991]
----------------------------------------------

No changes of function, but a complete reimplementation of:

    armlink's messaging edifice (messages are now mostly in a form which can
    be compile-time internationalised);

    armlink's storage management strategy (no longer RISC OS centred and now
    friendly to the PC and other segmented architectures).



Changes to Version 4.08 (A.R.M.) [Jul 16 1991]
----------------------------------------------

Armlink now has improved diagnosis and handling of AREA attribute clashes.
Now, clashing attributes are warned of, but no action is taken unless the
attribute would affect the ordering of the AREA within the image (AOF_CODE,
AOF_READONLY, AOF_DEBUG, AOF_0INIT).

The linker now rests on aof.h (was objflfmt.h - no change in content) and,
in its RISC OS incarnation, on riscos.h rather than kernel.h (with some
changes to the implementation). The functionality of armlink is unchanged by
these technical, implementation changes.



Changes to Version 4.07 (A.R.M.)
--------------------------------

Version 4.07 was not released - all changes were subsumed into 4.08.



Changes to Version 4.06 (A.R.M.) [May 20 1991]
----------------------------------------------

Partial linking (link -aof), was still broken - now mended. It transpired
that is was broken by carelessly applied modifications designed to support
byte-sex-independence, which had the effect of destroying all the relocation
directives.



Changes to Version 4.05 (A.R.M.) [May 17 1991]
----------------------------------------------

Partial linking (link -aof), broken since release 4.00, has been mended.

Link -IHC -d (Intellec Hex Format with symbol definition comments) now
includes the defintions of linker-fabricated symbols (e.g. Image$$RO$$Limit)
if and only if such symbols are referenced.



Changes to Version 4.03 (A.R.M.) [May  3 1991]
----------------------------------------------

Link -IHC now generate Intellec Hex Format output, as consumed by the VLSI
tools. In this case, any -Base address is an address in 32-bit WORDs, NOT
bytes. Link -IHC -d appends a plain-text, readable symbol table (as IHC
comments) the end of the output file.

Link can now consume absolute AREAs, as can be generated by ObjAsm 1.84 or
later. If the address at which such an AREA is placed by link is not
identical to its base address, link complains and produces no output. (This
is the best interim strategy for dealing with input containing a mixture of
absolute and relocatable areas - it imposes no constraints on how such AREAs
can or should be mixed save that the eventual result must be meaningful).

Link now handles Type-2, PC-relative, non-Additive relocation directives as
follows:

    offset-in-instr +=
       ((target-area != containing-area) ? word-address-of-target area : 0)
       - word-address-of-containing-area

This allows expressions such as BL Constant to be coded as PC-relative to
the containing area. Such expressions are otherwise meaningless/redundant.

Link -DO marks the output (AIF) image Absolute and refrains from inserting
the DDT SWI into the AIF header, thus allowing the result to be used with (a
slightly modified) ASD.
