Home
Main website
Display Sidebar
Hide Ads
Recent Changes
View Source:
dlltool(1)
Edit
PageHistory
Diff
Info
LikePages
DLLTOOL !!!DLLTOOL NAME SYNOPSIS DESCRIPTION OPTIONS SEE ALSO COPYRIGHT ---- !!NAME dlltool - Create files needed to build and use DLLs. !!SYNOPSIS dlltool [[__-d--input-def__ ''def-file-name''] [[__-b--base-file__ ''base-file-name''] [[__-e--output-exp__ ''exports-file-name''] [[__-z--output-def__ ''def-file-name''] [[__-l--output-lib__ ''library-file-name''] [[__--export-all-symbols__] [[__--no-export-all-symbols__] [[__--exclude-symbols__ ''list''] [[__--no-default-excludes__] [[__-S--as__ ''path-to-assembler''] [[__-f--as-flags__ ''options''] [[__-D--dllname__ ''name''] [[__-m--machine__ ''machine''] [[__-a--add-indirect__] [[__-U--add-underscore__] [[__-k--kill-at__] [[__-A--add-stdcall-alias__] [[__-x--no-idata4__] [[__-c--no-idata5__] [[__-i--interwork__] [[__-n--nodelete__] [[__-v--verbose__] [[__-h--help__] [[__-V--version__] [[object-file ...] !!DESCRIPTION __dlltool__ reads its inputs, which can come from the __-d__ and __-b__ options as well as object files specified on the command line. It then processes these inputs and if the __-e__ option has been specified it creates a exports file. If the __-l__ option has been specified it creates a library file and if the __-z__ option has been specified it creates a def file. Any or all of the __-e__, __-l__ and __-z__ options can be present in one invocation of dlltool. When creating a DLL , along with the source for the DLL , it is necessary to have three other files. __dlltool__ can help with the creation of these files. The first file is a __.def__ file which specifies which functions are exported from the DLL , which functions the DLL imports, and so on. This is a text file and can be created by hand, or __dlltool__ can be used to create it using the __-z__ option. In this case __dlltool__ will scan the object files specified on its command line looking for those functions which have been specially marked as being exported and put entries for them in the .def file it creates. In order to mark a function as being exported from a DLL , it needs to have an __-export:__ entry in the __.drectve__ section of the object file. This can be done in C by using the ''asm()'' operator: asm ( int my_func (void) { ... } The second file needed for DLL creation is an exports file. This file is linked with the object files that make up the body of the DLL and it handles the interface between the DLL and the outside world. This is a binary file and it can be created by giving the __-e__ option to __dlltool__ when it is creating or reading in a .def file. The third file needed for DLL creation is the library file that programs will link with in order to access the functions in the DLL . This file can be created by giving the __-l__ option to dlltool when it is creating or reading in a .def file. __dlltool__ builds the library file by hand, but it builds the exports file by creating temporary files containing assembler statements and then assembling these. The __-S__ command line option can be used to specify the path to the assembler that dlltool will use, and the __-f__ option can be used to pass specific flags to that assembler. The __-n__ can be used to prevent dlltool from deleting these temporary assembler files when it is done, and if __-n__ is specified twice then this will prevent dlltool from deleting the temporary object files it used to build the library. Here is an example of creating a DLL from a source file __dll.c__ and also creating a program (from an object file called __program.o__) that uses that DLL: gcc -c dll.c dlltool -e exports.o -l dll.lib dll.o gcc dll.o exports.o -o dll.dll gcc program.o dll.lib -o program !!OPTIONS The command line options have the following meanings: __-d__ ''filename'' __--input-def__ ''filename'' Specifies the name of a .def file to be read in and processed. __-b__ ''filename'' __--base-file__ ''filename'' Specifies the name of a base file to be read in and processed. The contents of this file will be added to the relocation section in the exports file generated by dlltool. __-e__ ''filename'' __--output-exp__ ''filename'' Specifies the name of the export file to be created by dlltool. __-z__ ''filename'' __--output-def__ ''filename'' Specifies the name of the .def file to be created by dlltool. __-l__ ''filename'' __--output-lib__ ''filename'' Specifies the name of the library file to be created by dlltool. __--export-all-symbols__ Treat all global and weak defined symbols found in the input object files as symbols to be exported. There is a small list of symbols which are not exported by default; see the __--no-default-excludes__ option. You may add to the list of symbols to not export by using the __--exclude-symbols__ option. __--no-export-all-symbols__ Only export symbols explicitly listed in an input .def file or in __.drectve__ sections in the input object files. This is the default behaviour. The __.drectve__ sections are created by __dllexport__ attributes in the source code. __--exclude-symbols__ ''list'' Do not export the symbols in ''list''. This is a list of symbol names separated by comma or colon characters. The symbol names should not contain a leading underscore. This is only meaningful when __--export-all-symbols__ is used. __--no-default-excludes__ When __--export-all-symbols__ is used, it will by default avoid exporting certain special symbols. The current list of symbols to avoid exporting is __!DllMain@12__, __!DllEntryPoint@0__, __impure_ptr__. You may use the __--no-default-excludes__ option to go ahead and export these special symbols. This is only meaningful when __--export-all-symbols__ is used. __-S__ ''path'' __--as__ ''path'' Specifies the path, including the filename, of the assembler to be used to create the exports file. __-f__ ''options'' __--as-flags__ ''options'' Specifies any specific command line options to be passed to the assembler when building the exports file. This option will work even if the __-S__ option is not used. This option only takes one argument, and if it occurs more than once on the command line, then later occurrences will override earlier occurrences. So if it is necessary to pass multiple options to the assembler they should be enclosed in double quotes. __-D__ ''name'' __--dll-name__ ''name'' Specifies the name to be stored in the .def file as the name of the DLL when the __-e__ option is used. If this option is not present, then the filename given to the __-e__ option will be used as the name of the DLL . __-m__ ''machine'' __-machine__ ''machine'' Specifies the type of machine for which the library file should be built. __dlltool__ has a built in default type, depending upon how it was created, but this option can be used to override that. This is normally only useful when creating DLLs for an ARM processor, when the contents of the DLL are actually encode using Thumb instructions. __-a__ __--add-indirect__ Specifies that when __dlltool__ is creating the exports file it should add a section which allows the exported functions to be referenced without using the import library. Whatever the hell that means! __-U__ __--add-underscore__ Specifies that when __dlltool__ is creating the exports file it should prepend an underscore to the names of the exported functions before actually calling them. __-k__ __--kill-at__ Specifies that when __dlltool__ is creating the exports file it should remove the string `__@__<number>'. These numbers are part of the win32 __stdcall calling convention and represent the number of bytes the called function pops up from stack before returning. See [http://mywebpage.netscape.com/yongweiwu/stdcall.htm] for more details. __-A__ __--add-stdcall-alias__ Specifies that when __dlltool__ is creating the exports file it should add alias symbols without `__@__<number>' in addition to the stdcall symbols with `__@__<number>'. __-x__ __--no-idata4__ Specifies that when __dlltool__ is creating the exports and library files it should omit the .idata4 section. This is for compatibility with certain operating systems. __-c__ __--no-idata5__ Specifies that when __dlltool__ is creating the exports and library files it should omit the .idata5 section. This is for compatibility with certain operating systems. __-i__ __--interwork__ Specifies that __dlltool__ should mark the objects in the library file and exports file that it produces as supporting interworking between ARM and Thumb code. __-n__ __--nodelete__ Makes __dlltool__ preserve the temporary assembler files it used to create the exports file. If this option is repeated then dlltool will also preserve the temporary object files it uses to create the library file. __-v__ __--verbose__ Make dlltool describe what it is doing. __-h__ __--help__ Displays a list of command line options and then exits. __-V__ __--version__ Displays dlltool's version number and then exits. !!SEE ALSO the Info entries for ''binutils''. !!COPYRIGHT Copyright (c) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001, 2002 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled `` GNU Free Documentation License''. ----
One page links to
dlltool(1)
:
Man1d
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.