[patch i386, 2/2] skip insns generated by -fstack-protector

Yao Qi yao@codesourcery.com
Fri Dec 24 09:36:00 GMT 2010


On 12/24/2010 04:21 PM, Yao Qi wrote:
> Patch 2 is about handling i386 stack protector insns during prologue
> analysis.  Without patch 1, patch 2 doesn't work in some cases.

Here is a prologue generated by GCC, instructions on [1] are for stack 
protector.

      push   %ebp
      mov    %esp,%ebp

      and    $0xfffffff0,%esp
      add    $0xffffff80,%esp

      mov    %gs:0x14,%eax   // <---- [1]
      mov    %eax,0x7c(%esp) // <---- [1]
      xor    %eax,%eax       // <---- [1]

Compared with instructions for arm stack protector, i386's counterpart 
is relatively simpler.  This patch is to handle them in prologue 
parsing.  Comments are welcome.

-- 
Yao Qi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: i386_skip_stack_protector_1224.patch
Type: text/x-patch
Size: 1884 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20101224/89146f82/attachment.bin>


More information about the Gdb-patches mailing list