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