Module Name:    src
Committed By:   njoly
Date:           Wed Mar 16 11:44:01 UTC 2011

Modified Files:
        src/lib/librumpuser: rumpuser_dl.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/librumpuser/rumpuser_dl.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/librumpuser/rumpuser_dl.c
diff -u src/lib/librumpuser/rumpuser_dl.c:1.5 src/lib/librumpuser/rumpuser_dl.c:1.6
--- src/lib/librumpuser/rumpuser_dl.c:1.5	Thu Dec 30 15:47:30 2010
+++ src/lib/librumpuser/rumpuser_dl.c	Wed Mar 16 11:44:01 2011
@@ -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);

Reply via email to