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

Bug#191952: Bad version index computation in dl symbol resolution



Package: libc6
Version: 2.3.1-17
Tags: patch

The following patch fixes a typo in the symbol lookup code which causes
the loading of the oracle binary to fail (and possibly affects other apps
as well). The 2.0 version of shmctl gets pulled in, not 2.2. The patch is
already in glibc 2.3.2.

-Manish
--- elf/dl-runtime.c.orig	Wed Sep 18 11:49:18 2002
+++ elf/dl-runtime.c	Thu Feb  6 18:03:11 2003
@@ -84,7 +84,7 @@
 	  {
 	    const ElfW(Half) *vernum =
 	      (const void *) D_PTR (l, l_info[VERSYMIDX (DT_VERSYM)]);
-	    ElfW(Half) ndx = vernum[ELFW(R_SYM) (reloc->r_info) & 0x7fff];
+	    ElfW(Half) ndx = vernum[ELFW(R_SYM) (reloc->r_info)] & 0x7fff;
 	    const struct r_found_version *version = &l->l_versions[ndx];
 
 	    if (version->hash != 0)
@@ -179,7 +179,7 @@
 	      {
 		const ElfW(Half) *vernum =
 		  (const void *) D_PTR (l,l_info[VERSYMIDX (DT_VERSYM)]);
-		ElfW(Half) ndx = vernum[ELFW(R_SYM) (reloc->r_info) & 0x7fff];
+		ElfW(Half) ndx = vernum[ELFW(R_SYM) (reloc->r_info)] & 0x7fff;
 		const struct r_found_version *version = &l->l_versions[ndx];
 
 		if (version->hash != 0)

Reply to: