标签:sys oca gcc desktop 参数 root inux linux asm
C代码示例:
#include <stdio.h>
#include <stdlib.h>
int main()
{
printf("hello world!\n");
exit(0);
}
编译运行参数如下:
[root@localhost Desktop]# gcc -o hello hello.c
[root@localhost Desktop]# ./hello
关闭
[root@localhost Desktop]# echo 0 >/proc/sys/kernel/randomize_va_space
开启
[root@localhost Desktop]# echo 1 >/proc/sys/kernel/randomize_va_space
C测试示例代码:
#include <stdio.h>
unsigned long sp(void){ asm("mov %rsp, %rax");}
int main(void)
{
unsigned long esp = sp();
printf("Stack pointer (ESP : 0x%lx)\n",esp);
return 0;
}
标签:sys oca gcc desktop 参数 root inux linux asm
原文地址:https://www.cnblogs.com/17bdw/p/9074474.html