SEARCH
NEW RPMS
DIRECTORIES
ABOUT
FAQ
VARIOUS
BLOG
DONATE


YUM REPOSITORY

 
 

MAN page from RedHat EL 6 toolchain-armiwmmx-2012-2012.12.1-oselas.2.2.x86_64.rpm

DLLTOOL

Section: GNU Development Tools (1)
Updated: 2017-09-21
Index 

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]
        [-y|--output-delaylib 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] [--add-stdcall-underscore]
        [-k|--kill-at] [-A|--add-stdcall-alias]
        [-p|--ext-prefix-alias prefix]
        [-x|--no-idata4] [-c|--no-idata5]
        [--use-nul-prefixed-import-tables]
        [-I|--identify library-file-name] [--identify-strict]
        [-i|--interwork]
        [-n|--nodelete] [-t|--temp-prefix prefix]
        [-v|--verbose]
        [-h|--help] [-V|--version]
        [--no-leading-underscore] [--leading-underscore]
        [object-file ...] 

DESCRIPTION

dlltool reads its inputs, which can come from the -d and-b options as well as object files specified on the commandline. It then processes these inputs and if the -e option hasbeen specified it creates a exports file. If the -l optionhas been specified it creates a library file and if the -z optionhas been specified it creates a def file. Any or all of the -e,-l and -z options can be present in one invocation ofdlltool.

When creating a DLL, along with the source for the DLL, it is necessaryto have three other files. dlltool can help with the creation ofthese files.

The first file is a .def file which specifies which functions areexported from the DLL, which functions the DLL imports, and so on. Thisis a text file and can be created by hand, or dlltool can be usedto create it using the -z option. In this case dlltoolwill scan the object files specified on its command line looking forthose functions which have been specially marked as being exported andput entries for them in the .def file it creates.

In order to mark a function as being exported from a DLL, it needs tohave an -export:<name_of_function> entry in the .drectvesection of the object file. This can be done in C by using theasm() operator:

          asm (".section .drectve");          asm (".ascii \"-export:my_func\"");                  int my_func (void) { ... }

The second file needed for DLL creation is an exports file. This fileis linked with the object files that make up the body of the DLL and ithandles the interface between the DLL and the outside world. This is abinary file and it can be created by giving the -e option todlltool when it is creating or reading in a .def file.

The third file needed for DLL creation is the library file that programswill link with in order to access the functions in the DLL (an `importlibrary'). This file can be created by giving the -l option todlltool when it is creating or reading in a .def file.

If the -y option is specified, dlltool generates a delay-importlibrary that can be used instead of the normal import library to allowa program to link to the dll only as soon as an imported function iscalled for the first time. The resulting executable will need to belinked to the static delayimp library containing __delayLoadHelper2(),which in turn will import LoadLibraryA and GetProcAddress from kernel32.

dlltool builds the library file by hand, but it builds theexports file by creating temporary files containing assembler statementsand then assembling these. The -S command line option can beused to specify the path to the assembler that dlltool will use,and the -f option can be used to pass specific flags to thatassembler. The -n can be used to prevent dlltool from deletingthese temporary assembler files when it is done, and if -n isspecified twice then this will prevent dlltool from deleting thetemporary object files it used to build the library.

Here is an example of creating a DLL from a source file dll.c andalso 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

dlltool may also be used to query an existing import libraryto determine the name of the DLL to which it is associated. See the description of the -I or --identify option. 

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. Thecontents of this file will be added to the relocation section in theexports 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.
-y filename
--output-delaylib filename
Specifies the name of the delay-import library file to be created by dlltool.
--export-all-symbols
Treat all global and weak defined symbols found in the input objectfiles as symbols to be exported. There is a small list of symbols whichare not exported by default; see the --no-default-excludesoption. 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 defaultbehaviour. The .drectve sections are created by dllexportattributes in the source code.
--exclude-symbols list
Do not export the symbols in list. This is a list of symbol namesseparated by comma or colon characters. The symbol names should notcontain 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 avoidexporting certain special symbols. The current list of symbols to avoidexporting is DllMain@12, DllEntryPoint@0,impure_ptr. You may use the --no-default-excludes optionto go ahead and export these special symbols. This is only meaningfulwhen --export-all-symbols is used.
-S path
--as path
Specifies the path, including the filename, of the assembler to be usedto create the exports file.
-f options
--as-flags options
Specifies any specific command line options to be passed to theassembler when building the exports file. This option will work even ifthe -S option is not used. This option only takes one argument,and if it occurs more than once on the command line, then lateroccurrences will override earlier occurrences. So if it is necessary topass multiple options to the assembler they should be enclosed indouble quotes.
-D name
--dll-name name
Specifies the name to be stored in the .def file as the name ofthe DLL when the -e option is used. If this option is notpresent, then the filename given to the -e option will beused as the name of the DLL.
-m machine
-machine machine
Specifies the type of machine for which the library file should bebuilt. dlltool has a built in default type, depending upon howit was created, but this option can be used to override that. This isnormally only useful when creating DLLs for an ARM processor, when thecontents of the DLL are actually encode using Thumb instructions.
-a
--add-indirect
Specifies that when dlltool is creating the exports file itshould add a section which allows the exported functions to bereferenced without using the import library. Whatever the hell thatmeans!
-U
--add-underscore
Specifies that when dlltool is creating the exports file itshould prepend an underscore to the names of all exported symbols.
--no-leading-underscore
--leading-underscore
Specifies whether standard symbol should be forced to be prefixed, ornot.
--add-stdcall-underscore
Specifies that when dlltool is creating the exports file itshould prepend an underscore to the names of exported stdcallfunctions. Variable names and non-stdcall function names are not modified.This option is useful when creating GNU-compatible import libs for thirdparty DLLs that were built with MS-Windows tools.
-k
--kill-at
Specifies that when dlltool is creating the exports file itshould not append the string @ <number>. These numbers arecalled ordinal numbers and they represent another way of accessing thefunction in a DLL, other than by name.
-A
--add-stdcall-alias
Specifies that when dlltool is creating the exports file itshould add aliases for stdcall symbols without @ <number>in addition to the symbols with @ <number>.
-p
--ext-prefix-alias prefix
Causes dlltool to create external aliases for all DLLimports with the specified prefix. The aliases are created for bothexternal and import symbols with no leading underscore.
-x
--no-idata4
Specifies that when dlltool is creating the exports and libraryfiles it should omit the ".idata4" section. This is for compatibilitywith certain operating systems.
--use-nul-prefixed-import-tables
Specifies that when dlltool is creating the exports and libraryfiles it should prefix the ".idata4" and ".idata5" by zero anelement. This emulates old gnu import library generation of"dlltool". By default this option is turned off.
-c
--no-idata5
Specifies that when dlltool is creating the exports and libraryfiles it should omit the ".idata5" section. This is for compatibilitywith certain operating systems.
-I filename
--identify filename
Specifies that dlltool should inspect the import libraryindicated by filename and report, on "stdout", the name(s)of the associated DLL(s). This can be performed in addition to anyother operations indicated by the other options and arguments.dlltool fails if the import library does not exist or is notactually an import library. See also --identify-strict.
--identify-strict
Modifies the behavior of the --identify option, suchthat an error is reported if filename is associated withmore than one DLL.
-i
--interwork
Specifies that dlltool should mark the objects in the libraryfile and exports file that it produces as supporting interworkingbetween ARM and Thumb code.
-n
--nodelete
Makes dlltool preserve the temporary assembler files it used tocreate the exports file. If this option is repeated then dlltool willalso preserve the temporary object files it uses to create the libraryfile.
-t prefix
--temp-prefix prefix
Makes dlltool use prefix when constructing the names oftemporary assembler and object files. By default, the temp file prefixis generated from the pid.
-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.
@file
Read command-line options from file. The options read areinserted in place of the original @file option. If filedoes not exist, or cannot be read, then the option will be treatedliterally, and not removed.

Options in file are separated by whitespace. A whitespacecharacter may be included in an option by surrounding the entireoption in either single or double quotes. Any character (including abackslash) may be included by prefixing the character to be includedwith a backslash. The file may itself contain additional@file options; any such options will be processed recursively.

 

SEE ALSO

The Info pages for binutils. 

COPYRIGHT

Copyright (c) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010Free Software Foundation, Inc.

Permission is granted to copy, distribute and/or modify this documentunder the terms of the GNU Free Documentation License, Version 1.3or any later version published by the Free Software Foundation;with no Invariant Sections, with no Front-Cover Texts, and with noBack-Cover Texts. A copy of the license is included in thesection entitled ``GNU Free Documentation License''.


 

Index

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
SEE ALSO
COPYRIGHT

This document was created byman2html,using the manual pages.