* dlltool.c (usage): Add file parameter. Change all callers.

(main): Don't treat '?' as a special case in getopt return.

	* binutils.texi (dlltool): Document new options.  Add some uses of
	@var.

Wed Aug 19 16:19:07 1998  Mumit Khan  <khan@xraylith.wisc.edu>

	* dlltool.c (gen_def_file): Plug memory leak.  Don't print
	demangled name if it is NULL.

	Support for exporting all symbols to an output export def file:
	* dlltool.c ({export_all_symbols, no_default_excludes,
	no_default_excludes, excludes}): New file static variables.
	(struct string_list): Type to hold list of symbols to exclude.
	(scan_drectve_symbols): Renamed from scan_open_obj_file.
	(scan_filtered_symbols): New static function.
	(add_excludes): New static function.
	(match_exclude): New static function.
	(set_default_excludes): New static function.
	(filter_symbols): New static function.
	(scan_all_symbols): New static function.
	(scan_open_obj_file): New static function.
	(usage): Document new options.
	(long_options): Add new options.
	(main): Handle new options.
This commit is contained in:
Ian Lance Taylor
1998-08-19 20:23:33 +00:00
parent 6cf219acdf
commit faad4b4786
3 changed files with 392 additions and 62 deletions

View File

@@ -2073,13 +2073,16 @@ utilities, since it is only useful for those targets which support DLLs.
@end quotation
@smallexample
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>]
[-S|--as <path-to-assembler>] [-f|--as-flags <options>]
[-D|--dllname <name>] [-m|--machine <machine>]
dlltool [-d|--input-def @var{def-file-name}]
[-b|--base-file @var{base-file-name}]
[-e|--output-exp @var{exports-file-name}]
[-z|--output-def @var{def-file-name}]
[-l|--output-lib @var{library-file-name}]
[--export-all-symbols] [--no-export-all-symbols]
[--exclude-symbols @var{list}]
[--no-default-excludes]
[-S|--as @var{path-to-assembler}] [-f|--as-flags @var{options}]
[-D|--dllname @var{name}] [-m|--machine @var{machine}]
[-a|--add-indirect] [-U|--add-underscore] [-k|--kill-at]
[-x|--no-idata4] [-c|--no-idata5] [-i|--interwork]
[-n|--nodelete] [-v|--verbose] [-h|--help] [-V|--version]
@@ -2107,12 +2110,12 @@ 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 @samp{-export:<name_of_function>} entry in the @samp{.drective}
have an @samp{-export:<name_of_function>} entry in the @samp{.drectve}
section of the object file. This can be done in C by using the
asm() operator:
@smallexample
asm (".section .drective");
asm (".section .drectve");
asm (".ascii \"-export:my_func\"");
int my_func (void) @{ @dots{} @}
@@ -2154,37 +2157,64 @@ The command line options have the following meanings:
@table @code
@item -d FILENAME
@itemx --input-def FILENAME
@item -d @var{filename}
@itemx --input-def @var{filename}
@cindex input .def file
Specifies the name of a .def file to be read in and processed.
@item -b FILENAME
@itemx --base-file FILENAME
@item -b @var{filename}
@itemx --base-file @var{filename}
@cindex base files
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.
@item -e FILENAME
@itemx --output-exp FILENAME
@item -e @var{filename}
@itemx --output-exp @var{filename}
Specifies the name of the export file to be created by dlltool.
@item -z FILENAME
@itemx --output-def FILENAME
@item -z @var{filename}
@itemx --output-def @var{filename}
Specifies the name of the .def file to be created by dlltool.
@item -l FILENAME
@itemx --output-lib FILENAME
@item -l @var{filename}
@itemx --output-lib @var{filename}
Specifies the name of the library file to be created by dlltool.
@item -S PATH
@itemx --as PATH
@item --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 @code{--no-default-excludes}
option. You may add to the list of symbols to not export by using the
@code{--exclude-symbols} option.
@item --no-export-all-symbols
Only export symbols explicitly listed in an input .def file or in
@samp{.drectve} sections in the input object files. This is the default
behaviour. The @samp{.drectve} sections are created by @samp{dllexport}
attributes in the source code.
@item --exclude-symbols @var{list}
Do not export the symbols in @var{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
@code{--export-all-symbols} is used.
@item --no-default-excludes
When @code{--export-all-symbols} is used, it will by default avoid
exporting certain special symbols. The current list of symbols to avoid
exporting is @samp{DllMain@@12}, @samp{DllEntryPoint@@0},
@samp{impure_ptr}. You may use the @code{--no-default-excludes} option
to go ahead and export these special symbols. This is only meaningful
when @code{--export-all-symbols} is used.
@item -S @var{path}
@itemx --as @var{path}
Specifies the path, including the filename, of the assembler to be used
to create the exports file.
@item -f SWITCHES
@itemx --as-flags SWITCHES
@item -f @var{switches}
@itemx --as-flags @var{switches}
Specifies any specific command line switches to be passed to the
assembler when building the exports file. This option will work even if
the @samp{-S} option is not used. This option only takes one argument,
@@ -2193,15 +2223,15 @@ occurrences will override earlier occurrences. So if it is necessary to
pass multiple switches to the assembler they should be enclosed in
double quotes.
@item -D NAME
@itemx --dll-name NAME
@item -D @var{name}
@itemx --dll-name @var{name}
Specifies the name to be stored in the .def file as the name of the DLL
when the @samp{-e} option is used. If this option is not present, then
the filename given to the @samp{-e} option will be used as the name of
the DLL.
@item -m MACHINE
@itemx -machine MACHINE
@item -m @var{machine}
@itemx -machine @var{machine}
Specifies the type of machine for which the library file should be
built. @code{dlltool} has a built in default type, depending upon how
it was created, but this option can be used to override that. This is