2004-12-07 Randolph Chung <tausq@debian.org>
[deliverable/binutils-gdb.git] / binutils / doc / binutils.texi
index 20132c8165fc9e2f1129f4047d33dd83c7f1b69f..20e06581d60434d1303296ed1f26327d77984753 100644 (file)
@@ -29,8 +29,8 @@ END-INFO-DIR-ENTRY
 
 @ifinfo
 @c man begin COPYRIGHT
-Copyright @copyright{} 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000,
-2001, 2002, 2003, 2004 Free Software Foundation, Inc.
+Copyright @copyright{} 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+2000, 2001, 2002, 2003, 2004 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
@@ -54,8 +54,8 @@ notice identical to this one except for the removal of this paragraph
 @c This file documents the GNU binary utilities "ar", "ld", "objcopy",
 @c  "objdump", "nm", "size", "strings", "strip", "readelf" and "ranlib".
 @c
-@c Copyright (C) 1991, 92, 93, 94, 95, 96, 97, 98, 99, 2000, 2001,
-@c 2002, 2003, 2004 Free Software Foundation, Inc.
+@c Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+@c 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
 @c 
 @c This text may be freely distributed under the terms of the GNU
 @c Free Documentation License.
@@ -80,8 +80,8 @@ notice identical to this one except for the removal of this paragraph
 @end tex
 
 @vskip 0pt plus 1filll
-Copyright @copyright{} 1991, 92, 93, 94, 95, 96, 97, 1998, 2000, 2001,
-2002, 2003, 2004 Free Software Foundation, Inc.
+Copyright @copyright{} 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
+2000, 2001, 2002, 2003, 2004 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
@@ -663,7 +663,7 @@ The @sc{gnu} linker @command{ld} is now described in a separate manual.
 nm [@option{-a}|@option{--debug-syms}] [@option{-g}|@option{--extern-only}]
    [@option{-B}] [@option{-C}|@option{--demangle}[=@var{style}]] [@option{-D}|@option{--dynamic}]
    [@option{-S}|@option{--print-size}] [@option{-s}|@option{--print-armap}]
-   [@option{-A}|@option{-o}|@option{--print-file-name}]
+   [@option{-A}|@option{-o}|@option{--print-file-name}][@option{--special-syms}]
    [@option{-n}|@option{-v}|@option{--numeric-sort}] [@option{-p}|@option{--no-sort}]
    [@option{-r}|@option{--reverse-sort}] [@option{--size-sort}] [@option{-u}|@option{--undefined-only}]
    [@option{-t} @var{radix}|@option{--radix=}@var{radix}] [@option{-P}|@option{--portability}]
@@ -749,7 +749,9 @@ weak object symbol.  When a weak defined symbol is linked with a normal
 defined symbol, the normal defined symbol is used with no error.
 When a weak undefined symbol is linked and the symbol is not defined,
 the value of the symbol is determined in a system-specific manner without
-error.  Uppercase indicates that a default value has been specified.
+error.  On some systems, uppercase indicates that a default value has been 
+specified.
+
 
 @item -
 The symbol is a stabs symbol in an a.out object file.  In this case, the
@@ -879,6 +881,14 @@ value.  If the @code{bsd} output format is used the size of the symbol
 is printed, rather than the value, and @samp{-S} must be used in order 
 both size and value to be printed.
 
+@item --special-syms
+Display symbols which have a target-specific special meaning.  These
+symbols are usually used by the target for some special processing and
+are not normally helpful when included included in the normal symbol
+lists.  For example for ARM targets this option would skip the mapping
+symbols used to mark transistions between ARM code, THUMB code and
+data.
+
 @item -t @var{radix}
 @itemx --radix=@var{radix}
 Use @var{radix} as the radix for printing the symbol values.  It must be
@@ -1495,6 +1505,7 @@ objdump [@option{-a}|@option{--archive-headers}]
         [@option{--prefix-addresses}]
         [@option{--[no-]show-raw-insn}]
         [@option{--adjust-vma=}@var{offset}]
+        [@option{--special-syms}]
         [@option{-V}|@option{--version}]
         [@option{-H}|@option{--help}]
         @var{objfile}@dots{}
@@ -1837,6 +1848,11 @@ meaningful for dynamic objects, such as certain types of shared
 libraries.  This is similar to the information provided by the @samp{nm}
 program when given the @option{-D} (@option{--dynamic}) option.
 
+@item --special-syms
+When displaying symbols include those which the target considers to be
+special in some way and which would not normally be of interest to the
+user.
+
 @item -V
 @itemx --version
 Print the version number of @command{objdump} and exit.
