XLINK.EXE, the macOS Linker
Go Up to Command-Line Utilities Index
XLINK.EXE is the command-line interface of XLINK, the C++ linker for macOS.
Contents
Command Line Help
C:\>xlink Turbo Incremental Link 1.00 Copyright (c) 1997-2011 {{Company}} Technologies, Inc. Syntax: ILINK objfiles, exefile, mapfile, libfiles, deffile, resfiles @xxxx indicates use response file xxxx General Options: -Af:nnnn Specify file alignment -C Clear state before linking -Ao:nnnn Specify object alignment -wxxx Warning control -ax Specify application type -Enn Max number of errors -b:xxxx Specify image base addr -r Verbose linking -Txx Specify output file type -q Suppress banner -H:xxxx Specify heap reserve size -c Case sensitive linking -Hc:xxxx Specify heap commit size -v Full debug information -S:xxxx Specify stack reserve size -Gn No state files -Sc:xxxx Specify stack commit size -Gi Generate import library -Vd.d Specify Windows version -GD Generate .DRC file -Dstring Set image description Map File Control: -Vd.d Specify subsystem version -M Map with mangled names -Ud.d Specify image user version -m Map file with publics -GC Specify image comment str -s Detailed segment map -GF Set image flags -x No map -Gl Static package Paths: -Gpd Design time only package -I Intermediate output dir -Gpr Runtime only package -L Specify library search paths -GS Set section flags -j Specify object search paths -Gt Fast TLS Image Control: -Gz Do image checksum -d Delay load a .DLL -Rr Replace resources
Output Generation
The -Txx
option family can be used to control the output generation:
Option | Command |
---|---|
|
Generate Mach dylib. |
|
Generate Mach executable. |
|
Generate Mach package. |
Library Specification
The XLINK library search path can be controlled with the following options:
Option | Description |
---|---|
|
Specifies the logical root directory: |
|
Specifies the remote library paths. Paths specified with |
|
Specifies the local library search paths. |
You can interleave the -L
and -Fp
options.
Framework Specification
Use the -Ff
option to link a particular framework.
Option | Description |
---|---|
|
Instructs XLINK to link the specified framework. For example, to link the Carbon framework, write |
|
Instructs BCCOSX to link the specified framework. The framework names specified in this way are redirected to XLINK using the |
In a RAD Studio project, the frameworks can be specified in the SDK Manager panel (edit the SDK remote paths).
Executable Header Parameters
A macOS dynamic library has an associated install name (or ld name). This is a string embedded in the .dylib file that represents the path of the .dylib file. For example, the install name of CoreServices is /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
. When building a macOS executable file or dynamic library that relies on CoreServices, XLINK inserts a record with the install name information of CoreServices in the binary image.
A macOS binary image contains a header with load-time parameters. Some of these parameters include dynamic library paths that might be unknown at link-time. Such paths can be patched, but this can be problematic if the linker does not reserve sufficient space in the image header. To specify the number of additional bytes to reserve, you can use the -Gr
option.