New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link against crt* to support C++ global constructor / destructor #2

merged 1 commit into from May 31, 2017


None yet
2 participants

ids1024 commented May 31, 2017

This also requires changes to crt0 in newlib.

@ids1024 ids1024 referenced this pull request May 31, 2017


Port C code to Rust #7


This comment has been minimized.


jackpot51 commented May 31, 2017


@jackpot51 jackpot51 merged commit af9fbec into redox-os:redox May 31, 2017

@ids1024 ids1024 deleted the ids1024:ctor branch May 31, 2017

jackpot51 pushed a commit that referenced this pull request Dec 14, 2018

libgcc/CET: Skip signal frames when unwinding shadow stack
When -fcf-protection -mcet is used, I got

FAIL: g++.dg/eh/sighandle.C

(gdb) bt
 #0  _Unwind_RaiseException (exc=exc@entry=0x416ed0)
    at /export/gnu/import/git/sources/gcc/libgcc/
 #1  0x00007ffff7d9936b in __cxxabiv1::__cxa_throw (obj=<optimized out>,
    tinfo=0x403dd0 <typeinfo for int@@CXXABI_1.3>, dest=0x0)
    at /export/gnu/import/git/sources/gcc/libstdc++-v3/libsupc++/
 #2  0x0000000000401255 in sighandler (signo=11, si=0x7fffffffd6f8,
    at /export/gnu/import/git/sources/gcc/gcc/testsuite/g++.dg/eh/sighandle.C:9
 #3  <signal handler called> <<<< Signal frame which isn't on shadow stack
 #4  dosegv ()
    at /export/gnu/import/git/sources/gcc/gcc/testsuite/g++.dg/eh/sighandle.C:14
 #5  0x00000000004012e3 in main ()
    at /export/gnu/import/git/sources/gcc/gcc/testsuite/g++.dg/eh/sighandle.C:30
(gdb) p frames
$6 = 5

frame count should be 4, not 5.  This patch skips signal frames when
unwinding shadow stack.


	PR libgcc/85334
	* g++.dg/torture/pr85334.C: New test.


	PR libgcc/85334
	* unwind-generic.h (_Unwind_Frames_Increment): New.
	* config/i386/shadow-stack-unwind.h (_Unwind_Frames_Increment):
	* (_Unwind_RaiseException_Phase2): Increment frame
	count with _Unwind_Frames_Increment.
	(_Unwind_ForcedUnwind_Phase2): Likewise.

git-svn-id: svn+ssh:// 138bc75d-0d04-0410-961f-82ee72b054a4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment