binutils: def file format
1
1 14.1 The format of the 'dlltool' '.def' file
1 ============================================
1
1 A '.def' file contains any number of the following commands:
1
1 'NAME' NAME '[ ,' BASE ']'
1 The result is going to be named NAME'.exe'.
1
1 'LIBRARY' NAME '[ ,' BASE ']'
1 The result is going to be named NAME'.dll'. Note: If you want to
1 use LIBRARY as name then you need to quote. Otherwise this will
1 fail due a necessary hack for libtool (see PR binutils/13710 for
1 more details).
1
1 'EXPORTS ( ( (' NAME1 '[ = ' NAME2 '] ) | ( ' NAME1 '=' MODULE-NAME '.' EXTERNAL-NAME ') ) [ == ' ITS_NAME ']'
1 '[' INTEGER '] [ NONAME ] [ CONSTANT ] [ DATA ] [ PRIVATE ] ) *'
1 Declares NAME1 as an exported symbol from the DLL, with optional
1 ordinal number INTEGER, or declares NAME1 as an alias (forward) of
1 the function EXTERNAL-NAME in the DLL. If ITS_NAME is specified,
1 this name is used as string in export table. MODULE-NAME. Note:
1 The 'EXPORTS' has to be the last command in .def file, as keywords
1 are treated - beside 'LIBRARY' - as simple name-identifiers. If
1 you want to use LIBRARY as name then you need to quote it.
1
1 'IMPORTS ( (' INTERNAL-NAME '=' MODULE-NAME '.' INTEGER ') | [' INTERNAL-NAME '= ]' MODULE-NAME '.' EXTERNAL-NAME ') [ == ) ITS_NAME ] *'
1 Declares that EXTERNAL-NAME or the exported function whose ordinal
1 number is INTEGER is to be imported from the file MODULE-NAME. If
1 INTERNAL-NAME is specified then this is the name that the imported
1 function will be referred to in the body of the DLL. If ITS_NAME is
1 specified, this name is used as string in import table. Note: The
1 'IMPORTS' has to be the last command in .def file, as keywords are
1 treated - beside 'LIBRARY' - as simple name-identifiers. If you
1 want to use LIBRARY as name then you need to quote it.
1
1 'DESCRIPTION' STRING
1 Puts STRING into the output '.exp' file in the '.rdata' section.
1
1 'STACKSIZE' NUMBER-RESERVE '[, ' NUMBER-COMMIT ']'
1 'HEAPSIZE' NUMBER-RESERVE '[, ' NUMBER-COMMIT ']'
1 Generates '--stack' or '--heap' NUMBER-RESERVE,NUMBER-COMMIT in the
1 output '.drectve' section. The linker will see this and act upon
1 it.
1
1 'CODE' ATTR '+'
1 'DATA' ATTR '+'
1 'SECTIONS (' SECTION-NAME ATTR' + ) *'
1 Generates '--attr' SECTION-NAME ATTR in the output '.drectve'
1 section, where ATTR is one of 'READ', 'WRITE', 'EXECUTE' or
1 'SHARED'. The linker will see this and act upon it.
1