Alright, so I was messing around with this thing called “nm” today, and let me tell you, it was a bit of a journey. I wanted to see what symbols were hiding inside some object files. You know, get a peek under the hood.

Getting Started
First, I made sure I had the right tools. Usually, `nm` comes bundled with the GNU Binutils, so if you’ve got a build environment set up, you’re probably good to go. I just typed `nm –version` into my terminal to double-check, and yep, it was there.
Digging In
Then, I navigated to the directory where my object files were chilling. These were just some `.o` files I had from compiling some C code earlier. Nothing fancy.
I started simple, running `nm myobject.o`. Boom! A whole bunch of stuff scrolled by. I saw a mix of letters and names. Some were familiar function names, others were…well, less clear.
Making Sense of it All
The output was a little overwhelming at first. So, I did some quick searching. Turns out, those letters next to the symbols mean something!
- T: These were functions defined in my code, sitting in the text (code) section.
- D: Initialized data, like global variables with values assigned.
- B: Uninitialized data variables.
- U: Undefined symbols. These were things my code used but weren’t actually defined in that file. Like, maybe I called a function from a library.
Now I felt like I was getting somewhere! I started to recognize what was going on in my code at a lower level.

Playing with Options
I got a little bolder and tried some of the `nm` options. For example using `nm -g file.o` I got only a list of global defined variables.
Also using `nm -u file.o` I got only a list of undefined variables.
Wrapping Up
So, that was my adventure with `nm` today. It’s not something I use every day, but it’s a cool tool to have in your back pocket. It’s like having X-ray vision for your object files! Definitely helps when you’re trying to figure out what’s going on behind the scenes, or maybe debugging some weird linking issue.