Linux in a Nutshell, Third Edition
by Ellen Siever, Stephen Spainhour, Jessica P. Hekman, Stephen Figgins
Name
ld
Synopsis
ld [options] objfiles
Description
Combine several objfiles, in the specified order, into a single executable object module (a.out by default). ld is the link editor and is often invoked automatically by compiler commands.
Options
- -c file
Consult file for commands.
- -d, -dc, -dp
Force the assignment of space to common symbols.
- -defsym symbol=expression
Create the global symbol with the value expression.
- -e symbol
Set symbol as the address of the output file’s entry point.
- -i
Produce a linkable output file; attempt to set its magic number to OMAGIC.
- -l arch
Include the archive file arch in the list of files to link.
- -m linker
Emulate linker.
- -n
Make text read-only; attempt to set NMAGIC.
- -noinhibit-exec
Produce output file even if errors are encountered.
- -o output
Place output in output, instead of a.out.
- -oformat format
Specify output format.
- -r
Produce a linkable output file; attempt to set its magic number to OMAGIC.
- -s
Do not include any symbol information in output.
- -shared
Create a shared library.
- -sort-common
Do not sort global common symbols by size.
- -t
Announce each input file’s name as it is processed.
- -u symbol
Force symbol to be undefined.
- -v, --version
Show version number.
- --verbose
Print information about ld; print the names of input files while attempting to open them.
- -warn-common
Warn when encountering common symbols combined with other constructs.
- -warn-once
Provide only one warning per undefined symbol.
- -x
With -s or -S, delete all local symbols that ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access