📄 tlink.txt
字号:
seeks pages for loading based on this alignment value. The default is
/A:9, which means sections are aligned on 512-byte boundaries within
the executable file.
/B: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 /B:0x10000.
/c (case sensitivity) makes the case significant in public and
external symbols.
/C (case sensitivity) makes the case significant in the EXPORTS and
IMPORTS sections in module-definition files.
/d (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).
/Enn (maximum errors) specifies the maximum number of errors the
linker reports before terminating. /E0 (the default) reports an
infinite number of errors (that is, as many as possible).
/E (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 /E option. Avoid using /E 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.
/e (ignore extended dictionaries) ignores extended dictionaries. This
is the opposite of the /E option, and is the default.
/f (inhibit far optimizations) inhibits the optimization of far calls
to near data.
/Gx (Goodies) are options where x can be
n = Discard nonresident name table. (16-bit only)
r = Transfer resident names to nonresident table. (16-bit only)
m = (TLINK32) Put mangled names in map file; this can help you
identify how names are mangled.
/i (uninitialized trailing segments) outputs uninitialized trailing
segments into the executable file even if the segments don't contain
data records.
/l (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 /x to suppress map file
creation, the /l (lowercase L) option has no effect.
/L (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:\mylibs splash logo,,,utils .\logolib
first searches the current directory for UTILS.LIB, then searches
C:\BC4\LIB, then C:\MYLIBS. Because @WORD(LOGOLIB) explicitly names
the current directory, TLINK doesn't search the libraries specified
with the /L option to find LOGOLIB.LIB.
/m (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 (/m, /s,
or /x), then the option Map File|Segments is used. See also /s.
/M (map mangled) maps with mangled public names.
/n (ignore default libraries) ignores default libraries specified by
some compilers. Use this option when linking modules that are written
in another language.
/o (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 /o- 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 number.
/P (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 /P=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. /P- 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).
/s (detailed segment map) creates a map file with the same features as
the /m option, but adds a detailed segment map. If you don't specify
map file options (/m, /s, or /x), then the option Map File|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.
Field Value Description
----- ----- -----------
The A field (alignment) 00 An absolute segment.
20 A byte-aligned segment.
40 A word-aligned segment.
60 A paragraph-aligned segment.
80 A page-aligned segment.
A0 An unnamed absolute portion of
storage.
The B field (big) 00 Segment less than 64K.
02 Segment exactly 64K.
The C field (combination) 00 Cannot be combined.
08 A public combining segment.
With the /s 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 Symbol1 and Symbol3 aren't
referenced by the image being linked:
0002:00000874 Idle Symbol1
0002:00000CE4 Symbol2
0002:000000E7 Idle Symbol3
/S:xxxxxx (stack size) sets the application stack size in hexadecimal
where xxxxxx is a hexadecimal string. Specifying the stack size with
/S overrides any stack size setting in a module-definition file.
/Tdx (DOS target) produces a DOS .EXE (/Tde) file.
/Tpx (protected target) produces a protected mode .EXE (/Tpe) or .DLL
file (/Tpd).
/Twx (target type) produces a Windows .EXE (/Twe) or .DLL file (/Twd).
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.
/v (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 /v+
and /v- options to selectively enable or disable debugging information
on a module-by-module basis (but not on the same command line as /v).
For example, the command
TLINK mod1 /v+ mod2 mod3 /v- mod4
includes debugging information for modules mod2 and mod3, but not for
mod1 and mod4.
/wxxx (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):
Option Description
------ -----------
bdl Using based linking in DLLs (might cause the DLL to
malfunction)
def No .DEF file; using defaults
dpl Warn duplicate symbol in .LIB
dup Duplicate symbol (warning for .OBJs)
ent No entry point
imt Import doesn't match previous definition
srf Self-relative fixup overflowed
/x (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|Segments option, which has no command-line option, is on by
default).
/ye (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:
o /ye or /ye+ enables expanded memory swapping (this is the
default).
o ye- disables expanded memory swapping (this is off by default).
/yx (extended memory) controls TLINK's use of extended memory for I/O
buffering. By default, TLINK can use up to 8MB of extended memory. You
can change TLINK's use of extended memory with one of the following
forms of this option:
o /yx+ uses all available extended memory up to 8MB.
o /yxn uses only up to n KB extended memory.
Module-definition file reference
================================
This section describes module-definition files and the statements that
appear in them. A module-definition file provides information to TLINK
about the contents and system requirements of a Windows application.
More specifically, a module-definition file does the following:
o Names the .EXE or .DLL.
o Identifies the application type.
o Lists imported and exported functions.
o Describes the code and data segment attributes, and lets you
specify attributes for additional code and data segments.
o Specifies the size of the stack.
o Provides for the inclusion of a stub program.
CODE statement
--------------
CODE defines the default attributes of code segments. Code segments
can have any name, but must belong to segment classes whose name ends
in CODE (such as CODE or MYCODE). The syntax is:
TLINK TLINK32
CODE [FIXED|MOVEABLE] [PRELOAD|LOADONCALL]
[DISCARDABLE|NONDISCARDABLE] [EXECUTEONLY|EXECUTEREAD]
[PRELOAD|LOADONCALL]
o 'FIXED' (the default) means the segment remains at a fixed
memory location; 'MOVEABLE' means the segment can be moved.
o 'PRELOAD' means code is loaded when the calling program is
loaded. 'LOADONCALL' (the default) means the code is loaded
when called by the program.
o 'DISCARDABLE' means the segment can be discarded if it is no
longer needed (this implies MOVABLE). 'NONDISCARDABLE' (the
default) means the segment can't be discarded.
o 'EXECUTEONLY' means a code segment can only be executed.
'EXECUTEREAD' (the default) means the code segment can be
read and executed.
o 'PRELOAD' means the segment is loaded when the module is first
loaded. 'LOADONCALL' (the default) means the segment is loaded
when called.
DATA statement
--------------
DATA defines attributes of data segments. The syntax is:
DATA [NONE | SINGLE | MULTIPLE]
[READONLY | READWRITE]
[PRELOAD | LOADONCALL]
[SHARED | NONSHARED]
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -