LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

ld

GNU linker

TLDR

Link object files
$ ld -o [output] [file1.o] [file2.o]
copy
Link with library
$ ld -o [output] [file.o] -l[library]
copy
Specify library path
$ ld -o [output] [file.o] -L[/path/to/lib] -l[name]
copy
Link shared library
$ ld -shared -o [lib.so] [file.o]
copy
Entry point
$ ld -e [main] -o [output] [file.o]
copy
Verbose linking
$ ld -v -o [output] [file.o]
copy

SYNOPSIS

ld [options] files

DESCRIPTION

ld is the GNU linker. It combines object files into executables or libraries.The linker resolves symbols and relocates code. It's typically invoked through gcc rather than directly.

PARAMETERS

FILES

Object files to link.
-o FILE
Output file name.
-l NAME
Link with library.
-L DIR
Library search path.
-shared
Create shared library.
-e SYMBOL
Entry point symbol.
-v
Verbose output.
--help
Display help information.

INSTALL

sudo apt install binutils
copy
sudo dnf install binutils
copy
sudo pacman -S binutils
copy
sudo apk add binutils
copy
sudo zypper install binutils
copy
brew install binutils
copy
nix profile install nixpkgs#binutils
copy

CAVEATS

Usually called via gcc. Complex options. Platform-specific.

HISTORY

ld is the GNU project linker, part of binutils, providing linking for the GNU toolchain.

SEE ALSO

gcc(1), ld.gold(1), ldd(1), nm(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid