syscall https://blog.rchapman.org/posts/Linux_System_Call_Table_for_x86_64/
at&a x86_64 https://nifengz.com/introduction_x64_assembly/
https://www.cs.cmu.edu/~fp/courses/15213-s07/misc/asm64-handout.pdf
https://blog.csdn.net/FreeeLinux/article/details/85042687
https://blog.csdn.net/iSpeller/article/details/12008905
https://www.cs.cmu.edu/~fp/courses/15213-s07/misc/asm64-handout.pdf
自定义.section https://blog.csdn.net/qq_16097611/article/details/73460115
https://stackoverflow.com/questions/6252812/what-does-the-aw-flag-in-the-section-attribute-mean
https://sourceware.org/binutils/docs/as/Section.html
elf https://blog.csdn.net/Linux_ever/article/details/78210089
Gnu汇编程序(GAS)中使用的CFI指令是什么?
https://cloud.tencent.com/developer/ask/102663
要禁用这些,请使用gcc选项:
-fno-asynchronous-unwind-tables
这是针对cfi_startproc的谷歌最重要的结果,因此很多人可能会来此禁用该输出:
-fno-dwarf2-cfi-asm
也可能需要。
GCC中的编译器堆栈保护技术-SSP
http://blog.sina.com.cn/s/blog_605f5b4f0101ey1m.html
-fstack-protector:
启用堆栈保护,不过只为局部变量中含有 char 数组的函数插入保护代码。
-fstack-protector-all:
启用堆栈保护,为所有函数插入保护代码。
-fno-stack-protector:
禁用堆栈保护。
如果你在源码编译成的汇编代码中看到有如下这样的指令,说明GCC编译时启用了堆栈保护。
在进入函数时将程序启动时随机生成的canary(%fs:40
处的8
字节)放在当前stack frame
上,
退出时再与原来的canary比较,如果不一致就说明出现栈溢出了。
movq %fs:40, %rax
movq %rax, -8(%rbp)
...
movq -8(%rbp), %rdx
xorq %fs:40, %rdx
je .L3
call __stack_chk_fail