Try to make dbg() printfs realy ELFSIZE independent

This commit is contained in:
martin 2012-07-25 22:51:04 +00:00
parent 95b282e26a
commit 972dd84db2

View File

@ -1,4 +1,4 @@
/* $NetBSD: map_object.c,v 1.43 2011/08/13 22:25:20 christos Exp $ */
/* $NetBSD: map_object.c,v 1.44 2012/07/25 22:51:04 martin Exp $ */
/*
* Copyright 1996 John D. Polstra.
@ -34,7 +34,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: map_object.c,v 1.43 2011/08/13 22:25:20 christos Exp $");
__RCSID("$NetBSD: map_object.c,v 1.44 2012/07/25 22:51:04 martin Exp $");
#endif /* not lint */
#include <errno.h>
@ -185,27 +185,33 @@ _rtld_map_object(const char *path, int fd, const struct stat *sb)
if (nsegs < 2)
segs[nsegs] = phdr;
++nsegs;
dbg(("%s: %s %p phsize %zu", obj->path, "PT_LOAD",
#if ELFSIZE == 64
#define PRImemsz PRIu64
#else
#define PRImemsz PRIu32
#endif
dbg(("%s: %s %p phsize %" PRImemsz, obj->path, "PT_LOAD",
(void *)(uintptr_t)phdr->p_vaddr, phdr->p_memsz));
break;
case PT_PHDR:
phdr_vaddr = phdr->p_vaddr;
phdr_memsz = phdr->p_memsz;
dbg(("%s: %s %p phsize %zu", obj->path, "PT_PHDR",
dbg(("%s: %s %p phsize %" PRImemsz, obj->path, "PT_PHDR",
(void *)(uintptr_t)phdr->p_vaddr, phdr->p_memsz));
break;
case PT_DYNAMIC:
obj->dynamic = (void *)(uintptr_t)phdr->p_vaddr;
dbg(("%s: %s %p phsize %zu", obj->path, "PT_DYNAMIC",
dbg(("%s: %s %p phsize %" PRImemsz, obj->path, "PT_DYNAMIC",
(void *)(uintptr_t)phdr->p_vaddr, phdr->p_memsz));
break;
#if defined(__HAVE_TLS_VARIANT_I) || defined(__HAVE_TLS_VARIANT_II)
case PT_TLS:
phtls = phdr;
dbg(("%s: %s %p phsize %zu", obj->path, "PT_TLS",
dbg(("%s: %s %p phsize %" PRImemsz, obj->path, "PT_TLS",
(void *)(uintptr_t)phdr->p_vaddr, phdr->p_memsz));
break;
#endif