Linker and librarian

Contents

1. Command line format
1.1. Options
1.2. Name mangling
2. Linker options
2.1. BASE
2.2. DEBUG
2.3. DEBUGTYPE
2.4. DLL
2.5. ENTRY
2.6. EXPORT
2.7. FINAL
2.8. FORCE
2.9. MAP
2.10. NOLOGO
2.11. OUT
2.12. SUBSYSTEM
2.13. VERBOSE
3. Librarian options
3.1. EXPORT
3.2. IMPORT
3.3. NOLOGO
3.4. OUT
3.5. SPLIT

1. Command line format

The utilities support the same command line format: after the name of the utility you can specify any number of options and file names in any order using space or tab as a delimiter. File names with spaces should be enclosed in double quotes. The file names can be also specified using wildcards. An argument starting with symbol '@' is interpreted as 'response file name'. The response file is a standard text file every line of which should be one option or one file name.

1.1. Options

The linker and the librarian use the same rules to elaborate options:

1.2. Name mangling

The linker and the librarian do not support any conventions about name mangling so you must use the exact form of the name. For example, if you want to create a DLL using Microsoft run-time libraries you have to use __DllMainCRTStartup@12 instead of _DllMainCRTStartup as it is described in the Microsoft technical documentation.

2. Linker options

This part describes the linker options.

2.1. BASE

Syntax
/BASE:address
Description
The option sets a base address for the output executable image. The default location for the .EXE file is 0x400000 and for the .DLL file is 0x10000000. The option can be useful for advanced users only.

2.2. DEBUG

Syntax
/DEBUG
Description
This option stores debugging information for the .EXE or the .DLL file. The information can be used by the Visual Eiffel debugger only, unless DEBUGTYPE option is specified

2.2. DEBUGTYPE

Syntax
/DEBUGTYPE:CV
Description
This option allows to store source lines debugging information in the format that can be used under MS debugger. Has no effect, if DEBUG option is not specified

2.4. DLL

Syntax
/DLL
Description
This option builds a DLL file instead of an EXE file. To produce a DLL the linker invokes librarian to process the export symbols described in the command line.

2.5. ENTRY

Syntax
/ENTRY:symbol
Description
This option sets an entry point for an .EXE or a .DLL file.

2.6. EXPORT

Syntax
/EXPORT:symbol
Description
The option sets the name of the export symbol of your program.

2.7. FINAL

Syntax
/FINAL
Description
When this option is set the linker removes unreachable code from the output image and compacts it by merging sections of the same type into the corresponding single section

2.8. FORCE

Syntax
/FORCE
Description
This option tells the linker to create a target file even if some errors occur during the linking process. A file created with this option may not run as expected.

2.9. MAP

Syntax
/MAP[:filename]
Description
This option tells the linker to create a .MAP file. By default the name of the .MAP file coinsides with the name of the executable module. To override the default name of the file, specify the preferred name after a semicolon.

2.10. NOLOGO

Syntax
/NOLOGO
Description
This option suppresses an output of the copyright and version message.

2.11. OUT

Syntax
/OUT:filename
Description
The option overrides the default name and location of the linker target file.

2.12. SUBSYSTEM

Syntax
/SUBSYSTEM:{CONSOLE|WINDOWS}
Description
This option tells the linker how to describe the target application: as a character-mode application (CONSOLE - this is a default) or as a non-console application (WINDOWS).

2.13. VERBOSE

Syntax
/VERBOSE
Description
The option tells the linker to display details about the linking process.

3. Librarian options

3.1. EXPORT

Syntax
/EXPORT:symbol
Description
The option sets the name of the export symbol for the program.

3.2. IMPORT

Syntax
/IMPORT:symbol
Description
The option is used to build an import library. This option sets the name of the import symbol that must be included in the import library.

3.3. NOLOGO

Syntax
/NOLOGO
Description
This option suppresses an output of the copyright and version message.

3.4. OUT

Syntax
/OUT:filename
Description
The option overrides the default name and location of the librarian target file. The filename is used as a base name for all possible target files (as example, for both export and import libraries).

3.5. SPLIT

Syntax
/SPLIT
Description
The option tells the librarian to split the library into the object files. Every such a file has the name mmb1.obj, mmb2.obj,... and corresponds to one library member. In addition, the file with extension .lst is created that can be used as a catalog of all the above files.

Copyright © Object Tools -- info@object-tools.com
Last updated: 2005/02/02 11:51:35