Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/libexec/ld.elf_so/arch Partially fix up some debug printf()s...



details:   https://anonhg.NetBSD.org/src/rev/c6d8fe7017fd
branches:  trunk
changeset: 536060:c6d8fe7017fd
user:      mycroft <mycroft%NetBSD.org@localhost>
date:      Thu Sep 05 21:31:30 2002 +0000

description:
Partially fix up some debug printf()s that don't need to use defobj.

diffstat:

 libexec/ld.elf_so/arch/alpha/alpha_reloc.c |  10 +++++-----
 libexec/ld.elf_so/arch/arm/mdreloc.c       |  16 ++++++++--------
 libexec/ld.elf_so/arch/hppa/hppa_reloc.c   |  10 +++++-----
 libexec/ld.elf_so/arch/i386/mdreloc.c      |  24 ++++++++++--------------
 libexec/ld.elf_so/arch/m68k/mdreloc.c      |   8 ++++----
 libexec/ld.elf_so/arch/mips/mips_reloc.c   |   6 +++---
 libexec/ld.elf_so/arch/powerpc/ppc_reloc.c |   6 +++---
 libexec/ld.elf_so/arch/sh3/mdreloc.c       |  16 ++++++++--------
 libexec/ld.elf_so/arch/sparc/mdreloc.c     |   9 ++++-----
 libexec/ld.elf_so/arch/sparc64/mdreloc.c   |   9 ++++-----
 libexec/ld.elf_so/arch/vax/mdreloc.c       |   4 ++--
 libexec/ld.elf_so/arch/x86_64/mdreloc.c    |  20 +++++++++++---------
 12 files changed, 67 insertions(+), 71 deletions(-)

diffs (truncated from 408 to 300 lines):

diff -r 416251d99cfe -r c6d8fe7017fd libexec/ld.elf_so/arch/alpha/alpha_reloc.c
--- a/libexec/ld.elf_so/arch/alpha/alpha_reloc.c        Thu Sep 05 21:21:06 2002 +0000
+++ b/libexec/ld.elf_so/arch/alpha/alpha_reloc.c        Thu Sep 05 21:31:30 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: alpha_reloc.c,v 1.8 2002/09/05 21:21:08 mycroft Exp $  */
+/*     $NetBSD: alpha_reloc.c,v 1.9 2002/09/05 21:31:30 mycroft Exp $  */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -139,8 +139,8 @@
                        if (*where != tmp)
                                *where = tmp;
                        rdbg(dodebug, ("REFQUAD %s in %s --> %p in %s",
-                       defobj->strtab + def->st_name, obj->path,
-                       (void *)*where, defobj->path));
+                           obj->strtab + obj->symtab[symnum].st_name,
+                           obj->path, (void *)*where, defobj->path));
                        break;
 
                case R_TYPE(GLOB_DAT):
@@ -153,8 +153,8 @@
                        if (*where != tmp)
                                *where = tmp;
                        rdbg(dodebug, ("GLOB_DAT %s in %s --> %p in %s",
-                       defobj->strtab + def->st_name, obj->path,
-                       (void *)*where, defobj->path));
+                           obj->strtab + obj->symtab[symnum].st_name,
+                           obj->path, (void *)*where, defobj->path));
                        break;
 
                case R_TYPE(RELATIVE):
diff -r 416251d99cfe -r c6d8fe7017fd libexec/ld.elf_so/arch/arm/mdreloc.c
--- a/libexec/ld.elf_so/arch/arm/mdreloc.c      Thu Sep 05 21:21:06 2002 +0000
+++ b/libexec/ld.elf_so/arch/arm/mdreloc.c      Thu Sep 05 21:31:30 2002 +0000
@@ -54,15 +54,15 @@
                                "%s: R_ARM_PC24 relocation @ %p to %s failed "
                                "(displacement %ld (%#lx) out of range)",
                                    obj->path, where,
