Linkers, Loaders & Executables
What is in the .text section of an executable?
- AThe program's machine instructions
- BThe text files the program uses
- CStrings typed in while it runs
Show answer and explanation
Answer: A. The program's machine instructions
The .text section contains the machine instructions translated from the functions. At run time it is normally readable and executable but not writable, which guards against stray writes and attackers rewriting code. And because it never changes, when several processes run the same program or shared library they can share a single copy in physical memory.
- A. Correct. Despite the name, it holds code, not text.
- B. Despite the name, it holds machine code.
- C. Input goes into run-time areas such as the heap or stack.