Linkers, Loaders & Executables
What happens when the strip command is applied to an executable?
- AThe machine instructions are optimized and run faster
- BThe executable is encrypted so others cannot run it
- CSymbol tables and debug information are removed; the file shrinks, but debuggers can no longer show function names and the like easily
Show answer and explanation
Answer: C. Symbol tables and debug information are removed; the file shrinks, but debuggers can no longer show function names and the like easily
An executable may contain a symbol table listing function and variable names, and debug information mapping code to source lines. These are not needed to run, so removing them with strip makes the file smaller. Function names and line numbers are then unavailable when investigating bugs, so the information is sometimes kept separately before stripping. Symbols needed for dynamic linking remain.
- A. The instructions are unchanged, so speed is unchanged.
- B. It does not encrypt anything.
- C. Correct. It removes information not needed for execution.