• Keine Ergebnisse gefunden

TLINK options

Im Dokument or an (Seite 160-167)

Unless otherwise specified, options work with both TLINK and TLINK32.

Options are case-sensitive and must be preceded by either a slash (I) or a hyphen (-). To turn off a default option, place a hyphen after the option at the command-line (for example, -P- or IP-). You can place options

anywhere in the command line. You don't need spaces after options (lmlflc is the same as 1m If Ic), but you must separate options and files with a space.

Table 9.3 lists the TLINK command-line options and the IDE equivalent options (note that not all command-line options have an IDE equivalent).

Command-line default options are marked by a bullet (.). A more detailed explanation of options, including the IDE option names, follows the table.

Table 9.3: TLiNK options

Default Option IDE Linker option For Description

13 Linkerl16-bit LinkerlEnable 32-bit processing 16-bit Accepts and links 32-bit code produced by TASM or a compatible assembler.

lax 32-bit Specifies application type, where

Target AttributeslTarget Model laa targets Windows applications

<none> lap targets console applications.

IA:dd 16-bitlSegment Alignment 16/32-bit Specifies page alignment within .EXE file.

IB:xxxxxx 32-bit Linkerllmage based address 32-bit Specifies image base address (in hexadecimal).

Ic GeneraliCase-sensitive link 16/32-bit Treats case as significant in symbols.

Table 9.3: TLINK options (continued)

Ie General/Case-sensitive exports, imports 16-bit Treats case as significant in EXPORTS and IMPORTS section of module-definition file.

Id WarningslWarn duplicate symbol in .LlB 16-bit Warns you if there are duplicate symbols in libraries.

IE 16-bit LinkerlProcess extended dictionaries 16-bit Enables processing of extended dictionaries in libraries.

IEnn 32-bit LinkerlMaximum linker errors 32-bit Specifies maximum errors before termination.

Ie 16-bitiProcess extended dictionaries (uncheck) 16-bit Ignores extended dictionaries in libraries.

This is the opposite of the IE option.

If 16-bit Linkerllnhibit optimizing far to near 16-bit Inhibits optimization of far calls to near data.

IGx 16/32-bit "Goodies" options where x is n, r, or m.

IGn 16-bit LinkerlDiscard nonresident name table 16-bit Discard nonresident name table.

IGr 16-bitiTransfer re$ident to nonresident table 16-bit Transfer Resident names to nonresident names table.

IGm Map FilelPrint mangled names in map file 16/32-bit Put Mangled names in map file.

n

16-bit Linkerllnitialize segments 16-bit Initializes all segments.

II Map Filellnclude source line numbers 16-bit Includes source line numbers (lowercase L).

IL DirectorieslLibrary (not under Linker in /DE) 16/32-bit Specifies library search paths.

1m Map FilelPublic 16/32-bit Creates map file with publics.

In General/Default Libraries 16-bit Don't use default libraries.

10 Overlay module (Node attributes dialog box) 16-bit Overlays modules or libraries.

IP General/Pack code segments 16-bit Packs code segments.

IRk ResourcelPack fast load area (not under. Linkef) 16-bit Sends options to RLlNK.EXE.

IRv <none> 32-bit Verbose resource binding.

IRexxxx <none> 32-bit Renames the executable to xxxx.

IS:xxxxxx 32-bit LinkerlStack size 32-bit Specifies stack size (in hexadecimal).

Is Map FilelDetailed 16-bit Creates detailed map of segments.

It <none> 16-bit Creates a tiny-model DOS .COM file.

ITdx 16-bit Specifies application target, where

<none> ITde means build a DOS .COM file.

TargetExpert Platform ITde means build a DOS .EXE file.

ITpx TargetExpert Platform 32-bit Specifies application target, where

ITpe means build a 32-bit .EXE file.

ITpd means build a 32-bit DLL.

ITwx TargetExpert Target Type 16-bit Specifies Windows 3.x target application, where

ITwe builds a Windows .EXE file.

ITwd builds a Windows DLL.

Iv Generalllnciude debug information 16/32-bit Includes full symbolic debug information.

Iwxxx Warnings (see page 153 for information) 32-bh Enable or disable warnings (see page 153).

Ix Map FilelOff < 16/32-bit Doesn't create a map file.

lye <none> 16-bit Uses expanded memory for swapping.

Iyx <none> 16-bit Configures TLlNK's use of extended

memory swapping.

148 Borland C++ Users Guide

13 (32-bit code) lets you link 32-bit DOS object modules produced by TASM or a compatible assembler. This option increases the memory requirements for TLINK and slows down linking.

la (application type) lets you specify the type of EXE image:

./aa targets Windows applications .

• lap targets console applications that can be run in a window.

