summaryrefslogtreecommitdiff
path: root/libexec/ld.so
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2014-07-09 07:05:49 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2014-07-09 07:05:49 +0000
commit163e621a2980bfdad3947546dae7b9d31fafb686 (patch)
tree184fe6db367718cfaed4cd7e80457b88d1540e03 /libexec/ld.so
parent76ac0225d5f126cea5ec82ad549c646b81332cdb (diff)
Fix backtraces through _dl_bind_start by adding dwarf annotations for
the stack adjustments/handling in the asm. Based on FreeBSD. ok kettenis@ matthew@
Diffstat (limited to 'libexec/ld.so')
-rw-r--r--libexec/ld.so/amd64/ldasm.S47
1 files changed, 46 insertions, 1 deletions
diff --git a/libexec/ld.so/amd64/ldasm.S b/libexec/ld.so/amd64/ldasm.S
index 19e703f750f..c1556c39ddb 100644
--- a/libexec/ld.so/amd64/ldasm.S
+++ b/libexec/ld.so/amd64/ldasm.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldasm.S,v 1.15 2014/07/06 07:28:36 otto Exp $ */
+/* $OpenBSD: ldasm.S,v 1.16 2014/07/09 07:05:48 guenther Exp $ */
/*
* Copyright (c) 2002,2004 Dale Rahn
@@ -98,6 +98,7 @@ DL_SYSCALL(lstat)
DL_SYSCALL(utrace)
DL_SYSCALL(getentropy)
DL_SYSCALL2(getcwd,__getcwd)
+DL_SYSCALL2(set_tcb,__set_tcb)
DL_SYSCALL2(_syscall,__syscall)
DL_SYSCALL2(sysctl,__sysctl)
@@ -128,16 +129,38 @@ _dl_sigprocmask:
.global _dl_bind_start
.type _dl_bind_start,@function
_dl_bind_start:
+ .cfi_startproc
+ .cfi_adjust_cfa_offset 16
pushfq # save registers
+ .cfi_adjust_cfa_offset 8
+ /*.cfi_offset %rflags, -16 */
pushq %rax
+ .cfi_adjust_cfa_offset 8
+ .cfi_offset %rax, -24
pushq %rcx
+ .cfi_adjust_cfa_offset 8
+ .cfi_offset %rcx, -32
pushq %rdx
+ .cfi_adjust_cfa_offset 8
+ .cfi_offset %rdx, -40
pushq %rsi
+ .cfi_adjust_cfa_offset 8
+ .cfi_offset %rsi, -48
pushq %rdi
+ .cfi_adjust_cfa_offset 8
+ .cfi_offset %rdi, -56
pushq %r8
+ .cfi_adjust_cfa_offset 8
+ .cfi_offset %r8, -64
pushq %r9
+ .cfi_adjust_cfa_offset 8
+ .cfi_offset %r9, -72
pushq %r10
+ .cfi_adjust_cfa_offset 8
+ .cfi_offset %r10, -80
pushq %r11
+ .cfi_adjust_cfa_offset 8
+ .cfi_offset %r11, -88
movq 80(%rsp), %rdi # Copy of reloff
movq 88(%rsp), %rsi # Copy of obj
@@ -145,16 +168,38 @@ _dl_bind_start:
movq %rax,88(%rsp) # Store function to be called in obj
popq %r11 # restore registers
+ .cfi_adjust_cfa_offset -8
+ .cfi_restore %r11
popq %r10
+ .cfi_adjust_cfa_offset -8
+ .cfi_restore %r10
popq %r9
+ .cfi_adjust_cfa_offset -8
+ .cfi_restore %r9
popq %r8
+ .cfi_adjust_cfa_offset -8
+ .cfi_restore %r8
popq %rdi
+ .cfi_adjust_cfa_offset -8
+ .cfi_restore %rdi
popq %rsi
+ .cfi_adjust_cfa_offset -8
+ .cfi_restore %rsi
popq %rdx
+ .cfi_adjust_cfa_offset -8
+ .cfi_restore %rdx
popq %rcx
+ .cfi_adjust_cfa_offset -8
+ .cfi_restore %rcx
popq %rax
+ .cfi_adjust_cfa_offset -8
+ .cfi_restore %rax
popfq
+ .cfi_adjust_cfa_offset -8
+ /*.cfi_restore %rflags */
leaq 8(%rsp),%rsp # Discard reloff, do not change eflags
+ .cfi_adjust_cfa_offset -8
ret
+ .cfi_endproc