Module Name: src Committed By: skrll Date: Sat Aug 3 13:17:05 UTC 2013
Modified Files: src/libexec/ld.elf_so: debug.h headers.c map_object.c Log Message: Fix DEBUG build. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/libexec/ld.elf_so/debug.h cvs rdiff -u -r1.51 -r1.52 src/libexec/ld.elf_so/headers.c \ src/libexec/ld.elf_so/map_object.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/libexec/ld.elf_so/debug.h diff -u src/libexec/ld.elf_so/debug.h:1.6 src/libexec/ld.elf_so/debug.h:1.7 --- src/libexec/ld.elf_so/debug.h:1.6 Mon May 6 08:02:20 2013 +++ src/libexec/ld.elf_so/debug.h Sat Aug 3 13:17:05 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: debug.h,v 1.6 2013/05/06 08:02:20 skrll Exp $ */ +/* $NetBSD: debug.h,v 1.7 2013/08/03 13:17:05 skrll Exp $ */ /* * Copyright 1996 John D. Polstra. @@ -55,4 +55,10 @@ extern int debug; # define rdbg(a) ((void) 0) #endif +#if ELFSIZE == 64 +#define PRImemsz PRIu64 +#else +#define PRImemsz PRIu32 +#endif + #endif Index: src/libexec/ld.elf_so/headers.c diff -u src/libexec/ld.elf_so/headers.c:1.51 src/libexec/ld.elf_so/headers.c:1.52 --- src/libexec/ld.elf_so/headers.c:1.51 Mon May 6 19:59:29 2013 +++ src/libexec/ld.elf_so/headers.c Sat Aug 3 13:17:05 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: headers.c,v 1.51 2013/05/06 19:59:29 christos Exp $ */ +/* $NetBSD: headers.c,v 1.52 2013/08/03 13:17:05 skrll Exp $ */ /* * Copyright 1996 John D. Polstra. @@ -40,7 +40,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: headers.c,v 1.51 2013/05/06 19:59:29 christos Exp $"); +__RCSID("$NetBSD: headers.c,v 1.52 2013/08/03 13:17:05 skrll Exp $"); #endif /* not lint */ #include <err.h> @@ -400,7 +400,7 @@ _rtld_digest_phdr(const Elf_Phdr *phdr, case PT_INTERP: obj->interp = (const char *)(uintptr_t)vaddr; - dbg(("headers: %s %p phsize %zu", + dbg(("headers: %s %p phsize %" PRImemsz, "PT_INTERP", (void *)(uintptr_t)vaddr, ph->p_memsz)); break; @@ -417,14 +417,14 @@ _rtld_digest_phdr(const Elf_Phdr *phdr, obj->vaddrbase; } ++nsegs; - dbg(("headers: %s %p phsize %zu", + dbg(("headers: %s %p phsize %" PRImemsz, "PT_LOAD", (void *)(uintptr_t)vaddr, ph->p_memsz)); break; case PT_DYNAMIC: obj->dynamic = (Elf_Dyn *)(uintptr_t)vaddr; - dbg(("headers: %s %p phsize %zu", + dbg(("headers: %s %p phsize %" PRImemsz, "PT_DYNAMIC", (void *)(uintptr_t)vaddr, ph->p_memsz)); break; @@ -436,7 +436,7 @@ _rtld_digest_phdr(const Elf_Phdr *phdr, obj->tlsalign = ph->p_align; obj->tlsinitsize = ph->p_filesz; obj->tlsinit = (void *)(uintptr_t)ph->p_vaddr; - dbg(("headers: %s %p phsize %zu", + dbg(("headers: %s %p phsize %" PRImemsz, "PT_TLS", (void *)(uintptr_t)vaddr, ph->p_memsz)); break; @@ -445,7 +445,7 @@ _rtld_digest_phdr(const Elf_Phdr *phdr, case PT_ARM_EXIDX: obj->exidx_start = (void *)(uintptr_t)vaddr; obj->exidx_sz = ph->p_memsz; - dbg(("headers: %s %p phsize %zu", + dbg(("headers: %s %p phsize %" PRImemsz, "PT_ARM_EXIDX", (void *)(uintptr_t)vaddr, ph->p_memsz)); break; Index: src/libexec/ld.elf_so/map_object.c diff -u src/libexec/ld.elf_so/map_object.c:1.51 src/libexec/ld.elf_so/map_object.c:1.52 --- src/libexec/ld.elf_so/map_object.c:1.51 Thu May 9 15:38:14 2013 +++ src/libexec/ld.elf_so/map_object.c Sat Aug 3 13:17:05 2013 @@ -1,4 +1,4 @@ -/* $NetBSD: map_object.c,v 1.51 2013/05/09 15:38:14 christos Exp $ */ +/* $NetBSD: map_object.c,v 1.52 2013/08/03 13:17:05 skrll Exp $ */ /* * Copyright 1996 John D. Polstra. @@ -34,7 +34,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: map_object.c,v 1.51 2013/05/09 15:38:14 christos Exp $"); +__RCSID("$NetBSD: map_object.c,v 1.52 2013/08/03 13:17:05 skrll Exp $"); #endif /* not lint */ #include <errno.h> @@ -189,11 +189,6 @@ _rtld_map_object(const char *path, int f segs[nsegs] = phdr; ++nsegs; -#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;