Readings: Blogs
- Eli Bendersky - Linkers and loaders
- https://eli.thegreenplace.net/tag/linkers-and-loaders
- Load-time relocation of shared libraries
- Position Independent Code (PIC) in shared libraries
- Position Independent Code (PIC) in shared libraries on x64
- How statically linked programs run on Linux
- Library order in static linking
- Fun with weak symbols
- Ian Lance Taylor
- 20 part linker essay by Ian Lance Taylor
- Notes: Day 40: Linkers are amazing.
- TOC: https://checkoway.net/musings/linkers/
- TOC: https://lwn.net/Articles/276782/
- 1. Introduction, personal history, first half of what's-a-linker - http://www.airs.com/blog/archives/38
- 2. What's-a-linker: Dynamic linking, linker data types, linker operation - http://www.airs.com/blog/archives/39
- 3. Address spaces, Object file formats - http://www.airs.com/blog/archives/40
- 4. Shared Libraries - http://www.airs.com/blog/archives/41
- 5. More Shared Libraries -- specifically, linker implementation; ELF Symbols - http://www.airs.com/blog/archives/42
- 6. Relocations, Position Dependent Shared Libraries - http://www.airs.com/blog/archives/43
- 7. Thread Local Storage (TLS) optimization - http://www.airs.com/blog/archives/44
- 8. ELF Segments and Sections - http://www.airs.com/blog/archives/45
- 9. Symbol Versions, Relaxation optimization - http://www.airs.com/blog/archives/46
- 10. Parallel linking - http://www.airs.com/blog/archives/47
- 11. Archive format - http://www.airs.com/blog/archives/48
- 12. Symbol resolution - http://www.airs.com/blog/archives/49
- 13. Symbol resolution from the user's point of view; Static Linking vs. Dynamic Linking - http://www.airs.com/blog/archives/50
- 14. Link time optimization, aka Whole Program optimization; Initialization Code - http://www.airs.com/blog/archives/51
- 15. COMDAT sections - http://www.airs.com/blog/archives/52
- 16. C++ Template Instantiation, Exception Frames - http://www.airs.com/blog/archives/53
- 17. Warning Symbols - http://www.airs.com/blog/archives/54
- 18. Incremental Linking - http://www.airs.com/blog/archives/55
- 19.
__start
and __stop
Symbols, Byte Swapping - http://www.airs.com/blog/archives/56
- 20. Last post; Update on gold's status - http://www.airs.com/blog/archives/57
- Protected Symbols - https://www.airs.com/blog/archives/307
- gold
- Nick Desaulniers
- Stephen Kell
- Linking and loading: what's incidental?
- Dynamic linking and security
- C libraries and linking
- Link order
- Weak dynamic symbols
- Trevor Pounds
- Versioning Symbols for Shared Libraries (glibc)
- Linking to Older Versioned Symbols (glibc)
Readings: Linker Scripts
- OSDev Wiki
- LD - Linker Scripts
Readings: LTO
- (Ab)using LTO plugin API for system-wide shrinking of dynamic libraries
- GCC Wiki - LinkTimeOptimization
- Honza Hubička's Blog
- Linktime optimization in GCC, part 1 - brief history
- Linktime optimization in GCC, part 2 - Firefox
- Linktime optimization in GCC, part 3 - LibreOffice
- Link time and inter-procedural optimization improvements in GCC 5
- Building libreoffice with GCC 6 and LTO
- GCC 8: link time and interprocedural optimization
- LLVM Link Time Optimization: Design and Implementation
- Optimizing Large Applications
- Optimizing real world applications with GCC Link Time Optimization
- ThinLTO
- ThinLTO: Scalable and Incremental LTO
- ThinLTO: Scalable and Incremental Link-Time Optimization
- ThinLTO: Scalable and incremental LTO
Readings: OS
macOS
Linux
- Linker limitations on 32-bit architectures
- Linux EDR Evasion With Meterpreter and LD_PRELOAD
- Linux Internals
- Dynamic Linking Wizardry
- The Art Of Symbol Resolution
Solaris
- Surfing With The Linker Aliens: Solaris Linking & ELF Blogs
Windows
- Raymond Chen - The Old New Thing
- Understanding the classical model for linking
- https://blogs.msdn.microsoft.com/oldnewthing/tag/linker
- Groundwork: The algorithm
- Taking symbols along for the ride
- You can override an LIB with another LIB, and a LIB with an OBJ, but you can’t override an OBJ
- Sometimes you don’t want a symbol to come along for a ride
- Understanding errors in classical linking: The delay-load catch-22
- Using linker segments and
__declspec(allocate(…))
to arrange data in a specific order
- Gotchas when using linker sections to arrange data, part 1
- Gotchas when using linker sections to arrange data, part 2
- Why would the incremental linker insert padding between section fragments?
Readings: Relocations
- Binary Dodo - Arun
- Investigating linking with COMMON symbols in ELF
- Symbol binding types in ELF and their effect on linking of relocatable files
- Symbol resolution during link-editing
- ELF Binaries and Relocation Entries - Stafford Horne
- Executable and Linkable Format 101 - Ignacio Sanmillan
- GOT and PLT
- Ian Lance Taylor
- Linkers 2. What's-a-linker: Dynamic linking, linker data types, linker operation
- Linkers 5. More Shared Libraries -- specifically, linker implementation; ELF Symbols
- Linkers 6. Relocations, Position Dependent Shared Libraries
- Linkers 9. Symbol Versions, Relaxation optimization
- Linker combreloc
- Linker relro
- Introduction to the ELF Format - Keith Makan
- Linkers and loaders - Eli Bendersky - http://eli.thegreenplace.net/tag/linkers-and-loaders
- Load-time relocation of shared libraries
- Making our own executable packer - Amos Wenger
- Moving code around - Thiago Macieira
- Oracle Solaris 11.1 Linker and Libraries Guide
- Relocation Processing
- Relocation Sections
- Relocations in ELF Toolchains - Palmer Dabbelt
- Relocations: fantastic symbols, but where to find them? - Siddhesh Poyarekar
- Resolving ELF Relocation Name / Symbols - Chris Rohlf
Readings: Security
- An Evil Copy: How the Loader Betrays You
- Breaking the links: Exploiting the linker
- Dynamic Loader Oriented Programming on Linux
- Types for the Chain of Trust: No (loader) write left behind
Readings: Shared Libraries
- Fun with weak dynamic linking
- How To Write Shared Libraries - Ulrich Drepper
- Inlining — shared libraries are special
- PLT and GOT - the key to code sharing and dynamic libraries
- Shared Libraries: Understanding Dynamic Loading
- Software Multiplexing: Share Your Libraries and Statically Link Them Too
Software
- GNU Linker Output Viewer & Editor
- ld-limiter: Limit number of parallel link jobs
- libdlbind: Dynamic creation and update of ELF files, or: an allocator for JIT compilers
- linkermapviz
- linksem: Semantic model for aspects of ELF static linking and DWARF debug information
- ShlibVisibilityChecker: Tool for locating internal symbols unnecessarily exported from shared libraries
Software: Linkers
- ld - the GNU linker
- LLD - The LLVM Linker
Software: OS: macOS
- ld64: Instructions on how to build the ld64 linker on macOS
- [lld] Initial commit for new Mach-O backend
- macdylibbundler: Utility to ease bundling libraries into executables for OSX
- zld: A faster version of Apple's linker
Software: OS: Linux
- dlinject.py: Inject a shared library (i.e. arbitrary code) into a live linux process, without ptrace
- Faulty.lib: Dynamic linker for compressed libraries, with on-demand decompression (ELF Linux systems)
- Implib.so: POSIX equivalent of Windows DLL import libraries
- libosuction: A tool for stripping dynamic libraries of unneeded symbols
- libpreloadvaccine: Whitelisting LD_PRELOAD libraries using LD_AUDIT
- libprocesshider: Hide a process under Linux using the ld preloader
Talks
Talks: 2019
- Dynamic Linking On GNU/Linux
- Pardon the Interposition—Modifying and Improving Software Behavior with Interposers
- The ACM-NVIDIA Compiler summer school lectures (2019)
- What makes LLD so fast?
Talks: 2018
- Behind the Scenes of the Xcode Build Process
- The Bits Between the Bits: How We Get to main()
Talks: 2017
- App Startup Time: Past, Present, and Future
- WWDC 2017; Louis Gerbarg
- https://developer.apple.com/videos/play/wwdc2017/413/
- "Learn about the dyld dynamic linker used on Apple platforms, how it's changed over the years, and where it's headed next. Find out how improved tooling makes it easier to optimize your app's launch time, and see how new changes coming in dyld will bring even further launch time improvements."
- LLD from a user's perspective
- My Little Object File: How Linkers Implement C++
- The Missing Link: The Curious symbiosis between C++ and the Linker
Talks: 2016
- New LLD linker for ELF: A high performance linker from the LLVM project
- Optimizing App Startup Time: Linkers, loaders, and you
- WWDC 2016; Nick Kledzik, Louis Gerbarg
- https://developer.apple.com/videos/play/wwdc2016/406/
- "Launching an App is a complicated and subtle process and the ramifications on launch times of different App design patterns are often non-obvious. Come learn what happens in the time between when an App begins launching and when the main() function gets control and how that time relates to the code and structure of your App. Learn about the inner details of the dynamic loader, dyld, and best practices for structuring your code to perform at its best from the very start."
Tags:
native
reading
windows
macos
linux
Last modified 07 October 2024