Jump to ratings and reviews
Rate this book

Linkers and Loaders

Rate this book
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 create faster, cleaner code. You'll learn to avoid the pitfalls associated with Windows DLLs, take advantage of the space-saving, performance-improving techniques supported by many modern linkers, make the best use of the UNIX ELF library scheme, and much more. If you're serious about programming, you'll devour this unique guide to one of the field's least understood topics. Linkers & Loaders is also an ideal supplementary text for compiler and operating systems courses.

*Includes a linker construction project written in Perl, with project files available for download. *Covers dynamic linking in Windows, UNIX, Linux, BeOS, and other operating systems. *Explains the Java linking model and how it figures in network applets and extensible Java code. *Helps you write more elegant and effective code, and build applications that compile, load, and run more efficiently.

272 pages, Paperback

First published October 11, 1999

49 people are currently reading
394 people want to read

About the author

John R. Levine

100 books8 followers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
63 (38%)
4 stars
64 (38%)
3 stars
29 (17%)
2 stars
9 (5%)
1 star
0 (0%)
Displaying 1 - 15 of 15 reviews
Profile Image for Steve.
79 reviews26 followers
January 13, 2013
Definitely worth reading if you write native code for a living (or hobby).

Published in 2000, it covers Linux (ELF and a.out), Windows (COFF) and a huge mess of older obsure object formats and linking systems. Pretty much the only book of it's kind and a great primer if you're interested in writing your own linker or loader for an OS or just need to better understand native executables.

It sometimes got lost in the ghosts of systems past like the IBM 360 object format, DOS .OBJ files (Intel OMF), real mode (ugh). My only semi-complaint is that it spent a lot of pages talking about real mode but being published in 2000, we were less than a decade removed from that fever dream of backwards compatibility.
Profile Image for Peter Sichevsky.
20 reviews8 followers
November 15, 2019
This is a 'must read' book for software developers, it CONTAINS a lot of best practices and advices that are proven to be useful.
Profile Image for Michael Pankov.
11 reviews8 followers
February 26, 2013
You barely can understand linkers by this book since it falls into implementation details of each specific OS and CPU too early. In the end, the book presents recollection of dirty hacks from existing (and dated) implementation, however with explanations why there're these hacks in the first place. But I'd rather have a book on design of new linkers and loaders, or at least in-depth analysis of at least one loader. I understand new loaders are very rarely designed, but anyway, this book is of no help when they do.
69 reviews
March 22, 2019
Although very old, this is probably the book on the present subject. The book itself is not necessarily outdated, because the principles haven't changed, but the description of some file formats is certainly outdated.

I read it because I wanted to learn more about the linking process in particular, but I got the impression that this is more oriented towards the writer of a linker and/or loader.

Thus there is some prerequisite knowledge the author assumes you already have. I think an Operating Systems course and at least a basic understanding of assembly language (and related knowledge like registries, counters, stack, etc.) are required to get something out of the book. Although I am a practicing C programmer and I consider I have the aforementioned knowledge, there were still parts of the book I didn't understand.

The best part of the book for me was the last 3 chapters, which describe static and dynamic shared libraries in more depth and some advanced techniques in linking, like for C++ or Java.

What I didn't like is that you can't read only the parts of the book that interests you, because the author is often referencing previous information from the book. This would normally be fine, but in this case, I would have liked to skip stuff I have no interest for, like SPARC or IBM 360.
29 reviews
Read
August 8, 2023
I've been tinkering with building an emulator for the PS4 and this book has been indispensable in understanding how dynamic linking and loading works in detail. Linkers and Loaders are a fundamental part of modern software linking together assets with different rates of change (libraries which change rarely with applications which change more often). Fascinating to see how this system evolved and everyone converged on a similar set of solutions.

These parts of systems everyone depends on but few understand are opportunities to more deeply understand a critical system. There's always an edge where no one is looking. [Just see Apple's recent improvement in linker and loader performance](https://developer.apple.com/videos/pl...) and projects like [mold](https://github.com/rui314/mold)
Profile Image for Bhaskar Chowdhury.
34 reviews3 followers
January 14, 2021
Well, such an important and essential topic, or should I say,the crux of the every possible software program execution on any environment .

Enjoyed very much , brushed and enhanced my understanding ,hope this will do a hell lot of good for me to poking into some of the stuff I dealt with day by day basis.

This book written in extremely easy and consumable manner. Anybody , who has little understanding of computer can easily grasp at ease.

Recommended, to the curious people wanted to know the inner working and importantly enhance the understanding of their curiosity.
Profile Image for Rohit Goswami.
343 reviews74 followers
June 27, 2021
4.5, rounded down. Unfortunately though I normally have given this five stars, I just can't in all honesty recommend this to most people, even though it's really well written. I considered rounding down for obsolete hardware. This was a much denser read than expected. Much of the underlying architecture described is obsolete but, the linkers and loaders, along with the projects remain evergreen and are a fantastic resource. It'd be nice to have time to come back to it and write the projects but it's definitely still the best book on linking which is normally just left to shrugs.
Profile Image for psyomn.
9 reviews
August 8, 2019
Very good, in depth book on object formats (on a multitude of systems), and how linkers employ a bunch of hacks for the most part, to tie everything together and function.

Now the bad part is that there is too much information on obsolete systems, that may clutter some of the more detailed workings of the linker on a particular format. Would be a great resource if you're dealing with those older formats.

Overall, great book, but dated.
12 reviews
December 18, 2021
Quality book, still holds up fairly well despite being decades old

Negatives: fair amount of errors, so you need to consult the webpage errata. No solutions to exercises available.

As an embedded engineer, by the end of the book I felt more and more things were unnecessary.

If you are looking an intro into writing linkers, this would be a good place to start. Even if you're not, at least skim through the book to get a better understanding of linkers.
Profile Image for Jason.
173 reviews6 followers
November 18, 2018
The book is certainly dated. But still very useful and a great introduction to linkers and loaders. I wish I had read this book 10 years ago when I was still working with a custom loader implementation.
52 reviews1 follower
September 18, 2017
Given that it is now around 20 years old, and contains a lot of historical references, the relevancy
of the content is so-so. Still a great book on the subject.
Profile Image for David Lindelof.
44 reviews20 followers
November 13, 2013
You may have written hundreds, maybe thousands of programs, but if you are like most programmers then everything that happens after the compilation is kind of mysterious. Why does the compiler have to create object files? What are they? What is this so-called linker who combines those files into a library, or an executable? What's its purpose? John Levine's book answers those questions, and more.

Item 53 in 97 Things Every Programmer Should Know: Collective Wisdom from the Experts is "The Linker Is not a Magical Program", and this book goes a long way towards taking that magic away. It carefully explains step by step what happens from the moment the code is compiled until it actually runs on the machine; and what's more important, it makes it very clear why things are as they are today.

I was recommended this book in a reply to a Stackoverflow question, and I am not disappointed. The book goes occasionally perhaps a little bit too much into technical details, which I felt could be safely skipped. Perhaps a case study, i.e. going through every single step towards running a complete program, would have been useful, instead of exposing how different systems solve the different steps one by one.

Until I read this book I simply did not understand how a program actually ran on my computer. A few details are still a bit fuzzy, but now I feel much better equipped for dealing with obscure linker errors or custom linker scripts. Highly recommended for any programmer who wants to get to the bottom of things.
28 reviews
January 29, 2008
I tried this out because of Greg Wilson's recommendation at http://www.third-bit.com/reading.html at a point where I was wrestling with some shared library implementation questions.

The book was a little too specific for me and I couldn't get much out of it. My takeaway is that the basic principles of linkers and loaders are straightforward enough but that every single specific implementation is a collection of nasty hacks influenced by the operating system and hardware.

I came away thinking that there must be a better set of references online by now; if I had to guess I would start off at Wikipedia.
Profile Image for Carlos O'Donell.
17 reviews1 follower
December 10, 2010
This is an *excellent* introduction into the requirements of both static linkers and dyanmic linkers (loaders). It is a must read for anyone who is thinking about hacking on a linker or loader e.g. the GNU linker or the dynamic loader in the GNU C library.
Displaying 1 - 15 of 15 reviews

Can't find what you're looking for?

Get help and learn more about the design.