diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2009-11-13 06:58:12 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2009-11-13 06:58:12 +0000 |
commit | eca9d807a129c291857e2c8c1d75a5ce90f8587a (patch) | |
tree | 96083afa0300d0851a99268d059db52913306c75 | |
parent | 7274deff738213914a31413a9d1a671020694175 (diff) | |
download | gcc-eca9d807a129c291857e2c8c1d75a5ce90f8587a.zip gcc-eca9d807a129c291857e2c8c1d75a5ce90f8587a.tar.gz gcc-eca9d807a129c291857e2c8c1d75a5ce90f8587a.tar.bz2 |
linux-unwind.h (x86_frob_update_context): New function.
* config/i386/linux-unwind.h (x86_frob_update_context): New function.
(MD_FROB_UPDATE_CONTEXT): Define.
From-SVN: r154141
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/config/i386/linux-unwind.h | 19 |
2 files changed, 24 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ca0c28e..238cd22 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2009-11-13 Eric Botcazou <ebotcazou@adacore.com> + + * config/i386/linux-unwind.h (x86_frob_update_context): New function. + (MD_FROB_UPDATE_CONTEXT): Define. + 2009-11-12 Eric Botcazou <ebotcazou@adacore.com> Laurent GUERBY <laurent@guerby.net> diff --git a/gcc/config/i386/linux-unwind.h b/gcc/config/i386/linux-unwind.h index 89f238a..36ee370 100644 --- a/gcc/config/i386/linux-unwind.h +++ b/gcc/config/i386/linux-unwind.h @@ -172,6 +172,25 @@ x86_fallback_frame_state (struct _Unwind_Context *context, fs->signal_frame = 1; return _URC_NO_REASON; } + +#define MD_FROB_UPDATE_CONTEXT x86_frob_update_context + +/* Fix up for kernels that have vDSO, but don't have S flag in it. */ + +static void +x86_frob_update_context (struct _Unwind_Context *context, + _Unwind_FrameState *fs ATTRIBUTE_UNUSED) +{ + unsigned char *pc = context->ra; + + /* movl $__NR_rt_sigreturn,%eax ; {int $0x80 | syscall} */ + if (*(unsigned char *)(pc+0) == 0xb8 + && *(unsigned int *)(pc+1) == 173 + && (*(unsigned short *)(pc+5) == 0x80cd + || *(unsigned short *)(pc+5) == 0x050f)) + _Unwind_SetSignalFrame (context, 1); +} + #endif /* not glibc 2.0 */ #endif /* ifdef __x86_64__ */ #endif /* ifdef inhibit_libc */ |