
What’s Inside Your .o File? A Beginner-Friendly Guide to the Linux nm Command
What Is the nm Command? nm is a Linux command that shows the symbols from symbol table of an object file or executable. In simple words: nm tells you what functions and variables exist inside a compiled file. It is commonly used after compilation to inspect what got created inside the object file. nm file.o what is symbol ? A symbol is simply a name that represents something in your program.A symbol in C programming is simply the name of a function or global variable that the compiler records inside a compiled file so that the linker and other parts of the system can identify and connect different pieces of code together That “ something ” is usually: A function A global variable Symbol table | Symbol | Meaning | Simple Explanation | | ------ | ------------- | ----------------------------- | | T | Text (global) | Global function | | t | Text (local) | Static function | | D | Data (global) | Global initialized variable | | d | Data (local) | Static initialized variable | | B | BSS (glob
Continue reading on Dev.to
Opens in a new tab
