ld-classic(1)
๐ NAME ๐
okay so bestie, this is ld-classic(1) โ the linker. Thatโs the whole name. We are in the General Commands Manual corner of the universe and yes, itโs giving iconic build-tool energy already ๐
โจ
โจ SYNOPSIS โจ
ld-classic files... [options] [-o outputfile]
๐ DESCRIPTION ๐
The ld-classic command combines several object files and libraries, resolves references, and produces an output file. Slay. ld-classic can produce a final linked image (executable, dylib, or bundle), or with the -r option, produce another object file. If the -o option is not used, the output file produced is named a.out.
๐ Universal ๐
The linker accepts universal (multiple-architecture) input files, but always creates a "thin" (single-architecture), standard Mach-O output file. The architecture for the output file is specified using the -arch option. If this option is not used, ld-classic attempts to determine the output architecture by examining the object files in command line order. The first "thin" architecture determines that of the output file. If no input object file is a "thin" file, the native 32-bit architecture for the host is used.
Usually, ld-classic is not used directly. Instead the compiler driver invokes ld-classic. The compiler driver can be passed multiple -arch options and it will create a universal final linked image by invoking ld-classic multiple times and then running lipo(1) to merge the outputs into a universal file. bestie behavior fr fr ๐ฆ
๐ธ Layout ๐ธ
The object files are loaded in the order in which they are specified on the command line. The segments and the sections in those segments will appear in the output file in the order they are encountered in the object files being linked. All zero fill sections will appear after all non-zero fill sections in their segments.
๐ Libraries ๐
A static library (aka static archive) is a collection of .o files with a table of contents that lists the global symbols in the .o files. ld-classic will only pull .o files out of a static library if needed to resolve some symbol reference. Unlike traditional linkers, ld-classic will continually search a static library while linking. There is no need to specify a static library multiple times on the command line. obsessed with the efficiency, honestly โจ
A dynamic library (aka dylib or framework) is a final linked image. Putting a dynamic library on the command line causes two things: 1) The generated final linked image will have encoded that it depends on that dynamic library. 2) Exported symbols from the dynamic library are used to resolve references.
Both dynamic and static libraries are searched as they appear on the command line.
๐ง Search paths ๐ง
ld-classic maintains a list of directories to search for a library or framework to use. The default library search path is /usr/lib then /usr/local/lib. The -L option will add a new library search path. The default framework search path is /Library/Frameworks then /System/Library/Frameworks. (Note: previously, /Network/Library/Frameworks was at the end of the default path. If you need that functionality, you need to explicitly add -F/Network/Library/Frameworks). The -F option will add a new framework search path. The -Z option will remove the standard search paths. The -syslibroot option will prepend a prefix to all search paths.
๐ Two-level namespace ๐
By default all references resolved to a dynamic library record the library to which they were resolved. At runtime, dyld uses that information to directly resolve symbols. The alternative is to use the -flat_namespace option. With flat namespace, the library is not recorded. At runtime, dyld will search each dynamic library in load order when resolving symbols. This is slower, but more like how other operating systems resolve symbols. not the vibe for speed, but sometimes you need it ๐
๐ Indirect dynamic libraries ๐
If the command line specifies to link against dylib A, and when dylib A was built it linked against dylib B, then B is considered an indirect dylib. When linking for two-level namespace, ld does not look at indirect dylibs, except when re-exported by a direct dylibs. On the other hand when linking for flat namespace, ld does load all indirect dylibs and uses them to resolve references. Even though indirect dylibs are specified via a full path, ld-classic first uses the specified search paths to locate each indirect dylib. If one cannot be found using the search paths, the full path is used.
๐ซถ Dynamic libraries undefines ๐ซถ
When linking for two-level namespace, ld-classic does not verify that undefines in dylibs actually exist. But when linking for flat namespace, ld-classic does check that all undefines from all loaded dylibs have a matching definition. This is sometimes used to force selected functions to be loaded from a static library.
๐ OPTIONS ๐
๐ Options that control the kind of output ๐
-executeโ The default. Produce a mach-o main executable that has file typeMH_EXECUTE.-dylibโ Produce a mach-o shared library that has file typeMH_DYLIB.-bundleโ Produce a mach-o bundle that has file typeMH_BUNDLE.-rโ Merges object files to produce another mach-o object file with file typeMH_OBJECT.-dylinkerโ Produce a mach-o dylinker that has file typeMH_DYLINKER. Only used when building dyld.-dynamicโ The default. Implied by-dylib,-bundle, or-execute-staticโ Produces a mach-o file that does not use the dyld. Only used building the kernel.-preloadโ Produces a mach-o file in which themach_header, load commands, and symbol table are not in any segment. This output type is used for firmware or embedded development where the segments are copied out of the mach-o into ROM/Flash.-arch arch_nameโ Specifies which architecture (e.g.ppc,ppc64,i386,x86_64) the output file should be.-o pathโ Specifies the name and location of the output file. If not specified,a.outis used.
๐ง Options that control libraries ๐ง
-lxโ This option tells the linker to search forlibx.dyliborlibx.ain the library search path. If stringxis of the formy.o, then that file is searched for in the same places, but without prependinglibor appending.aor.dylibto the filename.-needed-lxโ This is the same as the-lxbut means to really link with the dylib even if no symbols are used from it. Thus, it can be used to suppress warnings about unused dylibs.-reexport-lxโ This is the same as the-lxbut specifies that all symbols in libraryxshould be available to clients linking to the library being created. This was previously done with a separate-sub_libraryoption.-upward-lxโ This is the same as the-lxbut specifies that the dylib is an upward dependency.-hidden-lxโ This is the same as the-lxfor locating a static library, but treats all global symbols from the static library as if they are visibility hidden. Useful when building a dynamic library that uses a static library but does not want to export anything from that static library.-weak-lxโ This is the same as the-lxbut forces the library and all references to it to be marked as weak imports. That is, the library is allowed to be missing at runtime.-needed_library path_to_dylibโ This is the same as placingpath_to_dylibon the link line but means to really link with the dylib even if no symbols are used from it. Thus, it can be used to suppress warnings about unused dylibs.-reexport_library path_to_libraryโ This is the same as listing a file name path to a library on the link line and it specifies that all symbols in library path should be available to clients linking to the library being created. This was previously done with a separate-sub_libraryoption.-upward_library path_to_libraryโ This is the same as listing a file name path to a library on the link line but also marks the dylib as an upward dependency.-weak_library path_to_libraryโ This is the same as listing a file name path to a library on the link line except that it forces the library and all references to it to be marked as weak imports.-Ldirโ Adddirto the list of directories in which to search for libraries. Directories specified with-Lare searched in the order they appear on the command line and before the default search path. In Xcode4 and later, there can be a space between the-Land directory.-Zโ Do not search the standard directories when searching for libraries and frameworks.-syslibroot rootdirโ Prependrootdirto all search paths when searching for libraries or frameworks.-search_paths_firstโ This is now the default (in Xcode4 tools). When processing-lxthe linker now searches each directory in its library search paths forlibx.dylibthenlibx.abefore moving on to the next path in the library search path.-search_dylibs_firstโ Changes the searching behavior for libraries. The default is that when processing-lxthe linker searches each directory in its library search paths forlibx.dylibthenlibx.a. This option changes the behavior to first search for a file of the formlibx.dylibin each directory in the library search path, then a file of the formlibx.ais searched for in the library search paths. This option restores the search behavior of the linker prior to Xcode4.-framework name[,suffix]โ This option tells the linker to search forname.framework/namein the framework search path. If the optional suffix is specified the framework is first searched for the name with the suffix and then without (e.g. look forname.framework/name_suffixfirst, if not there tryname.framework/name).-needed_framework name[,suffix]โ This is the same as the-framework name[,suffix]but means to really link with the framework even if no symbols are used from it. Thus, it can be used to suppress warnings about unused dylibs.-weak_framework name[,suffix]โ This is the same as the-framework name[,suffix]but forces the framework and all references to it to be marked as weak imports. Note: due to a clang optimization, if functions are not marked weak, the compiler will optimize out any checks if the function address isNULL.-reexport_framework name[,suffix]โ same energy as-framework name[,suffix], but it also says that all symbols in that framework should be available to clients linking to the library being created ๐ This used to be done with a separate-sub_umbrellaoption.-upward_framework name[,suffix]โ same as-framework name[,suffix], but it also tells the linker that the framework is an upward dependency ๐ฆ-Fdirโ addsdirto the list of directories where the linker searches for frameworks. Directories you specify with-Fget searched in the order they appear on the command line, and before the default search path. In Xcode4 and later, there can be a space between the-Fand directory โจ-all_loadโ loads all members of static archive libraries. all of them. no skips ๐-ObjCโ loads all members of static archive libraries that implement an Objective-C class or category ๐-force_load path_to_archiveโ loads all members of the specified static archive library. Note:-all_loadforces all members of all archives to be loaded; this option lets you target one specific archive ๐ฏ-load_hidden path_to_archiveโ uses the specified static library as usual, but treats all global symbols from that static library as if they are visibility hidden. Useful when you're building a dynamic library that uses a static library but does not want to export anything from that static library ๐-image_suffix suffixโ searches for libraries and frameworks withsuffixfirst, and then without it ๐
๐งฉ Options that control additional content
-sectcreate segname sectname fileโ creates the sectionsectnamein the segmentsegnamefrom the contents offile. If there's already a section(segname,sectname)from any other input, the linker will append the content fromfileto that section ๐งต-add_empty_section segname sectnameโ makes an empty section namedsectnamein the segmentsegname. If any of the inputs contains a section(segname,sectname), that section will be included in the output, and this option will be ignored ๐ซถ-add_ast_path fileโ the linker will add anN_ASTstab symbol to the output file where the string is the path pointed to byfileand its value is the modification time of the file โฐ-filelist file[,dirname]โ tells the linker to link the files listed infile. This is an alternative to listing the files on the command line. The file names are listed one per line, separated only by newlines. (Spaces and tabs are assumed to be part of the file name.) If the optional directory namedirnameis specified, it is prepended to each name in the list file ๐-dtrace fileโ enables dtrace static probes when producing a final linked image. Thefilemust be a DTrace script which declares the static probes ๐ฌ
โก Options that control optimizations
-dead_stripโ removes functions and data that are unreachable by the entry point or exported symbols ๐-order_file fileโ alters the order in which functions and data are laid out. For each section in the output file, any symbol in that section that's specified in the order filefileis moved to the start of its section and laid out in the same order as in the order filefile. Order files are text files with one symbol name per line. Lines starting with a#are comments. A symbol name may be optionally preceded with its object file leaf name and a colon (e.g.foo.o:_foo). This is useful for static functions/data that occur in multiple files. A symbol name may also be optionally preceded with the architecture (e.g.ppc:_fooorppc:foo.o:_foo). This enables you to have one order file that works for multiple architectures. Literal c-strings may be ordered by quoting the string (e.g."Hello, world\n") in the order file ๐๏ธ-no_order_initsโ when the-order_fileoption is not used, the linker lays out functions in object file order and it moves all initializer routines to the start of the__textsection and terminator routines to the end. Use this option to disable the automatic rearrangement of initializers and terminators ๐ โโ๏ธ-platform_version platform min_version sdk_versionโ this is set to indicate the platform, the oldest supported version of that platform that the output is to be used on, and the SDK that the output was built against.platformis a numeric value as defined in<mach-o/loader.h>, or it may be one of the following strings:macosiostvoswatchosbridgeosmac-catalystios-simulatortvos-simulatorwatchos-simulatordriverkit
Specifying a newer min or SDK version enables the linker to assume features of that OS or SDK in the output file. The format of min_version and sdk_version is a version number such as 10.13 or 10.14 ๐
-macos_version_min versionโ this is set to indicate the oldest macOS version that the output is to be used on. Specifying a later version enables the linker to assume features of that OS in the output file. The format ofversionis a macOS version number such as10.9or10.14๐-ios_version_min versionโ this is set to indicate the oldest iOS version that the output is to be used on. Specifying a later version enables the linker to assume features of that OS in the output file. The format ofversionis an iOS version number such as3.1or4.0๐ฑ-image_base addressโ specifies the preferred load address for a dylib or bundle. The argumentaddressis a hexadecimal number with an optional leading0x. By choosing non-overlapping addresses for all dylibs and bundles that a program loads, launch time can be improved because dyld will not need to "rebase" the image (that is, adjust pointers within the image to work at the loaded address). It is often easier to not use this option, but instead use therebase(1)tool, and give it a list of dylibs. It will then choose non-overlapping addresses for the list and rebase them all. When building a position independent executable, this option will be ignored. This option is also called-seg1addrfor compatibility ๐-no_implicit_dylibsโ when creating a two-level namespace final linked image, normally the linker will hoist up public dylibs that are implicitly linked to make the two-level namespace encoding more efficient for dyld. For example, Cocoa re-exports AppKit and AppKit re-exports Foundation. If you link with-framework Cocoaand use a symbol from Foundation, the linker will implicitly add a load command to load Foundation and encode the symbol as coming from Foundation. If you use this option, the linker will not add a load command for Foundation and encode the symbol as coming from Cocoa. Then at runtime dyld will have to search Cocoa and AppKit before finding the symbol in Foundation ๐-no_zero_fill_sectionsโ by default the linker moves all zero fill sections to the end of the__DATAsegment and configures them to use no space on disk. This option suppresses that optimization, so zero-filled data occupies space on disk in a final linked image ๐พ-merge_zero_fill_sectionsโ causes all zero-fill sections in the__DATAsegment to be merged into one__zerofillsection ๐งผ-no_branch_islandsโ disables linker creation of branch islands, which allows images to be created that are larger than the maximum branch distance. Useful with-preloadwhen code is in multiple sections but all are within the branch range ๐
๐ง Options when creating a dynamic library (dylib)
-install_name nameโ sets an internal "install path" (LC_ID_DYLIB) in a dynamic library. Any clients linked against the library will record that path as the way dyld should locate this library. If this option is not specified, then the-opath will be used. This option is also called-dylib_install_namefor compatibility ๐ท๏ธ-mark_dead_strippable_dylibโ specifies that the dylib being built can be dead strip by any client. That is, the dylib has no initialization side effects. So if a client links against the dylib, but never uses any symbol from it, the linker can optimize away the use of the dylib โ๏ธ-compatibility_version numberโ specifies the compatibility version number of the library. When a library is loaded by dyld, the compatibility version is checked and if the program's version is greater than the library's version, it is an error. The format ofnumberisX[.Y[.Z]]whereXmust be a positive non-zero number less than or equal to65535, and.Yand.Zare optional and if present must be non-negative numbers less than or equal to255. If the compatibility version number is not specified, it has a value of0and no checking is done when the library is used. This option is also called-dylib_compatibility_versionfor compatibility ๐งธ-current_version numberโ specifies the current version number of the library. The current version of the library can be obtained programmatically by the user of the library so it can determine exactly which version of the library it is using. The format ofnumberisX[.Y[.Z]]whereXmust be a positive non-zero number less than or equal to65535, and.Yand.Zare optional and if present must be non-negative numbers less than or equal to255. If the version number is not specified, it has a value of0. This option is also called-dylib_current_versionfor compatibility ๐
๐ Options when creating a main executable ๐
-pieโ makes a special kind of main executable that's position independent, aka a PIE โจ. On Mac OS X 10.5 and later, the OS will load a PIE at a random address every single time it gets executed. Iconic security behavior honestly. But โ you cannot create a PIE from.ofiles compiled with-mdynamic-no-pic, so heads up. That means the codegen is less optimal, but the address randomization adds some security. And when targeting Mac OS X 10.7 or later, PIE is the default for main executables ๐ .-no_pieโ do not make a position independent executable (PIE). This is the default when targeting 10.6 and earlier. Old school vibes ๐ซถ.-pagezero_sizesize โ by default the linker creates an unreadable segment starting at address zero named__PAGEZERO. Its whole existence will cause a bus error if a NULL pointer gets dereferenced โ it's literally there to catch you ๐ญ. The argument size is a hexadecimal number with an optional leading0x. If size is zero, the linker will not generate a page zero segment at all. Defaults: on 32-bit architectures the page zero size is 4KB, and on 64-bit architectures the default size is 4GB. Big mood, big page ๐.implicit_pagezeroโ when used on main executables, it omits the__PAGEZEROsegment and relies on the loader blocking out low memory instead. Leaning on the loader, respectfully ๐.-stack_sizesize โ specifies the maximum stack size for the main thread in a program. Without this option a program has a 8MB stack. The argument size is a hexadecimal number with an optional leading0x, and it should be a multiple of the architecture's page size (4KB or 16KB) โญ.-allow_stack_executeโ marks the executable so that all stacks in the task get stack execution privilege. This includes pthread stacks, fr fr. This option is only valid when targeting architectures that support stack execution (i.e. Intel) ๐ง.-export_dynamicโ preserves all global symbols in main executables during LTO. Without this option, Link Time Optimization is allowed to inline and remove global functions โ which is exactly the drama this prevents. This option is used when a main executable may load a plug-in which requires certain symbols from the main executable. Plug-in support, we love to see it ๐.
๐ฆ Options when creating a bundle ๐ฆ
-bundle_loaderexecutable โ this specifies the executable that will be loading the bundle output file being linked. Undefined symbols from the bundle are checked against the specified executable like it was one of the dynamic libraries the bundle was linked with. Basically the bundle gets to borrow its friend's symbol table ๐.
๐ธ Options when creating an object file ๐ธ
-keep_private_externsโ don't turn private external (akavisibility=hidden) symbols into static symbols, but rather leave them as private external in the resulting object file. Keep them exactly as they are, no notes ๐.-dโ force definition of common symbols. That is, transform tentative definitions into real definitions. Tentative no more, bestie โ it's committing โจ.
๐ Options that control symbol resolution ๐
-exported_symbols_listfilename โ the specified filename contains a list of global symbol names that will remain as global symbols in the output file. All other global symbols will be treated as if they were marked as__private_extern__(akavisibility=hidden) and will not be global in the output file. The symbol names listed in filename must be one per line. Leading and trailing white space are not part of the symbol name. Lines starting with#are ignored, as are lines with only white space. Some wildcards (similar to shell file matching) are supported: the*matches zero or more characters, the?matches one character,[abc]matches one character which must be an'a','b', or'c', and[a-z]matches any single lower case letter from'a'to'z'๐.-exported_symbolsymbol โ the specified symbol is added to the list of global symbol names that will remain as global symbols in the output file. This option can be used multiple times. For short lists, this can be more convenient than creating a file and using-exported_symbols_list๐.-no_exported_symbolsโ useful for main executables that don't have plugins and thus need no symbol exports. No plugins, no problems ๐ .-unexported_symbols_listfile โ the specified filename contains a list of global symbol names that will not remain as global symbols in the output file. The symbols will be treated as if they were marked as__private_extern__(akavisibility=hidden) and will not be global in the output file. The symbol names listed in filename must be one per line. Leading and trailing white space are not part of the symbol name. Lines starting with#are ignored, as are lines with only white space. Some wildcards (similar to shell file matching) are supported: the*matches zero or more characters, the?matches one character,[abc]matches one character which must be an'a','b', or'c', and[a-z]matches any single lower case letter from'a'to'z'โญ.-unexported_symbolsymbol โ the specified symbol is added to the list of global symbol names that will not remain as global symbols in the output file. This option can be used multiple times. For short lists, this can be more convenient than creating a file and using-unexported_symbols_list๐ซถ.-reexported_symbols_listfile โ the specified filename contains a list of symbol names that are implemented in a dependent dylib and should be re-exported through the dylib being created. Sharing the wealth, we stan ๐ธ.-aliassymbol_name alternate_symbol_name โ creates an alias named alternate_symbol_name for the symbol symbol_name. By default the alias symbol has global visibility. This option was previously the-idef:indiroption, fyi ๐.-alias_listfilename โ the specified filename contains a list of aliases. The symbol name and its alias are on one line, separated by whitespace. Lines starting with#are ignored.-flat_namespaceโ alters how symbols are resolved at build time and runtime. With-two_levelnamespace(the default), the linker only searches dylibs on the command line for symbols, and records in which dylib they were found. With-flat_namespace, the linker searches all dylibs on the command line and all dylibs those original dylibs depend on. The linker does not record which dylib an external symbol came from, so at runtime dyld again searches all images and uses the first definition it finds. In addition, any undefines in loadedflat_namespacedylibs must be resolvable at build time. It's giving chaos but make it deterministic ๐.-usymbol_name โ specifies that symbol symbol_name must be defined for the link to succeed. This is useful to force selected functions to be loaded from a static library. Required means required ๐ฅ.-Usymbol_name โ specifies that it's ok for symbol_name to have no definition. With-two_levelnamespace, the resulting symbol will be markeddynamic_lookupwhich means dyld will search all loaded images. No definition? No stress ๐.-undefinedtreatment โ specifies how undefined symbols are to be treated. Options are:error,warning,suppress, ordynamic_lookup. The default iserror. Note:dynamic_lookupthat depends on lazy binding will not work with chained fixups โ ๏ธ.-rpathpath โ adds path to the runpath search path list for the image being created. At runtime, dyld uses the runpath when searching for dylibs whose load path begins with@rpath/. Path list glow-up ๐.-commonstreatment โ specifies how commons (aka tentative definitions) are resolved with respect to dylibs. Options are:ignore_dylibs,use_dylibs,error. The default isignore_dylibswhich means the linker will turn a tentative definition in an object file into a real definition and not even check dylibs for conflicts โ it simply does not look ๐. Theuse_dylibsoption means the linker should check linked dylibs for definitions and use them to replace tentative definitions from object files. Theerroroption means the linker should issue an error whenever a tentative definition in an object file conflicts with an external symbol in a linked dylib. See also-warn_commonsโจ.
๐ฅ Options for introspecting the linker ๐ฅ
-why_loadโ logs why each object file in a static library is loaded. That is, what symbol was needed. Also called-whyloadfor compatibility. Detective mode activated ๐ต๏ธ.-why_livesymbol_name โ logs a chain of references to symbol_name. Only applicable with-dead_strip. It can help debug why something that you think should be dead strip removed is not removed ๐ญ. See-exported_symbols_listfor syntax and use of wildcards.-print_statisticsโ logs information about the amount of memory and time the linker used. Receipts, basically ๐งพ.-tโ logs each file (object, archive, or dylib) the linker loads. Useful for debugging problems with search paths where the wrong library is loaded. Wrong library jumpscare prevention ๐.-order_file_statisticsโ logs information about the processing of a-order_file.-mapmap_file_path โ writes a map file to the specified path which details all symbols and their addresses in the output image. The whole map, no gatekeeping ๐บ๏ธ.
๐ Options for controlling symbol table optimizations ๐
-Sโ do not put debug information (STABS or DWARF) in the output file. Slimming it down ๐ .-xโ do not put non-global symbols in the output file's symbol table. Non-global symbols are useful when debugging and getting symbol names in back traces, but are not used at runtime. If-xis used with-r, non-global symbol names are not removed, but instead replaced with a unique, dummy name that will be automatically removed when linked into a final linked image. This allows dead code stripping, which uses symbols to break up code and data, to work properly and provides the security of having source symbol names removed. Dummy names are the ultimate undercover mission ๐ถ๏ธ.-non_global_symbols_strip_listfilename โ the specified filename contains a list of non-global symbol names that should be removed from the output file's symbol table. All other non-global symbol names will remain in the output file's symbol table. See-exported_symbols_listfor syntax and use of wildcards ๐.-non_global_symbols_no_strip_listfilename โ bestie, this file is a list of non-global symbol names that should remain in the output file's symbol table. Every other symbol name gets removed from that table. For the syntax and wildcard lore, see-exported_symbols_list. ๐-oso_prefixprefix-path โ when the linker generates the debug map, it removes this prefix-path from the path in OSO symbols. Why? So build servers can generate identical binaries. If'.'is passed as the argument, the linker expands it to the current working directory. โจ
โจ Options for Bitcode build flow โจ
-bitcode_bundleโ generates an embedded bitcode bundle in the output binary, and it lives in the__LLVM, __bundlesection. Big caveat: this option requires all the object files, static libraries and user frameworks/dylibs contain bitcode. Also note: not all the linker options are supported to use together with-bitcode_bundle. ๐ญ-bitcode_hide_symbolsโ use this together with-bitcode_bundleto hide all non-exported symbols from the output bitcode bundle. Heads up: the hide symbol process might not be reversible. To obtain a reverse mapping file to recover all the symbols, use the-bitcode_symbol_mapoption. ๐ซถ-bitcode_symbol_mappath โ sets the output for the bitcode symbol reverse mapping (.bcsymbolmap). If path is an existing directory,UUID.bcsymbolmapwill be written to that directory. Otherwise, the reverse map will be written to a file at path. ๐
โจ Rarely used Options โจ
@response_file_pathโ inserts the contents of the file at response_file_path into the arguments. This lets linker command line args be stored in a file. Important note:ldis normally invoked throughclang, andclangalso interprets@fileon the command line. To haveclangignore the@fileand pass it through told, use-Wl,@file. ๐-vโ prints the version of the linker. Simple, iconic, does what it says. โญ-adhoc_codesignโ directs the linker to add an ad-hoc codesignature to the output file. The default for Apple Silicon binaries is to be ad-hoc codesigned. ๐-no_adhoc_codesignโ directs the linker to not add an ad-hoc codesignature to the output file, even for Apple Silicon binaries. ๐-data_constโ by default the linker moves some data sections into__DATA_CONSTif it knows the target OS version supports that. This option overrides the default behavior and forces the use of__DATA_CONST. ๐-no_data_constโ by default the linker moves some data sections into__DATA_CONSTif it knows the target OS version supports that. This option overrides the default behavior and forces the linker to never move sections to__DATA_CONST. ๐ซ-const_selrefsโ by default the linker moves the__objc_selrefssection into__DATA_CONSTif it knows the target OS version supports that. This option overrides the default behavior and forces__objc_selrefsbeing in__DATA_CONST. Note this only applies if the__DATA_CONSTsegment is enabled. See-data_constfor more information. ๐ฆ-no_const_selrefsโ by default the linker moves the__objc_selrefssection into__DATA_CONSTif it knows the target OS version supports that. This option overrides the default behavior and keeps the__objc_selrefssection in__DATA. ๐ธ-version_detailsโ prints the version info about the linker in JSON. It's giving structured data realness. ๐-no_weak_importsโ error if any symbols are weak imports (i.e. allowed to be unresolved (NULL) at runtime). Useful for config based projects that assume they are built and run on the same OS version. โ ๏ธ-no_deduplicateโ don't run the deduplication pass in the linker. No cap, sometimes you just don't want the linker touching your duplicate-looking stuff. ๐ง-verbose_deduplicateโ prints names of functions that are eliminated by deduplication and total code savings size. Receipts! ๐งพ-no_initsโ error if the output contains any static initializers. ๐-no_warn_initsโ do not warn if the output contains any static initializers. ๐ซถ-debug_variantโ do not warn about issues that are only problems for binaries shipping to customers. It's the "we're not shipping this yet" vibe check. ๐-unaligned_pointerstreatment โ specifies how unaligned pointers in__DATAsegments should be handled. Options are:'warning','error', or'suppress'. The default forarm64eis'error'and for all other architectures it is'suppress'. ๐-dirty_data_listfilename โ specifies a file containing the names of data symbols likely to be dirtied. If the linker is creating a__DATA_DIRTYsegment, those symbols will be moved to that segment. ๐งผ-max_default_common_alignvalue โ any common symbols (aka tentative definitions, or uninitialized (zeroed) variables) that have no explicit alignment are normally aligned to their next power of two size (e.g. a240byte array is256aligned). This option lets you reduce the max alignment. For instance, a value of0x40would reduce the alignment for a240byte array to64bytes (instead of256). The value specified must be a hexadecimal power of two. If-max_default_common_alignis not used, the default alignment is already limited to0x8(2^3) bytes for-preloadand0x8000(2^15) for all other output types. ๐ข-move_to_rw_segmentsegment_name filename โ moves data symbols to another segment. The command line option specifies the target segment name and a path to a file containing a list of symbols to move. Comments can be added to the symbol file by starting a line with a#. If there are multiple instances of a symbol name (for instance a"static int foo=5;"in multiple files) the symbol name in the symbol list file can be prefixed with the object file name (e.g."init.o:_foo") to move a specific instance. ๐-move_to_ro_segmentsegment_name filename โ moves code symbols to another segment. The command line option specifies the target segment name and a path to a file containing a list of symbols to move. Comments can be added to the symbol file by starting a line with a#. If there are multiple instances of a symbol name (for instance a"static int foo() {}"in multiple files) the symbol name in the symbol list file can be prefixed with the object file name (e.g."init.o:_foo") to move a specific instance. ๐ง-rename_sectionorgSegment orgSection newSegment newSection โ renames sectionorgSegment/orgSectiontonewSegment/newSection. Glow-up but for sections. ๐ซ-rename_segmentorgSegment newSegment โ renames all sections with theorgSegmentsegment name to have thenewSegmentsegment name. Periodt. ๐-trace_symbol_layoutโ for use in debugging-rename_section,-rename_segment,-move_to_ro_segment, and-move_to_rw_segment. This option prints out a line showing where and why each symbol was moved. Note: these options do chain. For each symbol, the linker first checks-move_to_ro_segmentand-move_to_rw_segment. Next it applies any-rename_sectionoptions, and lastly the-rename_segmentoptions. ๐-section_ordersegname colon_separated_section_list โ only for use with-preload. Specifies the order that sections with the specified segment should be laid out. For example:-section_order __ROM __text:__const:__cstring. ๐งธ-segment_ordercolon_separated_segment_list โ only for use with-preload. Specifies the order segments should be laid out. For example:-segment_order __ROM:__ROM2:__RAM. ๐ฏ-allow_heap_executeโ normallyi386main executables will be marked so that the Mac OS X 10.7 and later kernel will only allow pages with the x-bit to execute instructions. This option overrides that behavior and allows instructions on any page to be executed. ๐ฅ-application_extensionโ specifies that the code is being linked for use in an application extension. The linker will then validate that any dynamic libraries linked against are safe for use in application extensions. ๐ง-no_application_extensionโ specifies that the code being linked is not safe for use in an application extension. For instance, can be used when creating a framework that should not be used in an application extension. ๐ โโ๏ธ-fatal_warningsโ causes the linker to exit with a non-zero value if any warnings were emitted. Warnings said "bestie, this is serious." ๐-no_eh_labelsโ normally in-rmode, the linker produces.ehlabels on all FDEs in the__eh_framesection. This option suppresses those labels. Those labels are not needed by the Mac OS X 10.6 linker but are needed by earlier linker tools. ๐-warn_compact_unwindโ when producing a final linked image, the linker processes the__eh_framesection and produces an__unwind_infosection. Most FDE entries in the__eh_framecan be represented by a32-bitvalue in the__unwind_infosection. The option issues a warning for any function whose FDE cannot be expressed in the compact unwind format. ๐ญ-warn_weak_exportsโ issue a warning if the resulting final linked image contains weak external symbols. Such symbols requiredyldto do extra work at launch time to coalesce those symbols. ๐ซถ-no_weak_exportsโ issue an error if the resulting final linked image contains weak external symbols. Such symbols requiredyldto do extra work at launch time to coalesce those symbols. ๐จ-warn_unused_dylibsโ warn about dylibs that are linked but no symbols are used from them. ๐-no_warn_unused_dylibsโ don't warn about dylibs that are linked but no symbols are used from them. ๐คซ-dead_strip_dylibsโ remove dylibs that are unreachable by the entry point or exported symbols. That is, suppresses the generation of load command commands for dylibs which supplied no symbols during the link. Do not use this when linking against a dylib which is required at runtime for some indirect reason such as the dylib has an important initializer. โ ๏ธ-allow_sub_type_mismatchesโ okay so normally the linker is super strict about ARM cpu-subtypes (likearmv4tvsarmv6) and treats them as different different architectures that literally cannot be mixed at build time ๐ but this flag relaxes that whole requirement so you can mix object files compiled for different ARM subtypes. bestie it's giving "i trust you to know what you're doing" energy โจ-no_uuidโ do not generate anLC_UUIDload command in the output file. > โ ๏ธ be warned bestie: binaries without UUIDs may cause the debugger and crash reporting tools to be unable to track and inspect the binary. like they just can't find it ๐ญ it's giving ghosted.-random_uuidโ generates a randomLC_UUIDload command in the output file. by default the linker generates the UUID of the output file based on a hash of the output file's content. but for very large output files, that hash can slow down the link ๐ using a hash based UUID is important for reproducible builds, but if you're just doing rapid debug builds, using-random_uuidmay improve turn around time. slay for speed, lowkey chaos for reproducibility ๐-root_safeโ sets theMH_ROOT_SAFEbit in the mach header of the output file. that's it, that's the whole vibe โจ-setuid_safeโ sets theMH_SETUID_SAFEbit in the mach header of the output file. another one-bit icon ๐-interposableโ indirects access to all exported symbols when creating a dynamic library. every single one, no cap ๐ซถ-initsymbol_name โ the specified symbol_name will be run as the first initializer. only used when creating a dynamic library. first!! main character energy fr fr ๐-sub_librarylibrary_name โ the specified dylib will be re-exported. for example the library_name for/usr/lib/libobjc_profile.A.dylibwould belibobjc. only used when creating a dynamic library. see how it drops all the extra bits? that's the trick ๐-sub_umbrellaframework_name โ the specified framework will be re-exported. only used when creating a dynamic library. umbrella term for umbrella framework, iykyk โ๏ธ-allowable_clientname โ restricts what can link against the dynamic library being created. by default any code can link against any dylib, but if a dylib is supposed to be private to a small set of clients, you can formalize that by adding a-allowable_clientfor each client. if a client islibfoo.1.dylibits-allowable_clientname would be"foo". if a client isFoo.frameworkits-allowable_clientname would be"Foo". for the degenerate case where you want no one to ever link against a dylib, you can set the-allowable_clientto"!". not"!"being the ultimate "you're not on the list" ๐๐-client_namename โ enables a bundle to link against a dylib that was built with-allowable_client. the name specified must match one of the-allowable_clientnames specified when the dylib was created. it's giving VIP guest list and you better have the right name ๐๏ธ-umbrellaframework_name โ specifies that the dylib being linked is re-exported through an umbrella framework of the specified name. ๐-headerpadsize โ specifies the minimum space for future expansion of the load commands. only useful if intend to runinstall_name_toolto alter the load commands later. size is a hexadecimal number. future-proofing queen ๐-headerpad_max_install_namesโ automatically adds space for future expansion of load commands such that all paths could expand toMAXPATHLEN. only useful if intend to runinstall_name_toolto alter the load commands later. same energy, but it just maxes everything out for you, no maths required โจ-bind_at_loadโ sets a bit in the mach header of the resulting binary which tells dyld to bind all symbols when the binary is loaded, rather than lazily. eager beaver behavior and honestly? relatable ๐-force_flat_namespaceโ sets a bit in the mach header of the resulting binary which tells dyld to not only use flat namespace for the binary, but force flat namespace binding on all dylibs and bundles loaded in the process. can only be used when linking main executables. it's giving "if i'm flat, everyone's flat" ๐ค-sectalignsegname sectname value โ the section named sectname in the segment segname will have its alignment set to value, where value is a hexadecimal number that must be an integral power of 2. so2,4,8,16โฆ not you trying to sneak in a3๐-stack_addraddress โ specifies the initial address of the stack pointer value, where value is a hexadecimal number rounded to a page boundary. (yes bestie, the page says value here โ we keep it exactly as written ๐)-segprotsegname max_prot init_prot โ specifies the maximum and initial virtual memory protection of the named segment, name, to be max and init, respectively. the values for max and init are any combination of the characters`r'(for read),`w'(for write),`x'(for execute) and`-'(no access). mix and match like your fave playlist ๐ง-seg_addr_tablefilename โ specifies a file containing base addresses for dynamic libraries. each line of the file is a hexadecimal base address followed by whitespace then the install name of the corresponding dylib. the#character denotes a comment. yes, hash comments, we stan a config file that lets us leave notes ๐๏ธ-segs_read_write_addraddress โ allows a dynamic library to be built where the read-only and read-write segments are not contiguous. the address specified is a hexadecimal number that indicates the base address for the read-write segments. breaking up with contiguity, it's not them it's us ๐-segs_read_only_addraddress** โ allows a dynamic library to be built where the read-only and read-write segments are not contiguous. the address specified is a hexadecimal number that indicates the base address for the read-only segments. the other half of the situationship ๐ซถ-segaddrname address โ specifies the starting address of the segment named name to be address. the address must be a hexadecimal number that is a multiple of 4K page size. 4K page size or it's a no from me ๐ซ-seg_page_sizename size โ specifies the page size used by the specified segment. by default the page size is4096for all segments. the linker will lay out segments such that size of a segment is always an even multiple of its page size. math is mathing, that's the whole point ๐-dylib_fileinstall_name:file_name โ specifies that a dynamic shared library is in a different location than its standard location. use this option when you link with a library that is dependent on a dynamic library, and the dynamic library is in a location other than its default location. install_name specifies the path where the library normally resides. file_name specifies the path of the library you want to use instead. for example, if you link to a library that depends upon the dynamic librarylibsysand you havelibsysinstalled in a nondefault location, you would use this option:-dylib_file /lib/libsys_s.A.dylib:/me/lib/libsys_s.A.dylib. it's giving "same library, different address" ๐ โก๏ธ๐ก-prebindโ the created output file will be in the prebound format. this was used in Mac OS X 10.3 and earlier to improve launch performance. vintage!! an elder icon, we respect her history ๐ฐ๏ธ๐-weak_reference_mismatchestreatment โ specifies what to do if a symbol is weak-imported in one object file but not weak-imported in another. the valid *treatment*s are:error,weak, ornon-weak. the default isnon-weak. pick your fighter ๐ฅ-read_only_relocstreatment โ enables the use of relocations which will cause dyld to modify (copy-on-write) read-only pages. the compiler will normally never generate such code. kinda sus ngl, the compiler wouldn't do this on its own ๐ฌ-force_cpusubtype_ALLโ the is only applicable with-arch ppc. it tells the linker to ignore the PowerPC cpu requirements (e.g. G3, G4 or G5) encoded in the object files and mark the resulting binary as runnable on any PowerPC cpu. one binary to rule them all ๐ง (also yes, "the is only applicable" โ that's literally what the page says, we do not edit ๐)-dylinker_install_namepath โ only used when building dyld. that's the whole entry, bestie, short and mysterious ๐ต๏ธโ๏ธ-no_arch_warningsโ suppresses warning messages about files that have the wrong architecture for the-archflag. silence is golden ๐คซ-arch_errors_fatalโ turns into errors, warnings about files that have the wrong architecture for the-archflag. same info, but now it's fatal ๐ plot twist.-esymbol_name โ specifies the entry point of a main executable. by default the entry name is"start"which is found incrt1.owhich contains the glue code need to set up and callmain(). (yes, "need" โ keeping the typo, love that for us ๐ซถ) the entry point is literally the main character of your binary ๐-wโ suppress all warning messages. not me ignoring my problems but make it a compiler flag ๐โจ-final_outputname โ specifies the install name of a dylib if-install_nameis not used. this option is used by compiler driver when it is invoked with multiple-archarguments. backup install name, the understudy of the show ๐ญ-arch_multipleโ specifies that the linker should augment error and warning messages with the architecture name. this option is used by compiler driver when it is invoked with multiple-archarguments. so when something breaks you actually know which arch broke it, iconic ๐-twolevel_namespace_hintsโ specifies that hints should be added to the resulting binary that can help speed up runtime binding by dyld as long as the libraries being linked against have not changed. note the "as long as they haven't changed" โ if they change, the hints are stale, that's the deal bestie ๐-dotpath โ create a file at the specified path containing a graph of symbol dependencies. the.dotfile can be viewed in GraphViz. pretty graph of your dependency drama, obsessed ๐โจ-keep_relocsโ add section based relocation records to a final linked image. these relocations are ignored at runtime by dyld. so they're justโฆ there. decorative. aesthetic relocations ๐-warn_stabsโ print a warning when the linker cannot do aBINCL/EINCLoptimization because the compiler put a bad stab symbol inside aBINCL/EINCLrange. blame the compiler, the linker is just the messenger ๐ข-warn_commonsโ print a warning whenever a tentative definition in an object file is found and a external symbol by the same name is also found in a linked dylib. this often means that theexternkeyword is missing from a variable declaration in a header file. ahh the classic "you forgotextern" moment, we've all been there ๐ญ-read_only_stubsโ [i386 only] makes the__IMPORTsegment of a final linked images read-only. this option makes a program slightly more secure in that theJMPinstructions in the i386 fast stubs cannot be easily overwritten by malicious code. the downside is the dyld must usemprotect()to temporarily make the segment writable while it is binding the stubs. secure but at what cost, the mprotect hustle ๐-slow_stubsโ [i386 only] instead of using singleJMPinstruction stubs, the linker creates code in the__TEXTsegment which calls through a lazy pointer in the__DATAsegment. slow name, but sometimes slow is safe ๐ขโจ-interposable_listfilename โ bestie, this file is literally a list of global symbol names that should always be accessed indirectly. Example time: iflibSystem.dylibis linked so_mallocis interposable, then calls tomalloc()from insidelibSystemgo through a dyld stub and could potentially be redirected to an alternatemalloc. IflibSystem.dylibwere built without making_mallocinterposable, then if_mallocwas interposed at runtime, calls tomallocfrom withinlibSystemwould be missed (not interposed) because they'd be direct calls. ๐ โจ-no_function_startsโ by default the linker creates a compress table of function start addresses in theLINKEDITof the final linked image. This option disables that whole behavior. no cap ๐ซถ-no_objc_category_mergingโ okay so by default, when producing a final linked image, the linker optimizes Objective-C classes by merging any categories on a class into the class. For that optimization to happen, both the class and its categories must be defined in the image being linked. This option disables that behavior. ๐-objc_relative_method_listsโ by default, when producing a final linked image, if you're targeting a new enough OS version, the linker rewrites ObjC method lists from the traditional three pointers to use three read-only delta pointers. This option lets you force the use of relative method lists even though the OS version is too low. slay ๐ฅ-no_objc_relative_method_listsโ same default tea as above: new enough OS version โ ObjC method lists get rewritten from the traditional three pointers to three read-only delta pointers. This option lets you force the use of traditional three-pointer method lists instead. ๐-object_path_ltofilename โ when doing Link Time Optimization (LTO) and a temporary mach-o object file is needed, this option stores the temp file at the specified path and it remains after the link is complete. Without it, the linker picks a path and deletes the object file before the linker tool completes, so tools like the debugger ordsymutilwon't be able to access the DWARF debug info in that temporary object file. ๐ญ important!!-lto_librarypath โ when doing LTO, the linker normally loadslibLTO.dylibrelative to the linker binary (../lib/libLTO.dylib). This option lets you specify the path to a specificlibLTO.dylibto load instead. ๐-cache_path_ltopath โ when doing Incremental Link Time Optimization (LTO), use this directory as a cache for incremental rebuild. ๐ฆ-prune_interval_ltoseconds โ when doing Incremental LTO, the cache gets pruned after the specified interval. A value of0will force pruning to occur, and a value of-1will disable pruning. periodt ๐-prune_after_ltoseconds โ when pruning the cache for Incremental LTO, the cache entries are removed after the specified interval. ๐-max_relative_cache_size_ltopercent โ when doing Incremental LTO, the cache is pruned so it doesn't go over this percentage of the free space. I.e. a value of100would indicate that the cache may fill the disk, and a value of50would indicate that the cache size will be kept under the free disk space. math queen behavior โจ-fixup_chains_sectionโ for use with-staticor-preloadwhen-pieis used. Tells the linker to add a__TEXT,__chain_startssection which starts with adyld_chained_starts_offsetsstruct which specifies the pointer format and the offsets to the start of every fixup chain. iconic ๐ง-fixup_chains_section_vmโ same as-fixup_chains_sectionbut fixes a bug. The offsets in the__chain_startssection are vm-offsets from the__TEXTsegment, and the rebase targets in the chains are vm-offsets. glow-up fix ๐-threaded_starts_sectionโ forarm64eonly. For use with-staticor-preloadwhen-pieis used. Tells the linker to add a__TEXT,__thread_startssection which starts with a 32-bit flag field, followed by an array 32-bit values. Each value is the offset to the start of a fixup chain. This option is deprecated. โ ๏ธ๐-page_align_data_atomsโ during development, this option can be used to space out all global variables so each is on a separate page. It's useful when analyzing dirty and resident pages. That info can then be used to create an order file to cluster commonly used/dirty globals onto the same page(s). iykyk ๐ซถ-not_for_dyld_shared_cacheโ normally, the linker adds extra info to dylibs with-install_namestarting with/usr/libor/System/Library/that allows the dylib to be placed into the dyld shared cache. Adding this option tells the linker to not add that extra info. not me being exclusive ๐-search_in_sparse_frameworksโ for use when linking against versioned frameworks that do not have a normal variant. By default, when-framework Foo,_suffixis used, the linker followsFoo.framework/Fooif it is a symbolic link, appends_suffix, and searches for a file with that path. When this option is used, the linker will also search forFoo.framework/Versions/Current/Foo_suffix. extra search behavior, no cap ๐ฆ-ld_classicโ override the choice of linker, and force the use ofld-classicto link the binary. This is incompatible with options such as-merge*, used to build/merge libraries. main character energy for the classic linker ๐
๐ Obsolete Options ๐
bestie these are giving graveyard era โ they're obsolete, so don't come for me if you try them. ๐๐ชฆ
-segalignvalue โ all segments must be page aligned. โ ๏ธ-seglinkeditโ object files (MH_OBJECT) with aLINKEDITsegment are no longer supported. This option is obsolete. ๐ญ-noseglinkeditโ this is the default. This option is obsolete. ๐-fvmlibโ Fixed VM shared libraries (MH_FVMLIB) are no longer supported. This option is obsolete. ๐ชฆ-sectobjectsymbolssegname sectname โ adding a local label at a section start is no longer supported. This option is obsolete. โจ-nofixprebindingโ theMH_NOFIXPREBINDINGbit ofmach_headershas been ignored since Mac OS X 10.3.9. This option is obsolete. ๐-noprebind_all_twolevel_modulesโ multi-modules in dynamic libraries have been ignored at runtime since Mac OS X 10.4.0. This option is obsolete. ๐ซถ-prebind_all_twolevel_modulesโ multi-modules in dynamic libraries have been ignored at runtime since Mac OS X 10.4.0. This option is obsolete. ๐ซถ-prebind_allow_overlapโ when using-prebind, the linker allows overlapping by default, so this option is obsolete. ๐ญ-noprebindโLD_PREBINDis no longer supported as a way to force on prebinding, so there no longer needs to be a command line way to overrideLD_PREBIND. This option is obsolete. ๐-sect_diff_relocstreatment โ this option was an attempt to warn about linking.ofiles compiled without-mdynamic-no-picinto a main executable, but the false positive rate generated too much noise to make the option useful. This option is obsolete. ๐-run_init_lazilyโ this option was removed in Mac OS X 10.2. ๐ชฆ-single_moduleโ this is now the default so does not need to be specified. โจ-multi_moduleโ multi-modules in dynamic libraries have been ignored at runtime since Mac OS X 10.4.0. This option is obsolete. ๐-no_dead_strip_inits_and_termsโ in the obsolete pile, but the tea is: the linker never dead strips initialization and termination routines. They are considered "roots" of the dead strip graph. ๐ฑ-Abasefile โ obsolete incremental load format. This option is obsolete. ๐ชฆ-bโ bestie this one is doing double duty in the graveyard: used with-Aoption to strip base file's symbols. This option is obsolete. Obsolete option to produce a load map. Use-mapoption instead. ๐-Snโ don't strip any symbols. This is the default. This option is obsolete. ๐-Siโ optimize stabs debug symbols to remove duplicates. This is the default. This option is obsolete. โจ-Spโ write minimal stabs which causes the debugger to open and read the original.ofile for full stabs. This style of debugging is obsolete in Mac OS X 10.5. This option is obsolete. ๐ญ-Xโ strip local symbols that begin withL. This is the default. This option is obsolete. ๐-sโ completely strip the output, including removing the symbol table. This file format variant is no longer supported. This option is obsolete. ๐-mโ don't treat multiple definitions as an error. This is no longer supported. This option is obsolete. ๐-ysymbolโ display each file in which symbol is used. This was previously used to debug where an undefined symbol was used, but the linker now automatically prints out all usages. The-why_liveoption can also be used to display what kept a symbol from being dead stripped. This option is obsolete. ๐ฆ-Ynumber โ used to control how many occurrences of each symbol specified with-ywould be shown. This option is obsolete. ๐-nomultidefsโ only used when linking an umbrella framework. Sets theMH_NOMULTIDEFSbit in themach_header. TheMH_NOMULTIDEFSbit has been obsolete since Mac OS X 10.4. This option is obsolete. ๐ชฆ-multiply_defined_unusedtreatment โ previously provided a way to warn or error if any of the symbol definitions in the output file matched any definitions in dynamic library being linked. This option is obsolete. ๐ญ-multiply_definedtreatment โ previously provided a way to warn or error if any of the symbols used from a dynamic library were also available in another linked dynamic library. This option is obsolete. ๐-private_bundleโ previously prevented errors when-flat_namespace,-bundle, and-bundle_loaderwere used and the bundle contained a definition that conflicted with a symbol in the main executable. The linker no longer errors on such conflicts. This option is obsolete. โจ-noall_loadโ this is the default. This option is obsolete. ๐ซถ-seg_addr_table_filename pathโ use path instead of the libraryโs install name when matching an entry in theseg_addr_table. โ ๏ธ This option is obsolete.-sectorder segname sectname orderfileโ replaced by the more general-order_fileoption. ๐-sectorder_detailโ it produced extra logging about which entries from asectorderwere used. Replaced by-order_file_statistics. ๐ซ This option is obsolete.-lazy_framework name[,suffix]โ same as-framework name[,suffix], except the linker constructs glue code so the framework is not loaded until the first function in it is called. You cannot directly access data or Objective-C classes in a framework linked this way. โ ๏ธ This option is deprecated.-lazy-lxโ same as-lx, but only for shared libraries, and the linker constructs glue code so the shared library is not loaded until the first function in it is called. โ ๏ธ This option is deprecated.-lazy_library path_to_libraryโ same as listing a file name path to a shared library on the link line, except the linker constructs glue code so the shared library is not loaded until the first function in it is called. โ ๏ธ This option is deprecated.
๐ SEE ALSO ๐
Like, go read these too, bestie: ld(1), as(1), ar(1), cc(1), dyld_info(1), nm(1), otool(1), lipo(1), arch(3), dyld(3), Mach-O(5), strip(1), and rebase(1). ๐ซถ
๐ And thatโs a wrap on ld-classic(1), bestie โ source/version Darwin, dated September 10, 2020. Periodt. ๐โจ
๐ฆ where this page comes from
- nixpkgs unstable: ld64 957.1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms