summaryrefslogtreecommitdiff
path: root/libexec/ld.so/hppa/ldasm.S
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2013-06-01 09:57:59 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2013-06-01 09:57:59 +0000
commit68aee1affc9e9f623b3824770f05f34d7c2fe60a (patch)
treeff6bb4ec4eab9b40d691aebff013e69dbf58683a /libexec/ld.so/hppa/ldasm.S
parentef21a2cb5b0d81e925c90a50449ba06a311298e0 (diff)
Introduce ltrace(1). This tool works with ld.so to inject utrace record for
each plt call, allowing to trace a binary linked against shared library at the public function call level. To do so, ltrace(1) sets up some environment variables to enable plt tracing in ld.so, and invokes ktrace(2) for utrace events. ld.so will force lazy binding and will send an utrace record in the plt resolver, without updating the plt. Minimal filtering capabilities are provided, inspired by Solaris' truss -u, to limit tracing to libraries and/or symbol names. Non-traced libraries and symbols will have the regular resolver processing, with the expected plt update. "Get it in" deraadt
Diffstat (limited to 'libexec/ld.so/hppa/ldasm.S')
-rw-r--r--libexec/ld.so/hppa/ldasm.S13
1 files changed, 9 insertions, 4 deletions
diff --git a/libexec/ld.so/hppa/ldasm.S b/libexec/ld.so/hppa/ldasm.S
index 644b0ddfa60..684a898fa52 100644
--- a/libexec/ld.so/hppa/ldasm.S
+++ b/libexec/ld.so/hppa/ldasm.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldasm.S,v 1.9 2013/04/05 12:58:03 kurt Exp $ */
+/* $OpenBSD: ldasm.S,v 1.10 2013/06/01 09:57:58 miod Exp $ */
/*
* Copyright (c) 2004 Michael Shalayeff
@@ -149,9 +149,8 @@ ENTRY(_dl_bind_start,32)
bl _dl_bind, rp
copy r21, r19
- /* load &func and sl from plt entry returned */
- ldw 0(ret0), r21
- ldw 4(ret0), r19
+ copy ret0, r21 /* &func */
+ copy ret1, r19 /* sl */
ldw HPPA_FRAME_ARG(0)(r3), arg0
ldw HPPA_FRAME_ARG(1)(r3), arg1
@@ -281,6 +280,12 @@ ENTRY(_dl_getcwd,0)
nop
EXIT(_dl_getcwd)
+ENTRY(_dl_utrace,0)
+ SYSCALL(utrace)
+ bv r0(rp)
+ nop
+EXIT(_dl_utrace)
+
ENTRY(_dl_sigprocmask,0)
stw arg2, HPPA_FRAME_ARG(2)(sp)