A word from our sponsors

Linker

Alternatives:

  • GNU BFD Linker

  • gold

  • LLD

  • mold

Links

General

FIXME

Docs

FIXME

Articles

Files and Directories

FIXME

General Files and Directories

FIXME

Configuration Files

FIXME

Getting Help

binutils Manual pages:

user@host:~$ man 1 ld
user@host:~$ man 1 nm
user@host:~$ man 1 objdump
user@host:~$ man 1 readelf
user@host:~$ man 1 strip

GNU C Library: Binaries Manual pages:

user@host:~$ man 1 ldd

Dynamically linked library call tracer Manual pages:

user@host:~$ man 1 ltrace

System call tracer Manual pages:

user@host:~$ man 1 strace

Install

To install the GNU assembler, linker and binary utilities on Debian:

root@host:~$ apt-get -y install binutils binutils-common

To install the documentation for the GNU assembler, linker and binary utilities on Debian:

root@host:~$ apt-get -y install binutils-doc

To install the Dynamically linked library call tracer on Debian:

root@host:~$ apt-get -y install ltrace

To install the System call tracer on Debian:

root@host:~$ apt-get -y install strace

Configuration

FIXME

Usage

Using an alternative Linker

  • Create a symlink of /usr/bin/ld to the linker of choice

  • Use of LDFLAGS environment variable and there -fuse-ld=, but this depends on support for the specific linker in the used compiler (e.g. GCC, Clang, …)

  • Workaround: Create a directory e.g. tools, create a symlink to the linker of choice in there and use the option -Btools in the LDFLAGS environment variable.

Listing all exported symbols of a library

root@host:~$ readelf -Ws <LIBRARY_FILE>

Changing the loaded shared libraries

Setting the environment variables LD_LIBRARY_PATH or LD_PRELOAD in order to change the search order of the linked shared libraries to be loaded at start of a binary.

Tracing the system calls of a program

To trace the system calls (i.e. Linux kernel calls) of a program upon execution:

root@host:~$ strace -f <PROGRAMM>

Tracing the dynamically linked library calls of a program

To trace the calls to symbols exported by dynamically linked libraries of a program upon execution:

root@host:~$ ltrace -f <PROGRAM> 

Recipies

FIXME

this namespace doesn't exist: prog:c:recipies

Known Issues

FIXME

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website. More information about cookies