GOLD(1)

πŸ“¦
version 2.42 Β· 5 versions
, in ubuntu noble

🌸 NAME 🌸

okay bestie, gather round, because today we're talking about gold β€” the GNU ELF linker πŸ’–. That's it, that's the whole name. It links your ELF files, it's GNU's take on the job, and it's lowkey the main character of your build pipeline. No cap.


πŸ¦‹ SYNOPSIS πŸ¦‹

the vibe check of how you actually invoke her:

ld.gold [options] file...

so it's just ld.gold, then a bunch of options, then a bunch of files. That's the whole shape of it, periodt ✨.


πŸ‘‘ OPTIONS πŸ‘‘

okay this is the big one, the iconique list, so let's go one by one, no skipping, we keep EVERY detail fr fr 🫢

  • --help β€” shows you the usage info. your "wait what do I type" button πŸŽ€
  • -v, --version β€” spills the version info. iconique behavior honestly.
  • -V β€” version and target info. she's giving extra πŸ’…
  • --add-needed β€” not supported, bestie. don't come for her.
  • --no-add-needed β€” does not copy DT_NEEDED tags from shared libraries (this is the default).
  • --allow-multiple-definition β€” lets symbols be defined multiple times. chaos, but consensual.
  • --no-allow-multiple-definition β€” does not allow multiple definitions (the default).
  • --allow-shlib-undefined β€” allows unresolved references in shared libraries. live a little ✨
  • --no-allow-shlib-undefined β€” does not allow unresolved references in shared libraries (the default).
  • --apply-dynamic-relocs β€” applies link-time values for dynamic relocations (the default).
  • --no-apply-dynamic-relocs β€” (aarch64 only) does not apply link-time values for dynamic relocations.
  • --as-needed β€” uses DT_NEEDED only for the shared libraries that are actually used. minimalism, we love her.
  • --no-as-needed β€” uses DT_NEEDED for all shared libraries (the default).
  • -assert [ignored] β€” literally ignored. she said nothing, she did nothing, she's just there πŸ«₯
  • -b [elf,binary], --format [elf,binary] β€” sets the input format.
  • --be8 β€” outputs a BE8 format image.
  • --build-id [=STYLE] β€” generates a build ID note.
  • --build-id-chunk-size-for-treehash SIZE β€” the chunk size for --build-id=tree.
  • --build-id-min-file-size-for-treehash SIZE β€” minimum output file size for --build-id=tree to work differently than --build-id=sha1.
  • -Bdynamic β€” -l searches for shared libraries (the default).
  • -Bstatic β€” -l does not search for shared libraries.
  • -dy β€” alias for -Bdynamic (the default).
  • -dn β€” alias for -Bstatic.
  • -Bgroup β€” use group name lookup rules for shared library.
  • -Bshareable β€” generate a shared library (alias for -G/-shared).
  • -Bno-symbolic β€” don't bind default visibility defined symbols locally for -shared (the default).
  • -Bsymbolic-functions β€” bind default visibility defined function symbols locally for -shared.
  • -Bsymbolic β€” bind default visibility defined symbols locally for -shared.
  • --check-sections β€” checks segment addresses for overlaps (the default).
  • --no-check-sections β€” does not check segment addresses for overlaps.
  • --compress-debug-sections [none,zlib,zlib-gnu,zlib-gabi,zstd] β€” compresses .debug_* sections in the output file. tiny file, big energy πŸ¦‹
  • --copy-dt-needed-entries β€” not supported.
  • --no-copy-dt-needed-entries β€” do not copy DT_NEEDED tags from shared libraries (the default).
  • --cref β€” outputs a cross reference table.
  • --no-cref β€” does not output a cross reference table (the default).
  • --ctors-in-init-array β€” use DT_INIT_ARRAY for all constructors (the default).
  • --no-ctors-in-init-array β€” handles constructors as directed by the compiler.
  • -d, --define-common β€” defines common symbols.
  • --no-define-common β€” does not define common symbols in relocatable output (the default).
  • -dc β€” alias for -d.
  • -dp β€” alias for -d.
  • --debug [all,files,script,task][,...] β€” turns on debugging. the "why is this happening" switch 😭
  • --defsym SYMBOL=EXPRESSION β€” defines a symbol.
  • --demangle [=STYLE] β€” demangles C++ symbols in log messages so your eyes stop hurting.
  • --no-demangle β€” does not demangle C++ symbols in log messages.
  • --dependency-file FILE β€” writes a dependency file listing all files read.
  • --detect-odr-violations β€” looks for violations of the C++ One Definition Rule.
  • --no-detect-odr-violations β€” does not look for violations of the C++ One Definition Rule (the default).
  • --dynamic-list-data β€” adds data symbols to dynamic symbols.
  • --dynamic-list-cpp-new β€” adds C++ operator new/delete to dynamic symbols.
  • --dynamic-list-cpp-typeinfo β€” adds C++ typeinfo to dynamic symbols.
  • --dynamic-list FILE β€” reads a list of dynamic symbols.
  • --emit-stub-syms β€” (PowerPC only) labels linker stubs with a symbol (the default).
  • --no-emit-stub-syms β€” (PowerPC only) does not label linker stubs with a symbol.
  • -e ADDRESS, --entry ADDRESS β€” sets the program start address.
  • --eh-frame-hdr β€” creates the exception frame header.
  • --no-eh-frame-hdr β€” does not create the exception frame header (the default).
  • --enable-new-dtags β€” enables use of DT_RUNPATH (the default).
  • --disable-new-dtags β€” disables use of DT_RUNPATH.
  • --enable-linker-version β€” puts the linker version string into the .comment section.
  • --disable-linker-version β€” puts the linker version string into the .note.gnu.gold-version section (the default).
  • --no-enum-size-warning β€” (ARM only) does not warn about objects with incompatible enum sizes.
  • --exclude-libs lib,lib ... β€” excludes libraries from automatic export.
  • -E, --export-dynamic β€” exports all dynamic symbols. everyone's invited πŸ’–
  • --no-export-dynamic β€” does not export all dynamic symbols (the default).
  • --export-dynamic-symbol SYMBOL β€” exports SYMBOL to the dynamic symbol table.
  • -EB β€” link big-endian objects.
  • -EL β€” link little-endian objects.
  • -f SHLIB, --auxiliary SHLIB β€” auxiliary filter for the shared object symbol table.
  • -F SHLIB, --filter SHLIB β€” filter for the shared object symbol table.
  • --fatal-warnings β€” treats warnings as errors. no warnings allowed, we're strict now 😀
  • --no-fatal-warnings β€” does not treat warnings as errors (the default).
  • -fini SYMBOL β€” call SYMBOL at unload-time.
  • --fix-arm1176 β€” (ARM only) fixes binaries for the ARM1176 erratum (the default).
  • --no-fix-arm1176 β€” (ARM only) does not fix binaries for the ARM1176 erratum.
  • --fix-cortex-a8 β€” (ARM only) fixes binaries for the Cortex-A8 erratum.
  • --no-fix-cortex-a8 β€” (ARM only) does not fix binaries for the Cortex-A8 erratum (the default).
  • --fix-cortex-a53-843419 β€” (AArch64 only) fixes Cortex-A53 erratum 843419.
  • --no-fix-cortex-a53-843419 β€” (AArch64 only) does not fix Cortex-A53 erratum 843419 (the default).
  • --fix-cortex-a53-835769 β€” (AArch64 only) fixes Cortex-A53 erratum 835769.
  • --no-fix-cortex-a53-835769 β€” (AArch64 only) does not fix Cortex-A53 erratum 835769 (the default).
  • --fix-v4bx β€” (ARM only) rewrites BX rn as MOV pc, rn for ARMv4.
  • --fix-v4bx-interworking β€” (ARM only) rewrites BX rn branch to ARMv4 interworking veneer.
  • -fuse-ld [gold,bfd] β€” ignored, kept around for GCC linker option compatibility. she's just here to be polite πŸŽ€
  • -g β€” ignored.
  • --gc-sections β€” removes unused sections. spring cleaning, but for your binary ✨
  • --no-gc-sections β€” doesn't remove unused sections (the default).
  • --gdb-index β€” generates a .gdb_index section.
  • --no-gdb-index β€” does not generate a .gdb_index section (the default).
  • --gnu-unique β€” enables STB_GNU_UNIQUE symbol binding (the default).
  • --no-gnu-unique β€” disables STB_GNU_UNIQUE symbol binding.
  • -G, -shared β€” generate a shared library.
  • -h FILENAME, -soname FILENAME β€” sets the shared library name.
  • --hash-bucket-empty-fraction FRACTION β€” minimum fraction of empty buckets in the dynamic hash.
  • --hash-style [sysv,gnu,both] β€” the dynamic hash style.
  • -i β€” alias for -r.
  • --icf [none,all,safe] β€” Identical Code Folding. '--icf=safe' folds ctors, dtors and functions whose pointers are definitely not taken. very "if you're the same, you're the same" of her πŸ’…
  • --icf-iterations COUNT β€” number of iterations of ICF (default 3).
  • --incremental β€” does an incremental link if possible; otherwise, does a full link and prepares output for incremental linking.
  • --no-incremental β€” does a full link (the default).
  • --incremental-full β€” does a full link and prepares output for incremental linking.
  • --incremental-update β€” does an incremental link; exits if it's not possible.
  • --incremental-base FILE β€” sets the base file for incremental linking (default is the output file).
  • --incremental-changed β€” assumes files changed.
  • --incremental-unchanged β€” assumes files didn't change.
  • --incremental-unknown β€” uses timestamps to check files (the default).
  • --incremental-startup-unchanged β€” assumes startup files unchanged (files preceding this option).
  • --incremental-patch PERCENT β€” amount of extra space to allocate for patches (default 10).
  • -init SYMBOL β€” call SYMBOL at load-time.
  • -I PROGRAM, --dynamic-linker PROGRAM β€” sets the dynamic linker path.
  • --just-symbols FILE β€” reads only symbol values from FILE. no lore, just numbers.
  • --keep-files-mapped β€” keeps files mapped across passes (default on 64bit architectures).
  • --no-keep-files-mapped β€” releases mapped files after each pass (default on 32bit architectures).
  • --keep-unique SYMBOL β€” do not fold this symbol during ICF. she's unique and she stays unique, periodt πŸ‘‘
  • -l LIBNAME, --library LIBNAME β€” search for library LIBNAME.
  • --ld-generated-unwind-info β€” generates unwind information for PLT (the default).
  • --no-ld-generated-unwind-info β€” does not generate unwind information for PLT.
  • -L DIR, --library-path DIR β€” adds a directory to the search path.
  • --long-plt β€” (ARM only) generates long PLT entries.
  • --no-long-plt β€” (ARM only) does not generate long PLT entries (the default).
  • -m EMULATION β€” sets the GNU linker emulation; obsolete. she's retired bestie, respect the legacy.
  • --map-whole-files β€” maps whole files to memory (default on 64bit architectures).
  • --no-map-whole-files β€” maps relevant file parts to memory (default on 32bit architectures).
  • --merge-exidx-entries β€” (ARM only) merges exidx entries in debuginfo (the default).
  • --no-merge-exidx-entries β€” (ARM only) does not merge exidx entries in debuginfo.
  • --mmap-output-file β€” maps the output file for writing (the default).
  • --no-mmap-output-file β€” does not map the output file for writing.
  • -M, --print-map β€” writes the map file on standard output.
  • -Map MAPFILENAME β€” writes the map file.
  • -n, --nmagic β€” does not page align data.
  • -N, --omagic β€” does not page align data, and does not make text readonly.
  • --no-omagic β€” page aligns data, makes text readonly (the default).
  • --no-keep-memory β€” uses less memory and more disk I/O (included only for compatibility with GNU ld).
  • --no-undefined β€” reports undefined symbols (even with --shared).
  • --noinhibit-exec β€” creates an output file even if errors occur. messy but productive, we've all been there πŸ™ˆ
  • -nostdlib β€” only searches directories specified on the command line.
  • -o FILE, --output FILE β€” sets the output file name.
  • --oformat [binary] β€” sets the output format.
  • -O LEVEL, -optimize LEVEL β€” optimizes output file size.
  • --orphan-handling [place,discard,warn,error] β€” orphan section handling.
  • -p β€” ignored, kept for ARM compatibility.

  • --package-metadata [=JSON] β€” drop a package metadata note in there πŸ’Œ
  • -pie β€” make a position independent executable ✨
  • -no-pie β€” do NOT make a position independent executable (this is the default, bestie) 🚫
  • --pic-executable β€” same vibe as -pie: position independent executable, slay πŸ‘‘
  • --no-pic-executable β€” nope, no position independent executable here (default) πŸ™…β€β™€οΈ
  • --pic-veneer β€” force PIC sequences for ARM/Thumb interworking veneers 🦾
  • -no-pipeline-knowledge β€” (ARM only) ignore for backward compatibility (default) πŸ•°οΈ
  • --plt-align [=P2ALIGN] β€” (PowerPC only) align PLT call stubs so they fit cache lines πŸ“
  • --plt-localentry β€” (PowerPC64 only) optimize calls to ELFv2 localentry:0 functions πŸš€
  • --no-plt-localentry β€” (PowerPC64 only) don't optimize those ELFv2 calls (default) πŸ™ˆ
  • --plt-static-chain β€” (PowerPC64 only) PLT call stubs should load r11 πŸ’ͺ
  • --no-plt-static-chain β€” (PowerPC64 only) PLT call stubs should not load r11 (default) 🚫
  • --plt-thread-safe β€” (PowerPC64 only) PLT call stubs with a load-load barrier 🧱
  • --no-plt-thread-safe β€” (PowerPC64 only) PLT call stubs without a barrier (default) 🌊
  • --plugin PLUGIN β€” load a plugin library πŸ”Œ
  • --plugin-opt OPTION β€” pass an option to the plugin πŸ—£οΈ
  • --posix-fallocate β€” use posix_fallocate to reserve space in the output file (default) πŸ“¦
  • --no-posix-fallocate β€” use fallocate or ftruncate to reserve space βœ‚οΈ
  • --power10-stubs [=auto,no,yes] β€” (PowerPC64 only) stubs use power10 insns ⚑
  • --no-power10-stubs β€” (PowerPC64 only) stubs do not use power10 insns 🚫
  • --preread-archive-symbols β€” preread archive symbols when multi-threaded πŸ“š
  • --print-gc-sections β€” list removed unused sections on stderr πŸ—‘οΈ
  • --no-print-gc-sections β€” do not list removed unused sections (default) πŸ™Š
  • --print-icf-sections β€” list folded identical sections on stderr πŸͺž
  • --no-print-icf-sections β€” do not list folded identical sections (default) 🀐
  • --print-output-format β€” print default output format πŸ–¨οΈ
  • --print-symbol-counts FILENAME β€” print symbols defined and used for each input πŸ”’
  • --push-state β€” save the state of flags related to input files πŸ’Ύ
  • --pop-state β€” restore the state of flags related to input files βͺ
  • -q, --emit-relocs β€” generate relocations in output πŸ› οΈ
  • -Qy β€” ignored for SVR4 compatibility πŸ€·β€β™€οΈ
  • -r, -relocatable β€” generate relocatable output πŸ”„
  • --relax β€” relax branches on certain targets 🧘
  • --no-relax β€” do not relax branches (default) 🚫
  • --retain-symbols-file FILE β€” keep only symbols listed in this file πŸ“
  • --rosegment β€” put read-only non-executable sections in their own segment 🌹
  • --no-rosegment β€” do not put read-only non-executable sections in their own segment (default) πŸ₯€
  • --rosegment-gap OFFSET β€” set offset between executable and read-only segments πŸ“
  • -R DIR β€” add DIR to runtime search path πŸ”
  • -rpath DIR β€” add DIR to runtime search path (same energy) πŸ”Ž
  • --rpath-link DIR β€” add DIR to link time shared library search path πŸ”—
  • -s, --strip-all β€” strip all symbols βœ‚οΈ
  • -S, --strip-debug β€” strip debugging information πŸ›
  • --strip-debug-non-line β€” emit only debug line number information πŸ“
  • --strip-debug-gdb β€” strip debug symbols that are unused by gdb (at least versions <= 7.4) 🧹
  • --strip-lto-sections β€” strip LTO intermediate code sections (default) 🧼
  • --section-ordering-file FILENAME β€” layout sections in the order specified πŸ“‹
  • --section-start SECTION=ADDRESS β€” set address of section 🏠
  • --secure-plt β€” (PowerPC only) use new-style PLT (default) πŸ”
  • --sort-common [={ascending,descending}] β€” sort common symbols by alignment πŸ“Š
  • --sort-section [none,name] β€” sort sections by name. '--no-text-reorder' will override '--sort-section=name' for .text πŸ”€
  • --spare-dynamic-tags COUNT β€” dynamic tag slots to reserve (default 5) 🏷️
  • --stub-group-size SIZE β€” (ARM, PowerPC only) the maximum distance from instructions in a group of sections to their stubs. Negative values mean stubs are always after the group. 1 means use default size πŸ“¦
  • --stub-group-multi β€” (PowerPC only) allow a group of stubs to serve multiple output sections (default) πŸ‘―β€β™€οΈ
  • --no-stub-group-multi β€” (PowerPC only) each output section has its own stubs πŸ™…
  • --split-stack-adjust-size SIZE β€” stack size when -fsplit-stack function calls non-split 🧡
  • -static β€” do not link against shared libraries 🚫
  • --start-lib β€” start a library 🏁
  • --end-lib β€” end a library 🏁
  • --stats β€” print resource usage statistics πŸ“ˆ
  • --sysroot DIR β€” set target system root directory 🌳
  • -t, --trace β€” print the name of each input file πŸ—£οΈ
  • --target1-abs β€” (ARM only) force R_ARM_TARGET1 type to R_ARM_ABS32 🎯
  • --target1-rel β€” (ARM only) force R_ARM_TARGET1 type to R_ARM_REL32 🎯
  • --target2 [rel, abs, got-rel β€” (ARM only) set R_ARM_TARGET2 relocation type 🧩
  • --text-reorder β€” enable text section reordering for GCC section names (default) πŸ”€
  • --no-text-reorder β€” disable text section reordering for GCC section names 🚫
  • --threads β€” run the linker multi-threaded 🧡
  • --no-threads β€” do not run the linker multi-threaded (default) 🚫
  • --thread-count COUNT β€” number of threads to use πŸ”’
  • --thread-count-initial COUNT β€” number of threads to use in initial pass 🏁
  • --thread-count-middle COUNT β€” number of threads to use in middle pass πŸƒ
  • --thread-count-final COUNT β€” number of threads to use in final pass 🏁
  • --tls-optimize β€” (PowerPC/64 only) optimize GD/LD/IE code to IE/LE (default) ⚑
  • --no-tls-optimize β€” (PowerPC/64 only) Don'''t try to optimize TLS accesses 🚫
  • --tls-get-addr-optimize β€” (PowerPC/64 only) use a special __tls_get_addr call (default) πŸ“ž
  • --no-tls-get-addr-optimize β€” (PowerPC/64 only) don't use a special __tls_get_addr call 🚫
  • --toc-optimize β€” (PowerPC64 only) optimize TOC code sequences (default) 🧠
  • --no-toc-optimize β€” (PowerPC64 only) don't optimize TOC code sequences 🚫
  • --toc-sort β€” (PowerPC64 only) sort TOC and GOT sections (default) πŸ”€
  • --no-toc-sort β€” (PowerPC64 only) don't sort TOC and GOT sections 🚫
  • -T FILE, --script FILE β€” read linker script πŸ“œ
  • -Tbss ADDRESS β€” set the address of the bss segment 🏠
  • -Tdata ADDRESS β€” set the address of the data segment 🏠
  • -Ttext ADDRESS β€” set the address of the text segment 🏠
  • -Ttext-segment ADDRESS β€” set the address of the text segment 🏠
  • -Trodata-segment ADDRESS β€” set the address of the rodata segment 🏠
  • -u SYMBOL, --undefined SYMBOL β€” create undefined reference to SYMBOL πŸ”—
  • --unresolved-symbols β€” how to handle unresolved symbols. Values: ignore-all, report-all, ignore-in-object-files, ignore-in-shared-libs πŸ€”
  • --verbose β€” alias for --debug=files πŸ—£οΈ
  • --version-script FILE β€” read version script πŸ“œ
  • --warn-common β€” warn about duplicate common symbols ⚠️
  • --no-warn-common β€” do not warn about duplicate common symbols (default) 🀐
  • --warn-constructors β€” ignored πŸ™ˆ
  • --no-warn-constructors β€” ignored πŸ™ˆ
  • --warn-drop-version β€” warn when discarding version information ⚠️
  • --no-warn-drop-version β€” do not warn when discarding version information (default) 🀐
  • --warn-execstack β€” warn if the stack is executable ⚠️
  • --no-warn-execstack β€” do not warn if the stack is executable (default) 🀐
  • --no-warn-mismatch β€” don't warn about mismatched input files 🀐
  • --warn-multiple-gp β€” ignored πŸ™ˆ
  • --warn-search-mismatch β€” warn when skipping an incompatible library (default) ⚠️
  • --no-warn-search-mismatch β€” don't warn when skipping an incompatible library 🀐
  • --warn-shared-textrel β€” warn if text segment is not shareable ⚠️
  • --no-warn-shared-textrel β€” do not warn if text segment is not shareable (default) 🀐
  • --warn-unresolved-symbols β€” report unresolved symbols as warnings ⚠️
  • --error-unresolved-symbols β€” report unresolved symbols as errors (default) ❌
  • -z buildd β€” dummy z option 🧸
  • --no-wchar-size-warning β€” (ARM only) do not warn about objects with incompatible wchar_t sizes 🀐
  • --weak-unresolved-symbols β€” convert unresolved symbols to weak references 🫠
  • --whole-archive β€” include all archive contents πŸ“¦
  • --no-whole-archive β€” include only needed archive contents (default) 🎯
  • --wrap SYMBOL β€” use wrapper functions for SYMBOL 🎁
  • -x, --discard-all β€” delete all local symbols πŸ—‘οΈ
  • -X, --discard-locals β€” delete all temporary local symbols πŸ—‘οΈ
  • --discard-none β€” keep all local symbols πŸ’–
  • -y SYMBOL, --trace-symbol SYMBOL β€” trace references to symbol πŸ”
  • --undefined-version β€” allow unused version in script (default) βœ…
  • --no-undefined-version β€” do not allow unused version in script 🚫
  • -Y PATH β€” default search path for Solaris compatibility β˜€οΈ
  • -(, --start-group β€” start a library search group 🏁
  • -), --end-group β€” end a library search group 🏁
  • -z combreloc β€” sort dynamic relocs (default) πŸ”€
  • -z nocombreloc β€” do not sort dynamic relocs 🚫
  • -z common-page-size=SIZE β€” set common page size to SIZE πŸ“
  • -z defs β€” report undefined symbols (even with --shared) ❌
  • -z execstack β€” mark output as requiring executable stack πŸ₯ž
  • -z global β€” make symbols in DSO available for subsequently loaded objects 🌍
  • -z initfirst β€” mark DSO to be initialized first at runtime πŸ₯‡
  • -z interpose β€” mark object to interpose all DSOs but executable 🎭
  • -z unique β€” mark DSO to be loaded at most once, and only in the main namespace 1️⃣
  • -z nounique β€” do not mark the DSO as one to be loaded only in the main namespace (default) 🚫
  • -z lazy β€” mark object for lazy runtime binding (default) 😴
  • -z loadfltr β€” mark object requiring immediate process ⚑
  • -z max-page-size=SIZE β€” set maximum page size to SIZE πŸ“
  • -z muldefs β€” allow multiple definitions of symbols πŸ”
  • -z nocopyreloc β€” do not create copy relocs 🚫
  • -z nodefaultlib β€” mark object not to use default search paths 🚫
  • -z nodelete β€” mark DSO non-deletable at runtime πŸ”’
  • -z nodlopen β€” mark DSO not available to dlopen 🚫
  • -z nodump β€” mark DSO not available to dldump 🚫
  • -z noexecstack β€” mark output as not requiring executable stack 🚫
  • -z now β€” marks the object for immediate function binding, like it said "no waiting, we're doing this NOW" ✨
  • -z origin β€” marks the DSO to say it needs immediate $ORIGIN processing at runtime πŸƒβ€β™€οΈ
  • -z relro β€” where possible, marks variables read-only after relocation. This is the default, bestie, it's the moment πŸ’…
  • -z norelro β€” don't do that. don't mark variables read-only after relocation πŸ™ˆ
  • -z stack-size=SIZE β€” sets the PT_GNU_STACK segment p_memsz to SIZE. literally just that number, queen πŸ‘‘
  • -z start-stop-visibility=[default,internal,hidden,protected] β€” picks the ELF symbol visibility for the synthesized __start_* and __stop_* symbols πŸ¦‹
  • -z text β€” do not permit relocations in read-only segments 🚫
  • -z notext β€” permit relocations in read-only segments. this one is the default 🌸
  • -z textoff β€” also permits relocations in read-only segments. yep, still the default 😌
  • -z text-unlikely-segment β€” moves .text.unlikely sections into a separate segment ✨
  • -z notext-unlikely-segment β€” does not move .text.unlikely sections to a separate segment. (default, if you were wondering) 🌈
  • -z keep-text-section-prefix β€” keeps .text.hot, .text.startup, .text.exit and .text.unlikely as separate sections in the final binary. main character sections, they don't share a room πŸ’–
  • -z nokeep-text-section-prefix β€” merges all .text.* prefix sections together. (default) πŸŽ€

and if you ever forget all of this (you won't, you're doing amazing), just run

gold --help

for a list of supported targets and emulations 🫢


πŸ› REPORTING BUGS πŸ›

Found a bug? First of all, not your fault, and second of all β€” tell the people who can fix it:

Report bugs to <https://sourceware.org/bugzilla/>

fr fr, they want to hear about it πŸ’œ


Copyright Β© 2024 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License version 3 or (at your option) a later version. This program has absolutely no warranty 😭 (yes, really β€” no warranty, no cap, zero, nada, don't come for them if it breaks)


okay bestie that's the whole page, you ate it, you read the entire manual πŸ’…βœ¨

this was GNU gold (from GNU Binutils for Ubuntu), dated December 2025 β€” go compile something iconic, ily, bye πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from