Red Hat ENTERPRISE LINUX 4 - USING BINUTILS Using Instructions page 56

Using binutils, the gnu binary utilities
Hide thumbs Also See for ENTERPRISE LINUX 4 - USING BINUTILS:
Table of Contents

Advertisement

50
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
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
or reading in a .def file.
builds the library file by hand, but it builds the exports file by creating temporary files
dlltool
containing assembler statements and then assembling these. The
used to specify the path to the assembler that dlltool will use, and the
specific flags to that assembler. The
assembler files when it is done, and if
the temporary object files it used to build the library.
Here is an example of creating a DLL from a source file
object file called
program.o
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
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
-exclude-symbols
Chapter 14. Create files needed to build and use DLLs
can be used to prevent dlltool from deleting these temporary
-n
is specified twice then this will prevent dlltool from deleting
-n
) that uses that DLL:
option. You may add to the list of symbols to not export by using the
option.
option to
-e
dlltool
option to dlltool when it is creating
-l
command line option can be
-S
option can be used to pass
-f
and also creating a program (from an
dll.c
when it is creating or

Advertisement

Table of Contents
loading

This manual is also suitable for:

Enterprise linux 4

Table of Contents