
Linkers and loaders
by John R. Levine · first published 1999
74% recommend23% neutral3% critical
Why HN recommends it
Thorough reference on how linking and loading work, including executable formats like ELF and COM and dynamic linking. Suits compiler or OS writers and anyone wanting to understand how programs get loaded and run.
Summarised by Claude from recommending comments
Whatever your programming language, whatever your platform, you probably tap into linker and loader functions all the time. But do you know how to use them to their greatest possible advantage? Only now, with the publication of Linkers & Loaders, is there an authoritative book devoted entirely to these deep-seated compile-time and run-time processes. The book begins with a detailed and comparative account of linking and loading that illustrates the differences among various compilers and operating systems. On top of this foundation, the author presents clear practical advice to help you cre
Affiliate links. As an Amazon Associate I earn from qualifying purchases.








…should you lose them (and remain a programmer ;-) * Learn assembly language. Learn C. Learn how to write your own tools. Programming tools should be the first systems you investigate. Levine's book "Linkers and Loaders" is free online. You can find "Advanced DOS" on Alexie Frounze's site. K&R is online. Unix is good. Learn it well, at the kernel level. Familiarize yourself executable file formats. Get into compiler…
on “Ask HN: project ideas for a noob” ↗"Linkers and Loaders" by John R. Levine is referenced in your paper, and is a great resource: http://linker.iecc.com/ The beta site includes the book in draft form, for those with the patience to deal with the occasional…
on “How statically linked programs run on Linux” ↗Not free, but an excellent book along the same lines, is John Levine's "Linkers and Loaders": http://www.amazon.com/Linkers-Kaufmann-Software-Engineering-... He's been the moderator of comp.compilers since 1986, so he's got a lot of practical Q&A experience to draw on.
on “Assemblers and Loaders (1993)” ↗> types and typing Types and Programming Languages, Benjamin C Pierce > object files, executables, libraries and linking Linkers and Loaders, John R Levine
on “Want to Write a Compiler? Just Read These Two Papers (2008)” ↗…gets the ergonomics of early bound linking with the features of late-bound linking that would otherwise need manual use of dlsym / GetProcAddress. If you're interested in the topic, I highly recommend Linkers and Loaders by John Levine, long-time moderator of comp.compilers.
on “I wrote a linker everyone can understand” ↗"Linkers and Loaders" John R. Levine, https://linker.iecc.com/
on “Resources to learn to build a dynamic linker” ↗…"Introduction to Automata Theory, Languages, and Computation" ( http://www.amazon.com/Introduction-Automata-Theory-Languages...) Then proceed to Dragonbook. After finishing Dragonbook, you might like this Linkers and loaders (http://www.amazon.com/Linkers-Kaufmann-Software-Engineering-...) In general follow this guy Jeff Ullman and you would be good(http://infolab.stanford.edu/~ullman/)
on “Ask YC: Good compiler books?” ↗I would suggest that you read the beginner's guide first, then John Levine's Linkers and Loaders book, and how to write shared libraries. The last one is really comprehensive and can seem complex at first. You might want to see big picture first :)
on “Beginner's Guide to Linkers” ↗For anybody that is interested in executable formats and how they are created and used, the manuscript of the book "Linkers & Loaders" by John Levine is available for free (http://norfs.sourceforge.net/linkers_and_loaders.pdf).
on “PE - the Portable Executable Format on Windows” ↗I can't comment on its "goodness" but the textbook that sprang to mind is Linkers and Loaders: http://www.amazon.com/Linkers-Kaufmann-Software-Engineering-... The bad news is that it's from '99 but, as far as the foundations go, I can't imagine linkers back then were that different.
on “Common x86 Calling Conventions” ↗This may not be authoritative enough, but I found John Levine's "Linkers and Loaders" to be a very informative guide to the general concepts of linking, including the various architectures like ELF and COM. http://linker.iecc.com/ Edit: not that they're conventionally called "architectures"…
on “Show HN: How to write a tiny compiler” ↗Here's the site for Linkers and Loaders by John Levine: http://linker.iecc.com There are links to chapters available on that site.
on “Assemblers and Loaders (1993) [pdf]” ↗Yes, Linkers and Loaders is an excellent book. There's also this 20 part linker essay by Ian Lance Taylor who went on to write gold: http://inai.de/documents/Linkers.pdf https://events.linuxfoundation.org/slides/lfcs2010_taylor.pd...…
on “Assemblers and Loaders (1993) [pdf]” ↗>linkers and loaders Do you mean the book by John Levine? I had read it, it was good.
on “Urn: A Lisp implementation for Lua” ↗Very clear presentation. Helpful diagrams. Clean code. This has a very “Linkers and Loaders” (John Levine) feel to it. Very well done.
on “A Virtual Machine” ↗