@@ -2838,16 +2854,25 @@ the Info entries for @file{binutils}.
 @end ignore
 
 @node dlltool
-@chapter Create files needed to build and use DLLs
+@chapter dlltool
 @cindex DLL
 @kindex dlltool
 
-@command{dlltool} may be used to create the files needed to build and use
-dynamic link libraries (DLLs).
+@command{dlltool} is used to create the files needed to create dynamic
+link libraries (DLLs) on systems which understand PE format image
+files such as Windows.  A DLL contains an export table which contains
+information that the runtime loader needs to resolve references from a
+referencing program.
+
+The export table is generated by this program by reading in a
+@file{.def} file or scanning the @file{.a} and @file{.o} files which
+will be in the DLL.  A @file{.o} file can contain information in
+special @samp{.drectve} sections with export information.
 
 @quotation
-@emph{Warning:} @command{dlltool} is not always built as part of the binary
-utilities, since it is only useful for those targets which support DLLs.
+@emph{Note:} @command{dlltool} is not always built as part of the
+binary utilities, since it is only useful for those targets which
+support DLLs.
 @end quotation
 
 @c man title dlltool Create files needed to build and use DLLs.
@@ -2890,13 +2915,13 @@ When creating a DLL, along with the source for the DLL, it is necessary
 to have three other files.  @command{dlltool} can help with the creation of
 these files.
 
