mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2024-11-29 02:07:39 +01:00
Add unwind descriptors to getcontext.S
This commit is contained in:
parent
045c55b2a2
commit
215afa30b7
4 changed files with 9 additions and 1 deletions
|
@ -27,6 +27,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
.global _Ux86_getcontext
|
.global _Ux86_getcontext
|
||||||
.type _Ux86_getcontext, @function
|
.type _Ux86_getcontext, @function
|
||||||
_Ux86_getcontext:
|
_Ux86_getcontext:
|
||||||
|
.cfi_startproc
|
||||||
pushl %eax
|
pushl %eax
|
||||||
mov 8(%esp),%eax /* ucontext_t* */
|
mov 8(%esp),%eax /* ucontext_t* */
|
||||||
popl FREEBSD_UC_MCONTEXT_EAX_OFF(%eax)
|
popl FREEBSD_UC_MCONTEXT_EAX_OFF(%eax)
|
||||||
|
@ -81,6 +82,7 @@ _Ux86_getcontext:
|
||||||
|
|
||||||
xorl %eax, %eax
|
xorl %eax, %eax
|
||||||
ret
|
ret
|
||||||
|
.cfi_endproc
|
||||||
.size _Ux86_getcontext, . - _Ux86_getcontext
|
.size _Ux86_getcontext, . - _Ux86_getcontext
|
||||||
|
|
||||||
/* We do not need executable stack. */
|
/* We do not need executable stack. */
|
||||||
|
|
|
@ -36,6 +36,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
.global _Ux86_getcontext
|
.global _Ux86_getcontext
|
||||||
.type _Ux86_getcontext, @function
|
.type _Ux86_getcontext, @function
|
||||||
_Ux86_getcontext:
|
_Ux86_getcontext:
|
||||||
|
.cfi_startproc
|
||||||
mov 4(%esp),%eax /* ucontext_t* */
|
mov 4(%esp),%eax /* ucontext_t* */
|
||||||
|
|
||||||
/* EAX is not preserved. */
|
/* EAX is not preserved. */
|
||||||
|
@ -66,6 +67,7 @@ _Ux86_getcontext:
|
||||||
|
|
||||||
xor %eax, %eax
|
xor %eax, %eax
|
||||||
ret
|
ret
|
||||||
|
.cfi_endproc
|
||||||
.size _Ux86_getcontext, . - _Ux86_getcontext
|
.size _Ux86_getcontext, . - _Ux86_getcontext
|
||||||
|
|
||||||
/* We do not need executable stack. */
|
/* We do not need executable stack. */
|
||||||
|
|
|
@ -37,6 +37,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
.global _Ux86_64_getcontext
|
.global _Ux86_64_getcontext
|
||||||
.type _Ux86_64_getcontext, @function
|
.type _Ux86_64_getcontext, @function
|
||||||
_Ux86_64_getcontext:
|
_Ux86_64_getcontext:
|
||||||
|
.cfi_startproc
|
||||||
|
|
||||||
/* Callee saved: RBX, RBP, R12-R15 */
|
/* Callee saved: RBX, RBP, R12-R15 */
|
||||||
movq %r12, UC_MCONTEXT_GREGS_R12(%rdi)
|
movq %r12, UC_MCONTEXT_GREGS_R12(%rdi)
|
||||||
|
@ -70,7 +71,9 @@ _Ux86_64_getcontext:
|
||||||
/* Save rflags and segment registers, so that sigreturn(2)
|
/* Save rflags and segment registers, so that sigreturn(2)
|
||||||
does not complain. */
|
does not complain. */
|
||||||
pushfq
|
pushfq
|
||||||
|
.cfi_adjust_cfa_offset 8
|
||||||
popq UC_MCONTEXT_RFLAGS(%rdi)
|
popq UC_MCONTEXT_RFLAGS(%rdi)
|
||||||
|
.cfi_adjust_cfa_offset -8
|
||||||
movl $0, UC_MCONTEXT_FLAGS(%rdi)
|
movl $0, UC_MCONTEXT_FLAGS(%rdi)
|
||||||
movw %cs, UC_MCONTEXT_CS(%rdi)
|
movw %cs, UC_MCONTEXT_CS(%rdi)
|
||||||
movw %ss, UC_MCONTEXT_SS(%rdi)
|
movw %ss, UC_MCONTEXT_SS(%rdi)
|
||||||
|
@ -95,6 +98,7 @@ _Ux86_64_getcontext:
|
||||||
|
|
||||||
xorq %rax, %rax
|
xorq %rax, %rax
|
||||||
retq
|
retq
|
||||||
|
.cfi_endproc
|
||||||
.size _Ux86_64_getcontext, . - _Ux86_64_getcontext
|
.size _Ux86_64_getcontext, . - _Ux86_64_getcontext
|
||||||
|
|
||||||
/* We do not need executable stack. */
|
/* We do not need executable stack. */
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
./test-ptrace -c -n -t ./mapper
|
./test-ptrace -c -n -t ./mapper $*
|
||||||
|
|
Loading…
Reference in a new issue