Get base address of share library using GDB

Viewed 325

How can I get the base address of share library using GDB ?

I couldn't find any easy way.

1 Answers

You can use info sharedlibrary:

$ gdb -ex 'b main' -ex r --args bash --help
(gdb) pipe info sharedlibrary | grep libtinfo
0x00007ffff7f8e6a0  0x00007ffff7f9c17c  Yes (*)     /lib/x86_64-linux-gnu/libtinfo.so.6

Note that load address will be different on each invocation due to ASLR.

Related