summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2012-07-12 16:45:15 +0000
committerguenther <guenther@openbsd.org>2012-07-12 16:45:15 +0000
commitfa24c6dca874c30aa3d0239b7bf2c466c0f2a773 (patch)
tree57d6deec289c4e0a5576db067fe00a889f58cdf1
parentBe way more careful when accessing a possibly cached route in_selectsrc() (diff)
downloadwireguard-openbsd-fa24c6dca874c30aa3d0239b7bf2c466c0f2a773.tar.xz
wireguard-openbsd-fa24c6dca874c30aa3d0239b7bf2c466c0f2a773.zip
Add -B option to pass down LD_BIND_NOW to suppress ld.so blather
ok pirofti@ deraadt@
-rw-r--r--usr.bin/ktrace/ktrace.114
-rw-r--r--usr.bin/ktrace/ktrace.c7
2 files changed, 16 insertions, 5 deletions
diff --git a/usr.bin/ktrace/ktrace.1 b/usr.bin/ktrace/ktrace.1
index a58a0543f81..4d2224031ec 100644
--- a/usr.bin/ktrace/ktrace.1
+++ b/usr.bin/ktrace/ktrace.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: ktrace.1,v 1.22 2011/07/08 20:37:18 jmc Exp $
+.\" $OpenBSD: ktrace.1,v 1.23 2012/07/12 16:45:15 guenther Exp $
.\"
.\" Copyright (c) 1990, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -29,7 +29,7 @@
.\"
.\" from: @(#)ktrace.1 8.1 (Berkeley) 6/6/93
.\"
-.Dd $Mdocdate: July 8 2011 $
+.Dd $Mdocdate: July 12 2012 $
.Dt KTRACE 1
.Os
.Sh NAME
@@ -37,7 +37,7 @@
.Nd enable kernel process tracing
.Sh SYNOPSIS
.Nm ktrace
-.Op Fl aCcdi
+.Op Fl aBCcdi
.Op Fl f Ar trfile
.Op Fl g Ar pgid
.Op Fl p Ar pid
@@ -76,6 +76,14 @@ The options are as follows:
.Bl -tag -width "-t trstr"
.It Fl a
Append to the trace file instead of recreating it.
+.It Fl B
+Set the
+.Ev LD_BIND_NOW
+environment variable to specify that the dynamic linker should process
+relocations immediately instead of as they are encountered.
+This eliminates the resulting
+.Xr ld.so 1
+relocation sequences.
.It Fl C
Disable tracing on all user owned processes, and, if executed by root, all
processes in the system.
diff --git a/usr.bin/ktrace/ktrace.c b/usr.bin/ktrace/ktrace.c
index 4ec34c6ff2e..39dbb4adf46 100644
--- a/usr.bin/ktrace/ktrace.c
+++ b/usr.bin/ktrace/ktrace.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ktrace.c,v 1.22 2009/10/27 23:59:39 deraadt Exp $ */
+/* $OpenBSD: ktrace.c,v 1.23 2012/07/12 16:45:15 guenther Exp $ */
/* $NetBSD: ktrace.c,v 1.4 1995/08/31 23:01:44 jtc Exp $ */
/*-
@@ -65,11 +65,14 @@ main(int argc, char *argv[])
append = ops = pidset = inherit = pid = 0;
trpoints = DEF_POINTS;
tracefile = DEF_TRACEFILE;
- while ((ch = getopt(argc,argv,"aCcdf:g:ip:t:")) != -1)
+ while ((ch = getopt(argc,argv,"aBCcdf:g:ip:t:")) != -1)
switch((char)ch) {
case 'a':
append = 1;
break;
+ case 'B':
+ putenv("LD_BIND_NOW=");
+ break;
case 'C':
clear = CLEARALL;
pidset = 1;