ld(1) on Solnix vs Linux and the BSDs

On Solnix, ld is the illumos link-editor at /usr/bin/ld. It is not GNU ld, and it is not the LLVM lld that FreeBSD documents under ld(1). Its options (-G, -M mapfile, -z keywords, -d y|n) differ from the GNU and lld options, and static executables are effectively unavailable.

What Solnix runs

A default Solnix system runs the illumos ld at /usr/bin/ld, published in pkgs.solnix.illumos-world-man. No other variants are shipped. It is a cross link-editor for Sparc and x86, 32-bit and 64-bit. Its companion is the runtime linker ld.so.1(1).

Differences

Compared withTopicWhat differs
Linux, FreeBSDwhich linker it isSolnix ld is the illumos link-editor. The Linux page documents the GNU linker, which reads linker command language scripts. The FreeBSD ld(1) page documents ld.lld, the LLVM ELF linker, described as a drop-in replacement for GNU BFD and gold.
Source: Solnix ld(1) NAME, DESCRIPTION; Linux ld(1) NAME, DESCRIPTION; FreeBSD ld(1) NAME, DESCRIPTION
Linux, FreeBSDscript and mapfile controlSolnix ld takes a mapfile with -M mapfile. The Linux page documents -T and the linker command language, and FreeBSD ld.lld documents --script and --default-script. The Solnix SYNOPSIS lists no linker-script option.
Source: Solnix ld(1) SYNOPSIS (-M mapfile); Linux ld(1) DESCRIPTION, OPTIONS (-T); FreeBSD ld(1) --default-script, --script
FreeBSDcreating a shared objectOn Solnix, -G makes ld combine relocatable objects into a shared object instead of a dynamic executable. FreeBSD ld.lld lists --shared, and its extracted option list has no -G.
Source: Solnix ld(1) DESCRIPTION (-G); FreeBSD ld(1) option list (--shared), -Bsymbolic text (-shared)
FreeBSDdynamic vs static modeSolnix selects dynamic or static mode with -d y or -d n, and -d y is the default. FreeBSD ld.lld uses --Bdynamic (--dy) and --Bstatic (--static, --dn) to choose between linking and not linking shared libraries.
Source: Solnix ld(1) DESCRIPTION (-d y, -d n); FreeBSD ld(1) --Bdynamic, --Bstatic
Linux, FreeBSDstatic executablesThe Solnix page discourages static executables. It says system archive libraries such as libc.a have never been provided on illumos, so static linking needs specialized system knowledge. The Linux page's example links hello.o with -lc against libc.a.
Source: Solnix ld(1) DESCRIPTION, Static Executables; Linux ld(1) OPTIONS (hello.o example)
Linux, FreeBSDtarget and object formatsSolnix ld handles only Sparc or x86 targets, in 32-bit or 64-bit class. It takes class and machine from the first relocatable object and refuses mixed classes. Linux ld reads many formats through BFD. FreeBSD ld.lld lists many architectures, always built in.
Source: Solnix ld(1) DESCRIPTION, -32|-64, -z target; Linux ld(1) DESCRIPTION (BFD); FreeBSD ld(1) DESCRIPTION
Linux, FreeBSD-32 and -64Solnix ld has -32 and -64 to pick the output class. They may be repeated and mixed, and the last one wins, so ld -64 -32 -64 gives 64-bit output. The Linux and FreeBSD excerpts document neither option.
Source: Solnix ld(1) OPTIONS -32 | -64; Linux ld(1) OPTIONS; FreeBSD ld(1) OPTIONS
Linux, FreeBSD-z keywordsThe Solnix SYNOPSIS defines many -z keywords: -z rescan, -z guidance, -z target=sparc|x86, -z type=exec|kmod|reloc|shared, -z assert-deflib and -z aslr. The Linux and FreeBSD excerpts shown do not document these, so do not assume them there.
Source: Solnix ld(1) SYNOPSIS (-z ...); Linux ld(1) option list (-z); FreeBSD ld(1) option list (-z)
Linux, FreeBSDinterdependent archivesSolnix searches each library once, where it appears on the command line. Libraries that depend on each other need repeated listing or a -z rescan option. The Linux page shows -Wl,--start-group ... --end-group. FreeBSD ld.lld has --start-lib and --end-lib for object grouping.
Source: Solnix ld(1) DESCRIPTION (-z rescan); Linux ld(1) OPTIONS (gcc -Wl,--start-group example); FreeBSD ld(1) --start-lib, --end-lib
Linux, FreeBSDdefault output and environmentThe Solnix page says output goes to a.out by default and names the LD_NOEXEC_64 environment variable. The Linux and FreeBSD excerpts shown say nothing about a default output name or that variable.
Source: Solnix ld(1) DESCRIPTION (a.out), cross link-editor paragraph (LD_NOEXEC_64); Linux ld(1) OPTIONS; FreeBSD ld(1) OPTIONS
Linux@file response filesLinux ld reads options from a file given as @file, with quoting rules and recursion. The Solnix excerpt does not document @file.
Source: Linux ld(1) OPTIONS @file; Solnix ld(1) SYNOPSIS, OPTIONS

Standards

  • POSIX: ld is not a POSIX.1-2024 utility.
  • Solnix: The bundle excerpt shows no STANDARDS or ATTRIBUTES section for Solnix ld(1). It refers to the Linker and Libraries Guide for the linking model.
  • Linux: The Linux ld(1) excerpt has no STANDARDS section.
  • FreeBSD: The FreeBSD ld(1) excerpt has no STANDARDS section.

Writing portable scripts

  • Link through the compiler driver (cc) and avoid calling ld directly in portable build scripts. Solnix ld, GNU ld and ld.lld take different options (-G, -M, -z keywords, -d y|n).
  • Do not plan on static linking (-static, -d n) on Solnix: the page says system archive libraries such as libc.a are not provided.

Every difference here is taken from the manual pages linked above: Solnix's published page, Linux (man-pages and the GNU and util-linux manuals), FreeBSD, OpenBSD and NetBSD. Each row names its source. Where a manual is silent, this page is too. Compiled 2026-10-26. Found a mistake? Mail hackers@lists.solnix.io.