1ld86(1) General Commands Manual ld86(1)
2
3
4
6 ld86 - Linker for as86(1)
7
9 ld86 [-03MNdimrstyz[-]] [-llib_extension] [-o outfile] [-Ccrtfile]
10 [-Llibdir] [-Olibfile] [-Ttextaddr] [-Hheapsize] [-Ddataaddr] infile...
11
12
14 This linker understands only the object files produced by the as86
15 assembler, it can link them into either an impure or a separate I&D
16 executable.
17
18 The linking defaults are everything off or none except for -0 and the
19 output file is a.out. There is not a standard library location defined
20 in the linker.
21
22
24 -0 produce header with 16-bit magic
25
26 -3 produce header with 32-bit magic
27
28 -d delete the header from the output file, used for MSDOS COM
29 files. As a side effect this also includes -s as there's nowhere
30 to put a symbol table.
31
32 -Cx add file libdir-from-search/crtx.o to list of files linked
33
34 -D data base address follows (in format suitable for strtoul)
35
36 -H the top of heap (initial stack) address (in format suitable for
37 strtoul)
38
39 -Lx add dir name x to the head of the list of library dirs searched
40
41 -M print symbols linked on stdout
42
43 -N Create a native Linux OMAGIC output file. If the contents are
44 i386 code the binary can be either linked by GCC or executed by
45 linux. If the -z option is also included the linker can generate
46 a QMAGIC executable.
47
48 -Ox add library or object file libdir-from-search/x to list of files
49 linked
50
51 -T text base address follows (in format suitable for strtoul)
52
53 -i separate I&D output
54
55 -lx add library libdir-from-search/libx.a to list of files linked
56
57 -m print modules linked on stdout
58
59 -o output file name follows
60
61 -s strip symbols
62
63 -r Generate a relocatable object from one source object, if the
64 linker is given the -N option also the output format will be the
65 hosts native format if possible.
66
67 -t trace modules being looked at on stdout
68
69 -y Alter the symbol tables to add label 'extensions' so that labels
70 with more than 8 characters can be stored in elks executables.
71
72 -z produce "unmapped zero page" or "QMAGIC" executables
73
74 All the options not taking an argument may be turned off by following
75 the option letter by a '-', as for cc1.
76
78 The linker predefines several labels that can be imported into user
79 programs.
80
81 __etext
82 Standard C variable for the end of the text segment.
83
84 __edata
85 Standard C variable for the end of the initilised data.
86
87 __end Standard C variable for the end of the bss area.
88
89 __segoff
90 The offset within the executable file between the start of the
91 text segment and the start of the data segment in 16 byte
92 'paragraphs'. Note this is zero for impure (tiny model)
93 executables and is adjusted for executables that don't start at
94 offset 0 within the segment.
95
96 __segXDL
97 The lowest address with data in segment 'X'. (eg __seg0DL is for
98 segment zero or the text segment, __seg3DL is for the data
99 segment) The value 'X' is a hex digit.
100
101 __segXDH
102 The top of segment 'X's data area.
103
104 __segXCL
105 The bottom of segment 'X's 'common data' or unitilised data
106 area. Each segment has both an initilised and unitilised data
107 area.
108
109 __segXCH
110 The top of segment 'X's common area.
111
112 __segXSO
113 This is the adjusted offset from segment 0 of the start of
114 segment 'X' in 'paragraphs'.
115
116
118 The 6809 version does not support -i.
119
120 The previous versions of the linker could produce an 8086 executable
121 with segments of a size >64k, now only i386 executables may have
122 segments this large.
123
124
126 The linker cannot deal with reverse seeks caused by org instructions in
127 the object file. Unlike previous versions the current one traps the
128 error rather than trying to fill up the hard disk.
129
130 The linker produces a broken a.out object file if given one input and
131 the -r option this is so it is compatible with pre-dev86 versions.
132
133
134
135 Apr, 1997 ld86(1)