cxcodemacosgccotool

List global variables in executable


How can I dump all the global variables and the address offsets in my executable?

This is on os x, app developed with xcode compiled with gcc.

Thank you


Solution

  • If Compiled to Mach-O

    Either use otool or the cctools.

    If Compiled to ELF

    You should be able to do this with objdump and/or readelf.

    I don't have a *nix system at hand here, but objdump -s -j .data should be getting you rather close enough.