美文网首页
2018-03-30

2018-03-30

作者: 韦恩老爷 | 来源:发表于2018-04-18 08:54 被阅读0次

fortify-source

the fortify-source will make functions like strcat to __strcat_chk... Its a builtin optimization way in modern gcc
to close it, you can add -fno-stack-protector -D_FORTIFY_SOURCE=0 in the CFLAGS.

it's interesting that the -Os optimizationi option will add -D_FORTIFY_SOURCE=2 internally

another thing is that if there is a FOTIFY_SOURCE configure in configure.in
you should add

CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE -D_FORTIFY_SOURCE=0"

in configure.in
and then

export CPPFLAGS=-D_FORTIFY_SOURCE=0
export CFLAGS=-D_FORTIFY_SOURCE=0
./configure && make

no return

there is no ret instruction in the void defination functions.
because in this program, the JS_throw will call abort(), so the compiler wont return to here ...

protect methods

https://introspelliam.github.io/2017/09/30/linux%E7%A8%8B%E5%BA%8F%E7%9A%84%E5%B8%B8%E7%94%A8%E4%BF%9D%E6%8A%A4%E6%9C%BA%E5%88%B6/

two choice now

  1. the stackoverflow
  2. the jsC_error

相关文章

网友评论

      本文标题:2018-03-30

      本文链接:https://www.haomeiwen.com/subject/rgmbcftx.html