全部书籍

专业

应用 关于 Coach 登录 开始阅读

书籍暂未推出简体中文版——当前显示英文版。

Computer Science · 术语表

什么是 Compiler, object file, linker, executable?

又称: compiler · compilation · object file · symbol (of an object file) · linker · executable file · linking · undefined reference

Definition 1.2 University Computer Science — Year 1 · 第 1 章 — From Source Code to a Running Program

A compiler translates a program from one language into another, here from C into the assembly language of the processor; the translation is called compilation. The assembler then encodes the assembly as machine code in an object file: machine code with holes, together with a table of the names it defines and the names it uses. Each name in that table is a symbol. The linker combines object files and libraries into one executable file, a file the operating system can load and start; this step is linking, and a used symbol that no input defines is an undefined reference.

The four stages of a C build. Each arrow is a separate program; gcc runs them in turn, and the options -E, -S and -c stop it after the first, second or third. The linker fills the holes left in the object file with the addresses of the library’s code.
The four stages of a C build. Each arrow is a separate program; gcc runs them in turn, and the options -E, -S and -c stop it after the first, second or third. The linker fills the holes left in the object file with the addresses of the library’s code.

示例

在原文中阅读 →