MC68LD(1)

NAME
mc68ld - link editor for MC68000 object files

SYNOPSIS
mc68ld [ options ] file-names

DESCRIPTION
The mc68ld command combines several object files into one, performs relocation, resolves external symbols, and supports symbol table information for symbolic debugging. In the simplest case, the names of several object programs are given, and mc68ld combines them, producing an object module that can either be executed or used as input for a subsequent mc68ld run. The output of mc68ld is left in mc68a.out. This file is executable if no errors occurred during the load. If any input file, file-name, is not an object file, mc68ld assumes it is either a text file containing link editor directives or an archive library. (See the Link Editor in the UNIX System V Support Tools Guide for a discussion of input directives.)

If any argument is a library, it is searched exactly once at the point it is encountered in the argument list. Only those routines defining an unresolved external reference are loaded. The order of library members is unimportant because mc68ld passes through each library's (archive) symbol table as many times as necessary until no new external symbols are resolved and no new references are generated.

The following options are recognized by mc68ld.

-a  Produces an absolute file; gives warnings for undefined references. Relocation information is stripped from the output object file unless the -r option is given. The -r option is needed only when an absolute file should retain its relocation information (the normal case for the 630 MTG downloaded programs). If neither -a nor -r is given, -a is assumed.

-e epsym
    Sets the default entry point address for the output file to be that of the symbol epsym.

-f fill
    Sets the default fill pattern for ``holes'' within an output section as well as initialized bss sections. The argument fill is a two-byte constant.

-lx Searches a library libx.a, where x is up to seven characters. A library is searched when its name is encountered, so the placement of a -l is significant. By default, libraries are located in $DMD/lib .

-m  Produces a map or listing of the input/output sections on the standard output.

-o outfile
    Produces an output object file by the name outfile. The name of the default object file is mc68a.out.

-r  Retains relocation entries in the output object file. Relocation entries must be saved if the output file is to become an input file in a subsequent mc68ld run. Unless -a is also given, the link editor will not complain about unresolved references.

-s  Strips line number entries and symbol table information from the output object file.

-u symname
    Enters symname as an undefined symbol in the symbol table. This is useful for loading entirely from a library, since initially the symbol table is empty and an unresolved reference is needed to force the loading of the first routine.

-L dir
    Changes the algorithm of searching for libx.a to look in dir before looking in $DMD/lib. This option is effective only if it precedes the -l option on the command line.

-N  Puts the data section immediately following the text in the output file.

-V  Outputs a message giving information about the version of mc68ld being used.

-VS num
    Uses num as a decimal version stamp identifying the mc68a.out file that is produced. The version stamp is stored in the optional header.

FILES
$DMD/lib/lib?.a
    libraries
mc68a.out
    output file

SEE ALSO
dmdcc(1), mc68as(1).
a.out(4), ar(4) in the UNIX System V Programmer's Reference Manual.

WARNINGS
Through its options and input directives, the Motorola 68000 link editor gives users great flexibility; however, those who use the input directives must assume some added responsibilities. Input directives and options should insure the following properties for programs:

-   C defines a zero pointer as null. A pointer to which zero has been assigned must not point to any object. To satisfy this, users must not place any object at virtual address zero in the data space.

-   When the link editor is called through dmdcc(1), a startup routine is linked with the user's program. This routine usually calls exit(~) [see exit(3R)] after execution of the main program. If the user calls the link editor directly, then the user must insure that the program always calls exit(~) rather than falling through the end of the entry routine.

The -VS num option has an effect only when the -X option is also selected.