简体   繁体   English

使用 GDB 获取共享库的基地址

[英]Get base address of share library using GDB

How can I get the base address of share library using GDB?如何使用 GDB 获取共享库的基地址?

I couldn't find any easy way.我找不到任何简单的方法。

You can use info sharedlibrary :您可以使用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.请注意,由于 ASLR,每次调用的加载地址都会不同。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM