Source-Changes-HG archive

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

[src/trunk]: src/lib/librumpuser Convert hashtab to Elf_Symindx type, and use...



details:   https://anonhg.NetBSD.org/src/rev/5ac6a0704b86
branches:  trunk
changeset: 763286:5ac6a0704b86
user:      njoly <njoly%NetBSD.org@localhost>
date:      Wed Mar 16 11:44:01 2011 +0000

description:
Convert hashtab to Elf_Symindx type, and use it directly to get symbol
count. Remove now unused GETVECWORDn macro.

This is needed to make it work on alpha which use non-standard 64bit
values for the symbol hash table section, unlike all other archs.

diffstat:

 lib/librumpuser/rumpuser_dl.c |  21 +++++----------------
 1 files changed, 5 insertions(+), 16 deletions(-)

diffs (56 lines):

diff -r 896c91cac517 -r 5ac6a0704b86 lib/librumpuser/rumpuser_dl.c
--- a/lib/librumpuser/rumpuser_dl.c     Wed Mar 16 11:35:36 2011 +0000
+++ b/lib/librumpuser/rumpuser_dl.c     Wed Mar 16 11:44:01 2011 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: rumpuser_dl.c,v 1.5 2010/12/30 15:47:30 pooka Exp $   */
+/*      $NetBSD: rumpuser_dl.c,v 1.6 2011/03/16 11:44:01 njoly Exp $   */
 
 /*
  * Copyright (c) 2009 Antti Kantee.  All Rights Reserved.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: rumpuser_dl.c,v 1.5 2010/12/30 15:47:30 pooka Exp $");
+__RCSID("$NetBSD: rumpuser_dl.c,v 1.6 2011/03/16 11:44:01 njoly Exp $");
 
 #include <sys/types.h>
 #include <sys/time.h>
@@ -123,17 +123,6 @@
        }                                                               \
 } while (/*CONSTCOND*/0)
 
-#define GETVECWORDn(base, n, result)                                   \
-do {                                                                   \
-       if (eident == ELFCLASS32) {                                     \
-               Elf32_Word *vec = base;                                 \
-               result = vec[n];                                        \
-       } else {                                                        \
-               Elf64_Word *vec = base;                                 \
-               result = vec[n];                                        \
-       }                                                               \
-} while (/*CONSTCOND*/0)
-
 #define SYM_GETSIZE() ((eident==ELFCLASS32)?sizeof(Elf32_Sym):sizeof(Elf64_Sym))
 
 static int
@@ -177,7 +166,7 @@
        for (i = 0; ed_tag != DT_NULL;) {
                uintptr_t edptr;
                size_t edval;
-               void *hashtab;
+               Elf_Symindx *hashtab;
 
                switch (ed_tag) {
                case DT_SYMTAB:
@@ -194,8 +183,8 @@
                        break;
                case DT_HASH:
                        DYNn_GETMEMBER(ed_base, i, d_un.d_ptr, edptr);
-                       hashtab = map->l_addr + edptr;
-                       GETVECWORDn(hashtab, 1, cursymcount);
+                       hashtab = (Elf_Symindx *)(map->l_addr + edptr);
+                       cursymcount = hashtab[1];
                        break;
                case DT_SYMENT:
                        DYNn_GETMEMBER(ed_base, i, d_un.d_val, edval);



Home | Main Index | Thread Index | Old Index