PDA

View Full Version : Viewing object files



perenshaw
November 5th, 2005, 11:51 PM
I want to know how to view *.o (object files) in ubuntu, but don't know what program to use - tried scite and gedit

Remmelas
November 5th, 2005, 11:57 PM
not sure why you would want to view compiler output, but they are binary files(compiler output), so i doubt you will find anything that views them in any human readable fashion.(maybe a decompiler), but, then, if you have object files, you likely have the source they were created from.

perenshaw
November 5th, 2005, 11:59 PM
k, thanks, jus wondrin, i can be curious at times.:)

Remmelas
November 6th, 2005, 12:04 AM
Tis how we learn, right?

stuporglue
November 6th, 2005, 12:12 AM
If you're really desparate/curious, you'd probably use a hex editor. If you happen to use Vim, you can view it there. To view it in Hex in Vim the commands are* "%!xxd" (to hex) and "%!xxd -r" (from hex). If you use Gvim (easier!) you can use the Tools menu.

*If you don't know Vim, you'd have to learn it first as Vim has a steep learning curve. Once you learn it though, it's pretty handy.

toojays
November 6th, 2005, 12:18 AM
The nm program will show you the symbols which are present in an object file, which can be very useful sometimes. Similarly, objdump will decompile the object to assembly, which also has its uses.