This change adds support for the setjmp(3)/longjmp(3)
family of functions on NetBSD.
There are three types of them on NetBSD:
- setjmp(3) / longjmp(3)
- sigsetjmp(3) / sigsetjmp(3)
- _setjmp(3) / _longjmp(3)
Due to historical and compat reasons the symbol
names are mangled:
- setjmp -> __setjmp14
- longjmp -> __longjmp14
- sigsetjmp -> __sigsetjmp14
- siglongjmp -> __siglongjmp14
- _setjmp -> _setjmp
- _longjmp -> _longjmp
This leads to symbol renaming in the existing codebase.
There is no such symbol as sigsetjmp/longsetjmp
on NetBSD
Add a comment that GNU-style executable stack
note is not needed on NetBSD. The stack is not
executable without it.
Sponsored by <The NetBSD Foundation>
I am somewhat disappointed by amount of copy-paste between netbsd and linux. I think we should do the same thing you did with sigaction_symname, because it's effectively the same problem.
I.e. (under !SANITIZER_MAC):
And then use setjmp_symname in the rest of the code.
I see that netbsd has 1 less setjmp flavor and 1 more longjmp flavor. So we could put 1 setjmp under #if SANITIZER_LINUX and 1 longjmp under #if SANITIZER_NETBSD.
Will this work?