-The first file is a @samp{.def} file which specifies which functions are
+The first file is a @file{.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 @command{dlltool} can be used
 to create it using the @option{-z} option.  In this case @command{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.
+put entries for them in the @file{.def} file it creates.
 
 In order to mark a function as being exported from a DLL, it needs to
 have an @option{-export:<name_of_function>} entry in the @samp{.drectve}
@@ -2914,12 +2939,12 @@ 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 @option{-e} option to
-@command{dlltool} when it is creating or reading in a .def file. 
+@command{dlltool} when it is creating or reading in a @file{.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 @option{-l} option to dlltool when it
-is creating or reading in a .def file.
+is creating or reading in a @file{.def} file.
 
 @command{dlltool} builds the library file by hand, but it builds the
 exports file by creating temporary files containing assembler statements
@@ -2953,7 +2978,7 @@ The command line options have the following meanings:
 @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.
+Specifies the name of a @file{.def} file to be read in and processed.
 
 @item -b @var{filename}
 @itemx --base-file @var{filename}
@@ -2968,7 +2993,7 @@ Specifies the name of the export file to be created by dlltool.
 
 @item -z @var{filename}
 @itemx --output-def @var{filename}
-Specifies the name of the .def file to be created by dlltool.
+Specifies the name of the @file{.def} file to be created by dlltool.
 
 @item -l @var{filename}
 @itemx --output-lib @var{filename}
@@ -2982,7 +3007,7 @@ option.  You may add to the list of symbols to not export by using the
 @option{--exclude-symbols} option.
 
 @item --no-export-all-symbols
-Only export symbols explicitly listed in an input .def file or in
+Only export symbols explicitly listed in an input @file{.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.
@@ -3018,10 +3043,10 @@ double quotes.
 
 @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 @option{-e} option is used.  If this option is not present, then
-the filename given to the @option{-e} option will be used as the name of
-the DLL.
+Specifies the name to be stored in the @file{.def} file as the name of
+the DLL when the @option{-e} option is used.  If this option is not
+present, then the filename given to the @option{-e} option will be
+used as the name of the DLL.
 
 @item -m @var{machine}
 @itemx -machine @var{machine}
@@ -3042,15 +3067,13 @@ means!
 @itemx --add-underscore
 Specifies that when @command{dlltool} is creating the exports file it
 should prepend an underscore to the names of the exported functions. 
-The option is ignored for symbols with an explicit internal name
-specification provided in a .def file.
 
 @item -k
 @itemx --kill-at
 Specifies that when @command{dlltool} is creating the exports file it
-should not append the string @samp{@@ <number>}  The option is ignored
-for symbols with an explicit internal name specification provided in a
-.def file.
+should not append the string @samp{@@ <number>}.  These numbers are
+called ordinal numbers and they represent another way of accessing the
+function in a DLL, other than by name.
 
 @item -A
 @itemx --add-stdcall-alias
@@ -3111,9 +3134,60 @@ Displays dlltool's version number and then exits.
 
 @c man end
 
+@menu
+* def file format::             The format of the dlltool @file{.def} file
+@end menu
+
+@node def file format
+@section The format of the @command{dlltool} @file{.def} file
+
+A @file{.def} file contains any number of the following commands:
+
+@table @asis
+
+@item @code{NAME} @var{name} @code{[ ,} @var{base} @code{]}
+The result is going to be named @var{name}@code{.exe}.
+
+@item @code{LIBRARY} @var{name} @code{[ ,} @var{base} @code{]}
+The result is going to be named @var{name}@code{.dll}.
+
+@item @code{EXPORTS ( ( (} @var{name1} @code{[ = } @var{name2} @code{] ) | ( } @var{name1} @code{=} @var{module-name} @code{.} @var{external-name} @code{) )}
+@item @code{[} @var{integer} @code{] [ NONAME ] [ CONSTANT ] [ DATA ] [ PRIVATE ] ) *}
+Declares @var{name1} as an exported symbol from the DLL, with optional
+ordinal number @var{integer}, or declares @var{name1} as an alias
+(forward) of the function @var{external-name} in the DLL
+@var{module-name}.
+
+@item @code{IMPORTS ( (} @var{internal-name} @code{=} @var{module-name} @code{.} @var{integer} @code{) | [} @var{internal-name} @code{= ]} @var{module-name} @code{.} @var{external-name} @code{) ) *}
+Declares that @var{external-name} or the exported function whose
+ordinal number is @var{integer} is to be imported from the file
+@var{module-name}.  If @var{internal-name} is specified then this is
+the name that the imported function will be referred to in the body of
+the DLL.
+
+@item @code{DESCRIPTION} @var{string}
+Puts @var{string} into the output @file{.exp} file in the
+@code{.rdata} section.
+
+@item @code{STACKSIZE} @var{number-reserve} @code{[, } @var{number-commit} @code{]}
+@item @code{HEAPSIZE} @var{number-reserve} @code{[, } @var{number-commit} @code{]}
+Generates @code{--stack} or @code{--heap}
+@var{number-reserve},@var{number-commit} in the output @code{.drectve}
+section.  The linker will see this and act upon it.
+
+@item @code{CODE} @var{attr} @code{+}
+@item @code{DATA} @var{attr} @code{+}
+@item @code{SECTIONS (} @var{section-name} @var{attr}@code{ + ) *}
+Generates @code{--attr} @var{section-name} @var{attr} in the output
+@code{.drectve} section, where @var{attr} is one of @code{READ},
+@code{WRITE}, @code{EXECUTE} or @code{SHARED}.  The linker will see
+this and act upon it.
+
+@end table
+
 @ignore
 @c man begin SEEALSO dlltool
-the Info entries for @file{binutils}.
+The Info pages for @file{binutils}.
 @c man end
 @end ignore
 
@@ -3141,8 +3215,8 @@ readelf [@option{-a}|@option{--all}]
         [@option{-A}|@option{--arch-specific}]
         [@option{-D}|@option{--use-dynamic}]
         [@option{-x} <number>|@option{--hex-dump=}<number>]
-        [@option{-w[liaprmfFso]}|
-         @option{--debug-dump}[=line,=info,=abbrev,=pubnames,=ranges,=macro,=frames,=frames-interp,=str,=loc]]
+        [@option{-w[liaprmfFsoR]}|
+         @option{--debug-dump}[=line,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges]]
         [@option{-I}|@option{-histogram}]
         [@option{-v}|@option{--version}]
         [@option{-W}|@option{--wide}]
@@ -3213,8 +3287,8 @@ Display all the headers in the file.  Equivalent to @option{-h -l -S}.
 
 @item -n
 @itemx --notes
-@cindex ELF core notes
-Displays the contents of the NOTE segment, if it exists.
+@cindex ELF notes
+Displays the contents of the NOTE segments and/or sections, if any.
 
 @item -r
 @itemx --relocs
@@ -3259,8 +3333,8 @@ symbols section.
 @itemx --hex-dump=<number>
 Displays the contents of the indicated section as a hexadecimal dump.
 
-@item -w[liaprmfFso]
-@itemx --debug-dump[=line,=info,=abbrev,=pubnames,=ranges,=macro,=frames,=frames-interp,=str,=loc]
+@item -w[liaprmfFsoR]
+@itemx --debug-dump[=line,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=loc,=Ranges]
 Displays the contents of the debug sections in the file, if any are
 present.  If one of the optional letters or words follows the switch
 then only data found in those specific sections will be dumped.
This page took 0.029463 seconds and 4 git commands to generate.