繁体   English   中英

为什么 __libc_start_main 的地址在 GDB 中始终相同,即使 ASLR 已打开?

[英]Why is the address of __libc_start_main always the same inside GDB even though ASLR is on?

Breakpoint 1, 0x00007ffff7de8060 in __libc_start_main () from /usr/lib/libc.so.6
(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /home/firstlove/projects/org-ioslide/example/a.out 

Breakpoint 1, 0x00007ffff7de8060 in __libc_start_main () from /usr/lib/libc.so.6
(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /home/firstlove/projects/org-ioslide/example/a.out 

Breakpoint 1, 0x00007ffff7de8060 in __libc_start_main () from /usr/lib/libc.so.6
(gdb) Quit
(gdb) quit
A debugging session is active.

        Inferior 1 [process 16372] will be killed.

Quit anyway? (y or n) y
firstlove-pc% cat /proc/sys/kernel/randomize_va_space
2

IIUC,ASLR 应该随机化所有地址,包括libc.so ,但我发现__libc_start_main()在我的 Linux 机器上的地址总是0x00007ffff7de8060 ,为什么? 怎么了?

当您在gdb运行程序时, gdb尝试通过禁用地址随机化来帮助您进行调试。 您可以使用以下命令启用它(从程序的下一次运行开始生效):

set disable-randomization off

暂无
暂无

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

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