News for hackers. Stuff that matters.
Re:Beginner's Guide to Linkers (2010) by QuamStiver on Monday September 02, 2019 @06:04AM (#20857996)
Similar to this, can anyone recommend a good book on linking/loading? I'm mostly looking for something about the process in Linux, but a general reference to common techniques would also be an interesting read. Bonus points if it was published this century.
Re:Beginner's Guide to Linkers (2010) by CalChris on Monday September 02, 2019 @08:29PM (#20862755)
As mentioned above, Linkers & Loaders by John R. Levine is still a fine book, the Dragon Book of linking. Basically, linking hasn't changed much in 70 years with the minor exception of shared libraries. So I'd recommend that and the Oracle® Solaris 11.3 Linkers and Libraries Guide is 534 pages and gives you an idea of every feature in a fully supported linker. It is ELF specific.

I'd skip gold (ELF specific, GPL) and just study LLD (faster, ELF, COFF, mach-O, BSD). Avoid GNU ld altogether. Adding support to LLD for RISC-V was like a couple of hundred lines of code. Peter Smith has a couple of good talks on LLD.

https://www.youtube.com/watch?v=FiBg0jg4pHk

https://archive.fosdem.org/2019/schedule/event/llvm_lld/