Here is a small mystery. You have written a stock-keeping program in C, and on your laptop it works. The accountant of a cooperative wants it on the office server, which runs Linux on an ARM processor. You copy the file across, type its name, and the server answers: cannot execute binary file: Exec format error. The same week a colleague sends you Report.exe, a C# program built on Windows. Nobody expects it to work on that Linux server, and yet it runs, as long as the server has a .NET runtime installed. Both files are called "executables". One refuses to start and the other starts happily. What is actually inside these files?
Last chapter ended with the compiler's six phases, and the last of them produced machine code. That machine code is still not a program you can run. It sits in an object file with blanks in it, it must be joined to other code, someone has to put it into memory, and then comes the question of this opening: can the file travel to another kind of computer at all? This chapter follows the file through those last steps.
By the end you will be able to read a symbol table and say what the linker does with it, and tell a linker error from a loader error by its message. You will explain static and dynamic linking, say what the loader does when you press Enter, and name the bootstrap loader that starts a whole computer. You will write the skeleton of a program in C, C++, Java, Python and C#, and say why each line is there. You will explain bytecode and a virtual machine with real listings from three of them, say what a JIT compiler does, and answer "what is platform-independent software?" with a proper example. And you will answer the written question that banks keep asking: what is the .NET Framework, and what are its components?