Conversation

@regehr My answer used to be Linkers and Loaders, too, but lately I've been pointing students at https://www.toolchains.net/ !

0
1
0

@regehr I still am constantly confused by this mess and I’ve written PE parsers like 4 times

1
0
0

@regehr i learned in 15-213 intro to systems programming. hilariously, frank pfenning was teaching it.

0
0
0

@regehr Executable and object file formats (ELF, Mach-O, PE) & debugging data formats (DWARF, PDB) in general: https://github.com/MattPD/cpplinks/blob/master/executables.md

Linking and loading in particular: https://github.com/MattPD/cpplinks/blob/master/executables.linking_loading.md

(^- both the blog post series and the talks above can be pretty good, depending on the topic).

0
0
0

@regehr Nowadays I would recommend reading the mold source code as a replacement for Levine's book. It also has a lot of explanatory text, e.g. the block comment at the top here is probably the best summary of how LTO works: https://github.com/rui314/mold/blob/main/elf/lto-unix.cc

0
4
0

@regehr Well, I am Old, so I learned about it when a.out got deprecated and I suddenly had to read the GNU binutils documentation. But I had already had something of an introduction from trying to build programs for AIX and understand what `-Bnodelcsect` was and why it was needed. Oh, and I probably spent some time trying to understand unexec() as a part of bootstrapping Emacs on some platform or other. If there was an actual book I never saw it.

1
0
0

@regehr I think I probably learned by reading the readelf documentation tbh, oh and maybe that post about how to make pathologically small but still valid ELF executables.

1
0
0

@regehr As an aside I still don't know how to get the pdb name without calling dumpbin yet :(

0
0
0

@regehr Although there was a required class called "systems programming", the main project of which was IIRC writing a two-pass assembler for a restricted dialect of S/360 assembly, and I for some reason thought I could do it in C++ and spent the entire course totally confused. (It didn't help that the instructor spoke barely intelligible English and the textbook was from like 1979.)

0
0
0

@regehr yeah, that was (and presumably still is) the official book for the course, though i’m mostly thinking of a particular homework assignment that i’m not sure is drawn from any particular part of the book

0
0
0
@regehr Linkers and loader is by far the best and it has depth, and is just a great piece of text. And still fully valid. The more recent books are pretty dull compared to it, and more like tool guides than great prose.
1
0
2
@regehr Other than that I appreciate a lot a book called Embedded Linux Primer. It has all the essential pieces of Linux kernel binary de-construction and power on (initcalls, kernel command-line etc.).
0
0
1

@regehr @hovav It has links to Ian Lance Taylors 20-part Linker introduction from which I learned a lot (while at the same time reading Levines Linkers&Loaders book.

Here is Julia Evans quick recap of the content of the first half of Ians article series: https://jvns.ca/blog/2013/12/10/day-40-learning-about-linkers/

0
0
0

@regehr I learned these things by reading manuals and messing around. I've never read a book about a specific system or product. Maybe reading a book upfront would be more efficient, but there's no time for that when you have a problem to solve.

0
0
0