Matty wrote: > Howdy, > > While troubleshooting some problems last week, I needed to locate the > value of a symbol in the .data segment. This required me to perform > the following steps: > > 1. Use nm to locate the symbol name and offset from .data > > 2. Run readelf to locate the address of the .data segment > > 3. Execute hexdump to dump the binary, and then locate the value by > adding the values > from steps 1 and 2. > > I was curious if there is an easier way to do this? I perused the > manual pages for nm, readelf and dump, and wasn't able to locate an > option to do this. Hopefully there is something like "nm -value > foosymbol libfoo.so," and I missed it while reading through the manual > pages. > > Thanks for any insight, > - Ryan
Use mdb: barts at cyber:/tmp 133% !! mdb /lib/libc.so.1 Loading modules: [ libc.so.1 ] > thread_max_spinners > thread_max_spinners/D libc.so.1`thread_max_spinners: libc.so.1`thread_max_spinners: 100 > - Bart -- Bart Smaalders Solaris Kernel Performance barts at cyber.eng.sun.com http://blogs.sun.com/barts