* Makefile.in: Revert 2001-06-17.
[deliverable/binutils-gdb.git] / binutils / dlltool.1
CommitLineData
16b2b71c
NC
1.\" Automatically generated by Pod::Man version 1.02
2.\" Wed May 30 12:24:27 2001
3.\"
4.\" Standard preamble:
5.\" ======================================================================
6.de Sh \" Subsection heading
0285c67d
NC
7.br
8.if t .Sp
9.ne 5
10.PP
11\fB\\$1\fR
12.PP
13..
16b2b71c 14.de Sp \" Vertical space (when we can't use .PP)
0285c67d
NC
15.if t .sp .5v
16.if n .sp
17..
16b2b71c 18.de Ip \" List item
0285c67d
NC
19.br
20.ie \\n(.$>=3 .ne \\$3
21.el .ne 3
22.IP "\\$1" \\$2
23..
16b2b71c 24.de Vb \" Begin verbatim text
0285c67d
NC
25.ft CW
26.nf
27.ne \\$1
28..
16b2b71c 29.de Ve \" End verbatim text
0285c67d
NC
30.ft R
31
32.fi
33..
16b2b71c
NC
34.\" Set up some character translations and predefined strings. \*(-- will
35.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
36.\" double quote, and \*(R" will give a right double quote. | will give a
37.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used
38.\" to do unbreakable dashes and therefore won't be available. \*(C` and
39.\" \*(C' expand to `' in nroff, nothing in troff, for use with C<>
0285c67d 40.tr \(*W-|\(bv\*(Tr
16b2b71c 41.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
0285c67d 42.ie n \{\
16b2b71c
NC
43. ds -- \(*W-
44. ds PI pi
45. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
46. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
47. ds L" ""
48. ds R" ""
49. ds C` `
50. ds C' '
0285c67d
NC
51'br\}
52.el\{\
16b2b71c
NC
53. ds -- \|\(em\|
54. ds PI \(*p
55. ds L" ``
56. ds R" ''
0285c67d 57'br\}
16b2b71c
NC
58.\"
59.\" If the F register is turned on, we'll generate index entries on stderr
60.\" for titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and
61.\" index entries marked with X<> in POD. Of course, you'll have to process
62.\" the output yourself in some meaningful fashion.
63.if \nF \{\
64. de IX
65. tm Index:\\$1\t\\n%\t"\\$2"
66. .
67. nr % 0
68. rr F
0285c67d 69.\}
16b2b71c
NC
70.\"
71.\" For nroff, turn off justification. Always turn off hyphenation; it
72.\" makes way too many mistakes in technical documents.
73.hy 0
74.\"
75.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
76.\" Fear. Run. Save yourself. No user-serviceable parts.
0285c67d 77.bd B 3
16b2b71c 78. \" fudge factors for nroff and troff
0285c67d 79.if n \{\
16b2b71c
NC
80. ds #H 0
81. ds #V .8m
82. ds #F .3m
83. ds #[ \f1
84. ds #] \fP
0285c67d
NC
85.\}
86.if t \{\
16b2b71c
NC
87. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
88. ds #V .6m
89. ds #F 0
90. ds #[ \&
91. ds #] \&
0285c67d 92.\}
16b2b71c 93. \" simple accents for nroff and troff
0285c67d 94.if n \{\
16b2b71c
NC
95. ds ' \&
96. ds ` \&
97. ds ^ \&
98. ds , \&
99. ds ~ ~
100. ds /
0285c67d
NC
101.\}
102.if t \{\
16b2b71c
NC
103. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
104. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
105. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
106. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
107. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
108. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
0285c67d 109.\}
16b2b71c 110. \" troff and (daisy-wheel) nroff accents
0285c67d
NC
111.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
112.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
0285c67d
NC
113.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
114.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
115.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
116.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
117.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
118.ds ae a\h'-(\w'a'u*4/10)'e
119.ds Ae A\h'-(\w'A'u*4/10)'E
16b2b71c 120. \" corrections for vroff
0285c67d
NC
121.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
122.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
16b2b71c 123. \" for low resolution devices (crt and lpr)
0285c67d
NC
124.if \n(.H>23 .if \n(.V>19 \
125\{\
16b2b71c
NC
126. ds : e
127. ds 8 ss
128. ds o a
129. ds d- d\h'-1'\(ga
130. ds D- D\h'-1'\(hy
131. ds th \o'bp'
132. ds Th \o'LP'
133. ds ae ae
134. ds Ae AE
0285c67d
NC
135.\}
136.rm #[ #] #H #V #F C
16b2b71c
NC
137.\" ======================================================================
138.\"
139.IX Title "DLLTOOL.1 1"
140.TH DLLTOOL.1 1 "binutils-2.11.90" "2001-05-30" "GNU"
141.UC
0285c67d
NC
142.SH "NAME"
143dlltool \- Create files needed to build and use DLLs.
144.SH "SYNOPSIS"
16b2b71c
NC
145.IX Header "SYNOPSIS"
146dlltool [\-d|\-\-input-def \fIdef-file-name\fR]
147 [\-b|\-\-base-file \fIbase-file-name\fR]
148 [\-e|\-\-output-exp \fIexports-file-name\fR]
149 [\-z|\-\-output-def \fIdef-file-name\fR]
150 [\-l|\-\-output-lib \fIlibrary-file-name\fR]
151 [\-\-export-all-symbols] [\-\-no-export-all-symbols]
152 [\-\-exclude-symbols \fIlist\fR]
153 [\-\-no-default-excludes]
154 [\-S|\-\-as \fIpath-to-assembler\fR] [\-f|\-\-as-flags \fIoptions\fR]
155 [\-D|\-\-dllname \fIname\fR] [\-m|\-\-machine \fImachine\fR]
156 [\-a|\-\-add-indirect] [\-U|\-\-add-underscore] [\-k|\-\-kill-at]
157 [\-A|\-\-add-stdcall-alias]
158 [\-x|\-\-no-idata4] [\-c|\-\-no-idata5] [\-i|\-\-interwork]
159 [\-n|\-\-nodelete] [\-v|\-\-verbose] [\-h|\-\-help] [\-V|\-\-version]
0285c67d
NC
160 [object-file ...]
161.SH "DESCRIPTION"
16b2b71c
NC
162.IX Header "DESCRIPTION"
163\&\f(CW\*(C`dlltool\*(C'\fR reads its inputs, which can come from the \fB\-d\fR and
164\&\fB\-b\fR options as well as object files specified on the command
0285c67d
NC
165line. It then processes these inputs and if the \fB\-e\fR option has
166been specified it creates a exports file. If the \fB\-l\fR option
167has been specified it creates a library file and if the \fB\-z\fR option
168has been specified it creates a def file. Any or all of the \-e, \-l
169and \-z options can be present in one invocation of dlltool.
170.PP
16b2b71c
NC
171When creating a \s-1DLL\s0, along with the source for the \s-1DLL\s0, it is necessary
172to have three other files. \f(CW\*(C`dlltool\*(C'\fR can help with the creation of
0285c67d
NC
173these files.
174.PP
175The first file is a \fB.def\fR file which specifies which functions are
16b2b71c
NC
176exported from the \s-1DLL\s0, which functions the \s-1DLL\s0 imports, and so on. This
177is a text file and can be created by hand, or \f(CW\*(C`dlltool\*(C'\fR can be used
178to create it using the \fB\-z\fR option. In this case \f(CW\*(C`dlltool\*(C'\fR
0285c67d
NC
179will scan the object files specified on its command line looking for
180those functions which have been specially marked as being exported and
181put entries for them in the .def file it creates.
182.PP
16b2b71c 183In order to mark a function as being exported from a \s-1DLL\s0, it needs to
0285c67d
NC
184have an \fB\-export:<name_of_function>\fR entry in the \fB.drectve\fR
185section of the object file. This can be done in C by using the
16b2b71c 186\&\fIasm()\fR operator:
0285c67d 187.PP
16b2b71c 188.Vb 2
0285c67d
NC
189\& asm (".section .drectve");
190\& asm (".ascii \e"-export:my_func\e"");
16b2b71c
NC
191.Ve
192.Vb 1
0285c67d
NC
193\& int my_func (void) { ... }
194.Ve
16b2b71c
NC
195The second file needed for \s-1DLL\s0 creation is an exports file. This file
196is linked with the object files that make up the body of the \s-1DLL\s0 and it
197handles the interface between the \s-1DLL\s0 and the outside world. This is a
0285c67d 198binary file and it can be created by giving the \fB\-e\fR option to
16b2b71c 199\&\f(CW\*(C`dlltool\*(C'\fR when it is creating or reading in a .def file.
0285c67d 200.PP
16b2b71c
NC
201The third file needed for \s-1DLL\s0 creation is the library file that programs
202will link with in order to access the functions in the \s-1DLL\s0. This file
0285c67d
NC
203can be created by giving the \fB\-l\fR option to dlltool when it
204is creating or reading in a .def file.
205.PP
16b2b71c 206\&\f(CW\*(C`dlltool\*(C'\fR builds the library file by hand, but it builds the
0285c67d
NC
207exports file by creating temporary files containing assembler statements
208and then assembling these. The \fB\-S\fR command line option can be
209used to specify the path to the assembler that dlltool will use,
210and the \fB\-f\fR option can be used to pass specific flags to that
211assembler. The \fB\-n\fR can be used to prevent dlltool from deleting
212these temporary assembler files when it is done, and if \fB\-n\fR is
213specified twice then this will prevent dlltool from deleting the
214temporary object files it used to build the library.
215.PP
16b2b71c 216Here is an example of creating a \s-1DLL\s0 from a source file \fBdll.c\fR and
0285c67d 217also creating a program (from an object file called \fBprogram.o\fR)
16b2b71c 218that uses that \s-1DLL:\s0
0285c67d 219.PP
16b2b71c 220.Vb 4
0285c67d
NC
221\& gcc -c dll.c
222\& dlltool -e exports.o -l dll.lib dll.o
223\& gcc dll.o exports.o -o dll.dll
224\& gcc program.o dll.lib -o program
225.Ve
226.SH "OPTIONS"
16b2b71c 227.IX Header "OPTIONS"
0285c67d 228The command line options have the following meanings:
16b2b71c
NC
229.Ip "\f(CW\*(C`\-d \f(CIfilename\f(CW\*(C'\fR" 4
230.IX Item "-d filename"
231.Ip "\f(CW\*(C`\-\-input\-def \f(CIfilename\f(CW\*(C'\fR" 4
232.IX Item "--input-def filename"
0285c67d 233Specifies the name of a .def file to be read in and processed.
16b2b71c
NC
234.Ip "\f(CW\*(C`\-b \f(CIfilename\f(CW\*(C'\fR" 4
235.IX Item "-b filename"
236.Ip "\f(CW\*(C`\-\-base\-file \f(CIfilename\f(CW\*(C'\fR" 4
237.IX Item "--base-file filename"
0285c67d
NC
238Specifies the name of a base file to be read in and processed. The
239contents of this file will be added to the relocation section in the
240exports file generated by dlltool.
16b2b71c
NC
241.Ip "\f(CW\*(C`\-e \f(CIfilename\f(CW\*(C'\fR" 4
242.IX Item "-e filename"
243.Ip "\f(CW\*(C`\-\-output\-exp \f(CIfilename\f(CW\*(C'\fR" 4
244.IX Item "--output-exp filename"
0285c67d 245Specifies the name of the export file to be created by dlltool.
16b2b71c
NC
246.Ip "\f(CW\*(C`\-z \f(CIfilename\f(CW\*(C'\fR" 4
247.IX Item "-z filename"
248.Ip "\f(CW\*(C`\-\-output\-def \f(CIfilename\f(CW\*(C'\fR" 4
249.IX Item "--output-def filename"
0285c67d 250Specifies the name of the .def file to be created by dlltool.
16b2b71c
NC
251.Ip "\f(CW\*(C`\-l \f(CIfilename\f(CW\*(C'\fR" 4
252.IX Item "-l filename"
253.Ip "\f(CW\*(C`\-\-output\-lib \f(CIfilename\f(CW\*(C'\fR" 4
254.IX Item "--output-lib filename"
0285c67d 255Specifies the name of the library file to be created by dlltool.
16b2b71c
NC
256.Ip "\f(CW\*(C`\-\-export\-all\-symbols\*(C'\fR" 4
257.IX Item "--export-all-symbols"
0285c67d
NC
258Treat all global and weak defined symbols found in the input object
259files as symbols to be exported. There is a small list of symbols which
16b2b71c 260are not exported by default; see the \f(CW\*(C`\-\-no\-default\-excludes\*(C'\fR
0285c67d 261option. You may add to the list of symbols to not export by using the
16b2b71c
NC
262\&\f(CW\*(C`\-\-exclude\-symbols\*(C'\fR option.
263.Ip "\f(CW\*(C`\-\-no\-export\-all\-symbols\*(C'\fR" 4
264.IX Item "--no-export-all-symbols"
0285c67d
NC
265Only export symbols explicitly listed in an input .def file or in
266\&\fB.drectve\fR sections in the input object files. This is the default
267behaviour. The \fB.drectve\fR sections are created by \fBdllexport\fR
268attributes in the source code.
16b2b71c
NC
269.Ip "\f(CW\*(C`\-\-exclude\-symbols \f(CIlist\f(CW\*(C'\fR" 4
270.IX Item "--exclude-symbols list"
0285c67d
NC
271Do not export the symbols in \fIlist\fR. This is a list of symbol names
272separated by comma or colon characters. The symbol names should not
273contain a leading underscore. This is only meaningful when
16b2b71c
NC
274\&\f(CW\*(C`\-\-export\-all\-symbols\*(C'\fR is used.
275.Ip "\f(CW\*(C`\-\-no\-default\-excludes\*(C'\fR" 4
276.IX Item "--no-default-excludes"
277When \f(CW\*(C`\-\-export\-all\-symbols\*(C'\fR is used, it will by default avoid
0285c67d
NC
278exporting certain special symbols. The current list of symbols to avoid
279exporting is \fBDllMain@12\fR, \fBDllEntryPoint@0\fR,
16b2b71c 280\&\fBimpure_ptr\fR. You may use the \f(CW\*(C`\-\-no\-default\-excludes\*(C'\fR option
0285c67d 281to go ahead and export these special symbols. This is only meaningful
16b2b71c
NC
282when \f(CW\*(C`\-\-export\-all\-symbols\*(C'\fR is used.
283.Ip "\f(CW\*(C`\-S \f(CIpath\f(CW\*(C'\fR" 4
284.IX Item "-S path"
285.Ip "\f(CW\*(C`\-\-as \f(CIpath\f(CW\*(C'\fR" 4
286.IX Item "--as path"
0285c67d
NC
287Specifies the path, including the filename, of the assembler to be used
288to create the exports file.
16b2b71c
NC
289.Ip "\f(CW\*(C`\-f \f(CIswitches\f(CW\*(C'\fR" 4
290.IX Item "-f switches"
291.Ip "\f(CW\*(C`\-\-as\-flags \f(CIswitches\f(CW\*(C'\fR" 4
292.IX Item "--as-flags switches"
0285c67d
NC
293Specifies any specific command line switches to be passed to the
294assembler when building the exports file. This option will work even if
295the \fB\-S\fR option is not used. This option only takes one argument,
296and if it occurs more than once on the command line, then later
297occurrences will override earlier occurrences. So if it is necessary to
298pass multiple switches to the assembler they should be enclosed in
299double quotes.
16b2b71c
NC
300.Ip "\f(CW\*(C`\-D \f(CIname\f(CW\*(C'\fR" 4
301.IX Item "-D name"
302.Ip "\f(CW\*(C`\-\-dll\-name \f(CIname\f(CW\*(C'\fR" 4
303.IX Item "--dll-name name"
0285c67d
NC
304Specifies the name to be stored in the .def file as the name of the \s-1DLL\s0
305when the \fB\-e\fR option is used. If this option is not present, then
306the filename given to the \fB\-e\fR option will be used as the name of
307the \s-1DLL\s0.
16b2b71c
NC
308.Ip "\f(CW\*(C`\-m \f(CImachine\f(CW\*(C'\fR" 4
309.IX Item "-m machine"
310.Ip "\f(CW\*(C`\-machine \f(CImachine\f(CW\*(C'\fR" 4
311.IX Item "-machine machine"
0285c67d 312Specifies the type of machine for which the library file should be
16b2b71c 313built. \f(CW\*(C`dlltool\*(C'\fR has a built in default type, depending upon how
0285c67d
NC
314it was created, but this option can be used to override that. This is
315normally only useful when creating DLLs for an \s-1ARM\s0 processor, when the
316contents of the \s-1DLL\s0 are actually encode using \s-1THUMB\s0 instructions.
16b2b71c
NC
317.Ip "\f(CW\*(C`\-a\*(C'\fR" 4
318.IX Item "-a"
319.Ip "\f(CW\*(C`\-\-add\-indirect\*(C'\fR" 4
320.IX Item "--add-indirect"
321Specifies that when \f(CW\*(C`dlltool\*(C'\fR is creating the exports file it
0285c67d
NC
322should add a section which allows the exported functions to be
323referenced without using the import library. Whatever the hell that
324means!
16b2b71c
NC
325.Ip "\f(CW\*(C`\-U\*(C'\fR" 4
326.IX Item "-U"
327.Ip "\f(CW\*(C`\-\-add\-underscore\*(C'\fR" 4
328.IX Item "--add-underscore"
329Specifies that when \f(CW\*(C`dlltool\*(C'\fR is creating the exports file it
0285c67d 330should prepend an underscore to the names of the exported functions.
16b2b71c
NC
331.Ip "\f(CW\*(C`\-k\*(C'\fR" 4
332.IX Item "-k"
333.Ip "\f(CW\*(C`\-\-kill\-at\*(C'\fR" 4
334.IX Item "--kill-at"
335Specifies that when \f(CW\*(C`dlltool\*(C'\fR is creating the exports file it
0285c67d
NC
336should not append the string \fB@ <number>\fR. These numbers are
337called ordinal numbers and they represent another way of accessing the
338function in a \s-1DLL\s0, other than by name.
16b2b71c
NC
339.Ip "\f(CW\*(C`\-A\*(C'\fR" 4
340.IX Item "-A"
341.Ip "\f(CW\*(C`\-\-add\-stdcall\-alias\*(C'\fR" 4
342.IX Item "--add-stdcall-alias"
343Specifies that when \f(CW\*(C`dlltool\*(C'\fR is creating the exports file it
0285c67d
NC
344should add aliases for stdcall symbols without \fB@ <number>\fR
345in addition to the symbols with \fB@ <number>\fR.
16b2b71c
NC
346.Ip "\f(CW\*(C`\-x\*(C'\fR" 4
347.IX Item "-x"
348.Ip "\f(CW\*(C`\-\-no\-idata4\*(C'\fR" 4
349.IX Item "--no-idata4"
350Specifies that when \f(CW\*(C`dlltool\*(C'\fR is creating the exports and library
0285c67d
NC
351files it should omit the .idata4 section. This is for compatibility
352with certain operating systems.
16b2b71c
NC
353.Ip "\f(CW\*(C`\-c\*(C'\fR" 4
354.IX Item "-c"
355.Ip "\f(CW\*(C`\-\-no\-idata5\*(C'\fR" 4
356.IX Item "--no-idata5"
357Specifies that when \f(CW\*(C`dlltool\*(C'\fR is creating the exports and library
0285c67d
NC
358files it should omit the .idata5 section. This is for compatibility
359with certain operating systems.
16b2b71c
NC
360.Ip "\f(CW\*(C`\-i\*(C'\fR" 4
361.IX Item "-i"
362.Ip "\f(CW\*(C`\-\-interwork\*(C'\fR" 4
363.IX Item "--interwork"
364Specifies that \f(CW\*(C`dlltool\*(C'\fR should mark the objects in the library
0285c67d
NC
365file and exports file that it produces as supporting interworking
366between \s-1ARM\s0 and \s-1THUMB\s0 code.
16b2b71c
NC
367.Ip "\f(CW\*(C`\-n\*(C'\fR" 4
368.IX Item "-n"
369.Ip "\f(CW\*(C`\-\-nodelete\*(C'\fR" 4
370.IX Item "--nodelete"
371Makes \f(CW\*(C`dlltool\*(C'\fR preserve the temporary assembler files it used to
0285c67d
NC
372create the exports file. If this option is repeated then dlltool will
373also preserve the temporary object files it uses to create the library
374file.
16b2b71c
NC
375.Ip "\f(CW\*(C`\-v\*(C'\fR" 4
376.IX Item "-v"
377.Ip "\f(CW\*(C`\-\-verbose\*(C'\fR" 4
378.IX Item "--verbose"
0285c67d 379Make dlltool describe what it is doing.
16b2b71c
NC
380.Ip "\f(CW\*(C`\-h\*(C'\fR" 4
381.IX Item "-h"
382.Ip "\f(CW\*(C`\-\-help\*(C'\fR" 4
383.IX Item "--help"
0285c67d 384Displays a list of command line options and then exits.
16b2b71c
NC
385.Ip "\f(CW\*(C`\-V\*(C'\fR" 4
386.IX Item "-V"
387.Ip "\f(CW\*(C`\-\-version\*(C'\fR" 4
388.IX Item "--version"
0285c67d
NC
389Displays dlltool's version number and then exits.
390.SH "SEE ALSO"
16b2b71c 391.IX Header "SEE ALSO"
0285c67d
NC
392the Info entries for \fIbinutils\fR.
393.SH "COPYRIGHT"
16b2b71c 394.IX Header "COPYRIGHT"
0285c67d
NC
395Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001 Free Software Foundation, Inc.
396.PP
397Permission is granted to copy, distribute and/or modify this document
16b2b71c 398under the terms of the \s-1GNU\s0 Free Documentation License, Version 1.1
0285c67d
NC
399or any later version published by the Free Software Foundation;
400with no Invariant Sections, with no Front-Cover Texts, and with no
401Back-Cover Texts. A copy of the license is included in the
16b2b71c 402section entitled \*(L"\s-1GNU\s0 Free Documentation License\*(R".
This page took 0.051713 seconds and 4 git commands to generate.