IA:dd (align pages) specifies page alignment for code and data within the executable file where dd must be a decimal power of 2. For example, if you specify an alignment value of IA:12, the sections in the image are stored on 4096-byte boundaries. The operating system seeks pages for loading based on this alignment value. The default is IA:9, which means sections are aligned on 512-byte boundaries within the executable file.

IB:xxxxxx (base address) specifies an image base address for an application. If this option is used, internal fixups are removed from the image, and the requested load address of the first object is set to the hexadecimal number given with the option. All successive objects are aligned on 64K linear address boundaries. This option makes applications smaller on disk, and improves both load-time and run-time performance since the operating system no longer has to apply internal fixups. Because NT loads all .EXE images at 64K, you're advised to link all .EXEs with IB:Ox10000.

Ic (case sensitivity) makes the case significant in public and external symbols.

Ie (case sensitivity) makes the case significant in the EXPORTS and IMPORTS sections in module-definition files.

Id (duplicate symbols) warns you if a symbol appears in more than one library file. If the symbol must be included in the program, TLINK uses the symbol from the first file containing the symbol that is specified on the command line (or in a response file). This option also warns you if symbols appear in both an .OBJ file and a .LIB file (TLINK uses the first one linked in and ignores the others).

IEnn (maximum errors) specifies the maximum number of errors the linker reports before terminating. lEO (the default) reports an infinite number of errors (that is, as many as possible).

IE (extended dictionaries) processes extended dictionaries. The library files in Borland C++ contain an extended dictionary with information that lets TLINK use less memory and link faster with those libraries. You can add the extended dictionary to other library files using TLIB's IE option (see the

150

TLIB section on page 170). Avoid using IE with programs linked with libraries that have been built without an extended dictionary (third-party libraries that have been provided without source code, for example). To use extended dictionaries, all linked libraries must have extended dictionaries.

Ie (ignore extended dictionaries) ignores extended dictionaries. This is the opposite of the IE option, and is the default.

If (inhibit far optimizations) inhibits the optimization of far calls to near data.

IGx (Goodies) are options where x can be n

=

Discard nonresident name table.

r = Transfer resident names to nonresident table.

m = (TLINK32) Put mangled names in map file; this can help you identify how names are mangled.

Ii (uninitialized trailing segments) outputs uninitialized trailing segments into the executable file even if the segments don't contain data records.

II (line numbers) creates a section in the .MAP file for source-code line numbers. Linked .OBJ files must be compiled with debug information using -y or -v. If you use Ix to suppress map file creation, the II (lowercase L) option has no effect.

IL (library search paths) lets you list directories for TLINK to search if you don't type an explicit path for a library or the C or C++ initialization module. TLINK searches the current directory first (where you typed TLINK). For example,

TLINK /Lc:\BC4\lib;c:\rnylibs splash logo",utils .\logolib

first searches the current directory for UTILS.LIB, then searches C: \ BC4 \ LIB, then C: \MYLIBS. Because LOGOLIB explicitly names the current directory, TLINK doesn't search the libraries specified with the IL option to find LOGOLIB. LIB.

1m (detailed map file) creates a more complete map than TLINK normally does by adding a list of sorted public symbols to the map file. This kind of map file is useful in debugging. Many debuggers can use the list of public symbols, which lets you refer to symbolic addresses when you're

debugging. If you don't specify map file options (1m, Is, or Ix), then the option Map File I Segments is used. See also Is.

1M (map mangled) maps with mangled public names.

Borland C++ Users Guide

In (ignore default libraries) ignores default libraries specified by some com-pilers. Use this option when linking modules that are written in another language.

/0 (overlays) overlays code in all the modules or libraries that follow the option on the command line (this option works for DOS applications only).

Use /0- on the command line to turn off overlays. If you specify a class name after this option, all the segments in that class are overlaid (you can do this for multiple classes). If you don't specify any name after this option, all segments of classes ending with CODE are overlaid. This option uses the default overlay interrupt number of 3FH. To specify a different interrupt number, use /o#xx, where xx is a two-digit hexadecimal numbet:

IP (pack code segments) combines as many code segments as possible in one physical segment up to (and never greater than) the code-segment packing limit. TLINK starts a new segment if it needs to. The default code-segment packing limit is 8,192 bytes (8K). To change it, use jP=n where n specifies the number of bytes between 1 and 65,536. You would probably want the limit to be a multiple of 4K under 386 enhanced mode because of the paging granularity of the system.

Although the optimum segment size in 386 enhanced mode is 4K, the default code-segment packing size is 8K because typical code segments are from 4K to 8K and 8K might pack more efficiently.

