====== Linker ====== Alternatives: * GNU BFD Linker < * gold < * LLD < * mold < ====== Links ====== ===== General ===== FIXME ====== Docs ====== FIXME ====== Articles ====== [[https://www.heise.de/select/ix/archiv/2022/12/seite-112|iX 12/2022 - Page 112 - Ohne Linker kein Programm]]\\ [[https://www.heise.de/select/ix/archiv/2023/2/seite-136|iX 02/2023 - Page 136 - Mit dem richtigen Linker Zeit sparen]]\\ [[https://www.linux-magazin.de/ausgaben/2023/08/ld-preload/|Linux-Magazin 08/2023 - Page 70 - Programmverhalten mit LD_PRELOAD ändern]]\\ ====== 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 ===== 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 ===== 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 ====== Recipies ====== FIXME ====== Known Issues ====== FIXME