-                                   defobj->strtab + def->st_name, (long) tmp,
-                                   (long) tmp);
+                                   obj->strtab + obj->symtab[symnum].st_name,
+                                   (long) tmp, (long) tmp);
                                return -1;
                        }
                        tmp >>= 2;
                        *where = (*where & 0xff000000) | (tmp & 0x00ffffff);
                        rdbg(dodebug, ("PC24 %s in %s --> %p @ %p in %s",
-                           defobj->strtab + def->st_name, obj->path,
-                           (void *)*where, where, defobj->path));
+                           obj->strtab + obj->symtab[symnum].st_name,
+                           obj->path, (void *)*where, where, defobj->path));
                        break;
                }
 #endif
@@ -73,8 +73,8 @@
                                return -1;
                        *where += (Elf_Addr)defobj->relocbase + def->st_value;
                        rdbg(dodebug, ("ABS32 %s in %s --> %p @ %p in %s",
-                           defobj->strtab + def->st_name, obj->path,
-                           (void *)*where, where, defobj->path));
+                           obj->strtab + obj->symtab[symnum].st_name,
+                           obj->path, (void *)*where, where, defobj->path));
                        break;
 
                case R_TYPE(GLOB_DAT):  /* word32 B + S */
@@ -83,8 +83,8 @@
                                return -1;
                        *where = (Elf_Addr)(defobj->relocbase + def->st_value);
                        rdbg(dodebug, ("GLOB_DAT %s in %s --> %p @ %p in %s",
-                           defobj->strtab + def->st_name, obj->path,
-                           (void *)*where, where, defobj->path));
+                           obj->strtab + obj->symtab[symnum].st_name,
+                           obj->path, (void *)*where, where, defobj->path));
                        break;
 
                case R_TYPE(RELATIVE):  /* word32 B + A */
diff -r 416251d99cfe -r c6d8fe7017fd libexec/ld.elf_so/arch/hppa/hppa_reloc.c
--- a/libexec/ld.elf_so/arch/hppa/hppa_reloc.c  Thu Sep 05 21:21:06 2002 +0000
+++ b/libexec/ld.elf_so/arch/hppa/hppa_reloc.c  Thu Sep 05 21:31:30 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hppa_reloc.c,v 1.6 2002/09/05 21:21:09 mycroft Exp $   */
+/*     $NetBSD: hppa_reloc.c,v 1.7 2002/09/05 21:31:32 mycroft Exp $   */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -382,8 +382,8 @@
                                if (*where != tmp)
                                        *where = tmp;
                                rdbg(dodebug, ("DIR32 %s in %s --> %p in %s",
-                                   defobj->strtab + def->st_name, obj->path,
-                                   (void *)*where, defobj->path));
+                                   obj->strtab + obj->symtab[symnum].st_name,
+                                   obj->path, (void *)*where, defobj->path));
                        } else {
                                extern Elf_Addr _GLOBAL_OFFSET_TABLE_[];
                                extern Elf_Addr _GOT_END_[];
@@ -424,8 +424,8 @@
                                if (*where != tmp)
                                        *where = tmp;
                                rdbg(dodebug, ("PLABEL32 %s in %s --> %p in %s",
-                                   defobj->strtab + def->st_name, obj->path,
-                                   (void *)*where, defobj->path));
+                                   obj->strtab + obj->symtab[symnum].st_name,
+                                   obj->path, (void *)*where, defobj->path));
                        } else {
                                /*
                                 * This is a PLABEL for a static function, and
diff -r 416251d99cfe -r c6d8fe7017fd libexec/ld.elf_so/arch/i386/mdreloc.c
--- a/libexec/ld.elf_so/arch/i386/mdreloc.c     Thu Sep 05 21:21:06 2002 +0000
+++ b/libexec/ld.elf_so/arch/i386/mdreloc.c     Thu Sep 05 21:31:30 2002 +0000
@@ -24,6 +24,8 @@
 
        for (rel = obj->rel; rel < obj->rellim; rel++) {
                Elf_Addr        *where;
+               const Elf_Sym   *def;
+               const Obj_Entry *defobj;
                Elf_Addr         tmp;
                unsigned long    symnum;
 
@@ -37,11 +39,8 @@
 #if 1 /* XXX should not occur */
                case R_TYPE(PC32):
 #ifdef COMBRELOC
-                       if (symnum != lastsym)
+                       if (symnum != lastsym) {
 #endif
-                       {
-                               const Elf_Sym   *def;
-                               const Obj_Entry *defobj;
                                def = _rtld_find_symdef(symnum, obj, &defobj,
                                    false);
                                if (def == NULL)
@@ -50,13 +49,13 @@
                                    def->st_value);
 #ifdef COMBRELOC
                                lastsym = symnum;
+                       }
 #endif
-                       }
 
                        *where += target - (Elf_Addr)where;
                        rdbg(dodebug, ("PC32 %s in %s --> %p in %s",
-                           defobj->strtab + def->st_name, obj->path,
-                           (void *)*where, defobj->path));
+                           obj->strtab + obj->symtab[symnum].st_name,
+                           obj->path, (void *)*where, defobj->path));
                        break;
 
                case R_TYPE(GOT32):
@@ -64,11 +63,8 @@
                case R_TYPE(32):
                case R_TYPE(GLOB_DAT):
 #ifdef COMBRELOC
-                       if (symnum != lastsym)
+                       if (symnum != lastsym) {
 #endif
-                       {
-                               const Elf_Sym   *def;
-                               const Obj_Entry *defobj;
                                def = _rtld_find_symdef(symnum, obj, &defobj,
                                    false);
                                if (def == NULL)
@@ -77,15 +73,15 @@
                                    def->st_value);
 #ifdef COMBRELOC
                                lastsym = symnum;
+                       }
 #endif
-                       }
 
                        tmp = target + *where;
                        if (*where != tmp)
                                *where = tmp;
                        rdbg(dodebug, ("32/GLOB_DAT %s in %s --> %p in %s",
-                           defobj->strtab + def->st_name, obj->path,
-                           (void *)*where, defobj->path));
+                           obj->strtab + obj->symtab[symnum].st_name,
+                           obj->path, (void *)*where, defobj->path));
                        break;
 
                case R_TYPE(RELATIVE):
diff -r 416251d99cfe -r c6d8fe7017fd libexec/ld.elf_so/arch/m68k/mdreloc.c
--- a/libexec/ld.elf_so/arch/m68k/mdreloc.c     Thu Sep 05 21:21:06 2002 +0000
+++ b/libexec/ld.elf_so/arch/m68k/mdreloc.c     Thu Sep 05 21:31:30 2002 +0000
@@ -43,8 +43,8 @@
                        if (*where != tmp)
                                *where = tmp;
                        rdbg(dodebug, ("PC32 %s in %s --> %p in %s",
-                           defobj->strtab + def->st_name, obj->path,
-                           (void *)*where, defobj->path));
+                           obj->strtab + obj->symtab[symnum].st_name,
+                           obj->path, (void *)*where, defobj->path));
                        break;
 
                case R_TYPE(GOT32):
@@ -60,8 +60,8 @@
                        if (*where != tmp)
                                *where = tmp;
                        rdbg(dodebug, ("32/GLOB_DAT %s in %s --> %p in %s",
-                           defobj->strtab + def->st_name, obj->path,
-                           (void *)*where, defobj->path));
+                           obj->strtab + obj->symtab[symnum].st_name,
+                           obj->path, (void *)*where, defobj->path));
                        break;
 
                case R_TYPE(RELATIVE):
