【发布时间】:2020-01-16 15:02:26
【问题描述】:
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 之一,但是我发现我的Linux 机器上__libc_start_main() 的地址总是0x00007ffff7de8060,为什么?怎么了?
【问题讨论】:
-
地址空间随机化是否也随机化函数地址或仅随机化变量地址?
-
如果您启动一个新的 gdb 会话来检查地址,而不是在同一个 gdb 会话中重新运行程序,您会看到相同的结果吗?
-
@JohnBollinger 我已经试过了