summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2002-10-04 03:01:43 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2002-10-04 03:01:43 +0000
commit58c9215a5dd87bccf77fa64ffe3a1af61ffb6486 (patch)
tree4f4ec0d405d0b95fd8036203e328b15c468e04e8
parentf2125a26b248d172f6bc8cd5f0cf12a47ea6b43d (diff)
Print full 64 bit address. At least until LD_TRACE_LOADED_OBJECTS_FMT[12]
is supported properly.
-rw-r--r--libexec/ld.so/dl_printf.c8
-rw-r--r--libexec/ld.so/dlfcn.c15
2 files changed, 17 insertions, 6 deletions
diff --git a/libexec/ld.so/dl_printf.c b/libexec/ld.so/dl_printf.c
index 0640afa3695..0a33ee33037 100644
--- a/libexec/ld.so/dl_printf.c
+++ b/libexec/ld.so/dl_printf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dl_printf.c,v 1.9 2002/08/31 04:58:25 drahn Exp $ */
+/* $OpenBSD: dl_printf.c,v 1.10 2002/10/04 03:01:42 drahn Exp $ */
/*-
* Copyright (c) 1993
@@ -180,9 +180,13 @@ reswitch:
break;
case 'X':
{
- int l = 28;
+ int l;
ul = lflag ? va_arg(ap, u_long) : va_arg(ap, u_int);
+ if (lflag)
+ l = (sizeof(ulong) * 8) - 4;
+ else
+ l = (sizeof(u_int) * 8) - 4;
while (l >= 0) {
put("0123456789abcdef"[(ul >> l) & 0xf], fd);
l -= 4;
diff --git a/libexec/ld.so/dlfcn.c b/libexec/ld.so/dlfcn.c
index 0030d4f5916..fa8282d5557 100644
--- a/libexec/ld.so/dlfcn.c
+++ b/libexec/ld.so/dlfcn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dlfcn.c,v 1.20 2002/08/31 04:58:25 drahn Exp $ */
+/* $OpenBSD: dlfcn.c,v 1.21 2002/10/04 03:01:42 drahn Exp $ */
/*
* Copyright (c) 1998 Per Fogelstrom, Opsycon AB
@@ -249,6 +249,7 @@ _dl_show_objects()
elf_object_t *object;
char *objtypename;
int outputfd;
+ char *pad;
object = _dl_objects;
if (_dl_traceld)
@@ -256,7 +257,12 @@ _dl_show_objects()
else
outputfd = STDERR_FILENO;
- _dl_fdprintf(outputfd, "\tStart End Type Ref Name\n");
+ if (sizeof(long) == 8)
+ pad = " ";
+ else
+ pad = "";
+ _dl_fdprintf(outputfd, "\tStart %s End %s Type Ref Name\n",
+ pad, pad);
while (object) {
switch (object->obj_type) {
@@ -276,8 +282,9 @@ _dl_show_objects()
objtypename = "????";
break;
}
- _dl_fdprintf(outputfd, "\t%X %X %s %d %s\n",
- object->load_addr, object->load_addr + object->load_size,
+ _dl_fdprintf(outputfd, "\t%lX %lX %s %d %s\n",
+ (void *)object->load_addr,
+ (void *)(object->load_addr + object->load_size),
objtypename, object->refcount, object->load_name);
object = object->next;
}