diff -r 416251d99cfe -r c6d8fe7017fd libexec/ld.elf_so/arch/mips/mips_reloc.c
--- a/libexec/ld.elf_so/arch/mips/mips_reloc.c  Thu Sep 05 21:21:06 2002 +0000
+++ b/libexec/ld.elf_so/arch/mips/mips_reloc.c  Thu Sep 05 21:31:30 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mips_reloc.c,v 1.10 2002/09/05 21:21:10 mycroft Exp $  */
+/*     $NetBSD: mips_reloc.c,v 1.11 2002/09/05 21:31:33 mycroft Exp $  */
 
 /*
  * Copyright 1997 Michael L. Hitch <mhitch%montana.edu@localhost>
@@ -197,8 +197,8 @@
                                *where += (Elf_Addr)(defobj->relocbase +
                                    def->st_value);
                                rdbg(dodebug, ("REL32 %s in %s --> %p in %s",
-                                   defobj->strtab + def->st_name, obj->path,
-                                   (void *)*where, defobj->path));
+                                   obj->strtab + obj->symtab[symnum].st_name,
+                                   obj->path, (void *)*where, defobj->path));
                        }
                        break;
 
diff -r 416251d99cfe -r c6d8fe7017fd libexec/ld.elf_so/arch/powerpc/ppc_reloc.c
--- a/libexec/ld.elf_so/arch/powerpc/ppc_reloc.c        Thu Sep 05 21:21:06 2002 +0000
+++ b/libexec/ld.elf_so/arch/powerpc/ppc_reloc.c        Thu Sep 05 21:31:30 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ppc_reloc.c,v 1.15 2002/09/05 21:21:11 mycroft Exp $   */
+/*     $NetBSD: ppc_reloc.c,v 1.16 2002/09/05 21:31:34 mycroft Exp $   */
 
 /*-
  * Copyright (C) 1998  Tsubai Masanari
@@ -215,8 +215,8 @@
                        if (*where != tmp)
                                *where = tmp;
                        rdbg(dodebug, ("32/GLOB_DAT %s in %s --> %p in %s",
-                           defobj->strtab + def->st_name, obj->path,
-                           (void *)*where, defobj->path));
+                           obj->strtab + obj->symtab[symnum].st_name,
+                           obj->path, (void *)*where, defobj->path));
                        break;
 
                case R_TYPE(RELATIVE):  /* word32 B + A */
diff -r 416251d99cfe -r c6d8fe7017fd libexec/ld.elf_so/arch/sh3/mdreloc.c
--- a/libexec/ld.elf_so/arch/sh3/mdreloc.c      Thu Sep 05 21:21:06 2002 +0000
+++ b/libexec/ld.elf_so/arch/sh3/mdreloc.c      Thu Sep 05 21:31:30 2002 +0000
@@ -43,8 +43,8 @@
                        if (*where != tmp)
                                *where = tmp;
                        rdbg(dodebug, ("GOT32 %s in %s --> %p in %s",
-                           defobj->strtab + def->st_name, obj->path,
-                           (void *)*where, defobj->path));
+                           obj->strtab + obj->symtab[symnum].st_name,
+                           obj->path, (void *)*where, defobj->path));
                        break;
 
                case R_TYPE(REL32):
@@ -55,8 +55,8 @@
                        *where += (Elf_Addr)(defobj->relocbase + def->st_value +
                            rela->r_addend) - (Elf_Addr)where;
                        rdbg(dodebug, ("PC32 %s in %s --> %p in %s",
-                           defobj->strtab + def->st_name, obj->path,
-                           (void *)*where, defobj->path));
+                           obj->strtab + obj->symtab[symnum].st_name,
+                           obj->path, (void *)*where, defobj->path));
                        break;
 #endif
 
@@ -68,8 +68,8 @@
                        *where += (Elf_Addr)(defobj->relocbase + def->st_value +
                            rela->r_addend);
                        rdbg(dodebug, ("32 %s in %s --> %p in %s",
-                           defobj->strtab + def->st_name, obj->path,
-                           (void *)*where, defobj->path));
+                           obj->strtab + obj->symtab[symnum].st_name,
+                           obj->path, (void *)*where, defobj->path));
                        break;
 
                case R_TYPE(GLOB_DAT):
@@ -82,8 +82,8 @@
                        if (*where != tmp)
                                *where = tmp;
                        rdbg(dodebug, ("GLOB_DAT %s in %s --> %p in %s",
-                           defobj->strtab + def->st_name, obj->path,
-                           (void *)*where, defobj->path));
+                           obj->strtab + obj->symtab[symnum].st_name,
+                           obj->path, (void *)*where, defobj->path));
                        break;
 
                case R_TYPE(RELATIVE):
diff -r 416251d99cfe -r c6d8fe7017fd libexec/ld.elf_so/arch/sparc/mdreloc.c
--- a/libexec/ld.elf_so/arch/sparc/mdreloc.c    Thu Sep 05 21:21:06 2002 +0000
+++ b/libexec/ld.elf_so/arch/sparc/mdreloc.c    Thu Sep 05 21:31:30 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mdreloc.c,v 1.15 2002/09/05 21:21:12 mycroft Exp $     */
+/*     $NetBSD: mdreloc.c,v 1.16 2002/09/05 21:31:35 mycroft Exp $     */
 



Home | Main Index | Thread Index | Old Index