Because each maintained segment has some system overhead, code-segment packing typically increases performance. IP-turns off code-segment packing (useful if you've turned it on in the configuration file and want to disable it for a particular link).

Is (detailed segment map) creates a map file with the same features as the 1m option, but adds a detailed segment map. If you don't specify map file options (1m, Is, or Ix), then the option Map File I Segments is used. For each segment in each module, this map file includes the address, length in bytes, class, segment name, group, module, and ACBP information. If the same segment appears in more than one module, each module appears as a separate line. Except for the ACBP field, the information in the detailed segment map is self-explanatory.

The ACBP field encodes the A (alignment), C (combination), and B (big) attributes into a set of four bit fields, as defined by Intel. TLINK uses only three of the fields, the A, C, and B fields. The ACBP value in the map is printed in hexadecimal. The following values of the fields must be OR' ed together to arrive at the ACBP value printed.

152

Field Value Description

The A field (alignment) 00

The C field (combination) 00 08 The B field (big) 00 02

An absolute segment.

A byte-aligned segment.

A word-aligned segment.

A paragraph-aligned segment.

A page-aligned segment.

An unnamed absolute portion of storage.

Cannot be combined.

A public combining segment.

Segment less than 64K.

Segment exactly 64K.

With the Is option, public symbols with no references are flagged "idle."

An idle symbol is a publicly-defined symbol in a module that wasn't referenced by an EXTDEF record by any other module included in the link.

For example, this fragment from the public symbol section of a map file indicates that symbols Symboll and Symbo13 aren't referenced by the image being linked:

IS:xxxxxx (stack size) sets the application stack size in hexadecimal where xxxxxx is a hexadecimal string. Specifying the stack size with IS overrides any stack size setting in a module-definition file.

It (tiny model DOS .COM file) creates a DOS tiny-model.COM file (this option works the same as fTdc, except you can use It with BCC.EXE). DOS .COM files can't exceed 64K in size, have segment-relative fixups, or define a stack segment. They must have a starting address of 0:100H. If you change the file extension (to .BIN, for example), the starting address can be either 0:0 or 0:100H. The linker can't generate debugging information for .COM files, so you'll need to debug it as an .EXE, then recompile and link as a .COM file.

fTdx(DOS target) produces a DOS .EXE (fTde) or a DOS .COM (fTdc) file.

fTpx(protected target) produces a protected mode .EXE (fTpe) or .DLL file (fTpd).

fTwx (target type) produces a Windows .EXE (fTwe) or .DLL file (fTwd).

This option isn't necessary if you include a module-definition file with an EXETYPE Windows statement because TLINK creates an application (.EXE) if the module-definition file has a NAME statement or a DLL if the

module-definition file has a LIBRARY statement.

Borland C++ Users Guide

Iv (debugging information) includes debugging information in the executable file. If this option is found anywhere on the command line, debugging information is included in the executable file for all object modules that contain debugging information. You can use the Iv+ and Iv-options to selectively enable or disable debugging information on a module-by-module basis (but not on the same command line as Iv). For example, the command

TLINK modi /Vt mod2 mod3 /v- mod4

includes debugging information for modules mod2 and mod3; but not for modl and mod4.

Iwxxx (warning control) turns on (/wxxx) or off (/w-xxx) TLINK warnings, where xxx can be one of the following (defaults mean TLINK will send the warning without you specifically turning it on):

Table 9.4

TLlNK32 warnings Default Iwoption IDE description

---.---b~d-I---U-s-in-g-b-as-e-d-lin-k-in-g-in-D-L-Ls-(~m-ig-ht-c-a-us-e-th-e-D-L-L-to-m-a-If~un-c-tio-n~)----• •

def No .DEF file; using defaults dpl Warn duplicate symbol in .LlB dup Duplicate symbol (warning for .OBJs) ent No entry point

imt Import doesn't match previous definition inq Extern not qualified with _ jmport srf Self-relative fixup overflowed

"No stack" warning

Ix (no map file) tells TLINK to not generate a map file. TLINK usually creates map files that list segments in the program, the program start address, and any TLINK warning or error messages (the Map File I Segments option, which has no command-line option, is on by default).

lye (expanded memory) controls TLINK's use of expanded memory for I/O buffering. If TLINK needs more memory for active data structures (while reading object files or writing the executable file), it either clears buffers or swaps them to expanded memory.

When reading files, TLINK clears the input buffer so that its space can be used for other data structures. When creating an executable, it writes the buffer to its correct place in the executable file. In both cases, you can substantially increase the link speed by swapping to expanded memory. By default, swapping to expanded memory is enabled, and swapping to extended memory is disabled. If swapping is enabled and no appropriate memory exists in which to swap, then swapping doesn't occur.

This option has several forms, shown below

• lye or Iye+ enables expanded memory swapping (this is the default).

• ye-disables expanded memory swapping (this is off by default).

Iyx (extended memory) controls TLINKs use of extended memory for I/O buffering. By default, TLINK can use up to BMB of extended memory. You can change TLINK's use of extended memory with one of the following forms of this option:

./yx+ uses all available extended memory up to 8MB .

• /yxn uses only up to n KB extended memory.

Im Dokument or an (Seite 160-167)