09.06.2013 Views

Intel XENIX 286 Programmers Guide (86) - Tenox.tc

Intel XENIX 286 Programmers Guide (86) - Tenox.tc

Intel XENIX 286 Programmers Guide (86) - Tenox.tc

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Programming Commands <strong>XENIX</strong> Programming<br />

ld -<br />

Invokes the link editor {linker).<br />

Syntax<br />

ld [ option ] .. . filename<br />

Description<br />

...<br />

ld is the <strong>XENIX</strong> link editor. It creates an executable program by combining one or more<br />

object files and copying the executable result into the file a.out. The filename must<br />

name an object or library file. These names must have the .o (for object) or .a (for<br />

archive library) extensions. If more than one name is given, the names must be<br />

separated by one or more spaces. If errors occur while linking, ld displays an error<br />

message. The resulting a.out file is unexecutable.<br />

ld concatenates the contents if the given object files in the order given in the command<br />

line. Library files in the command line are examined only if there are unresolved<br />

external references encountered from previous object files. Library files must be in<br />

ranlib format; that is, the first member must be named _.SYMDEF, which is a<br />

dictionary for the library. ld ignores the modification dates of the library and the<br />

.SYMDEF entry, so if object files have been added to the library since -.SYMDEF<br />

was<br />

created, the link may result in "invalid object module."<br />

The library is searched iteratively to satisfy as many references as possible. Only those<br />

routines that define unresolved external references are concatenated. Object and<br />

library files are processed at the point they are encountered in the argument list, so the<br />

order of files in the command line is important. In general, all object files should be<br />

given before the library files. ld sets the entry point of the resulting program to be the<br />

beginning of the first routine.<br />

ld has these options:<br />

-A num<br />

Creates a standalone program whose expected load address (in hexadecimal) is<br />

num. This option sets the absolute flag in the header of the a.out file. Such<br />

program files can only be executed as standalone programs.<br />

-B num<br />

Sets the text selector bias to the specified hexadecimal number.<br />

-C Causes the editor to ignore the case of symbols.<br />

-D num<br />

Sets the data selector bias to the specified hexadecimal number.<br />

-F num<br />

Sets the size of the program to num bytes. Default stack size, if not given, is<br />

4K bytes.<br />

B-74

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!