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