A patch for the unversioned lookup

H . J . Lu hjl@lucon.org
Thu May 3 15:34:00 GMT 2001


While working on the atexit related problem, I noticed 2 problems
with the unversioned lookup:

1. The version index starts at 2 not 3. That is we should check
ndx > 1, not ndx > 2, for version names.
2. We should allow the hidden definition if there is no default
definition as long as there is only one definition.

I am also enclosing a testcase here.


H.J.
----
2001-05-03  H.J. Lu  <hjl@gnu.org>

	* do-lookup.h (FCT): Fix the unversioned lookup against the
	nono-default version definition.

--- libc/elf/do-lookup.h.nodef	Tue Feb 27 22:22:10 2001
+++ libc/elf/do-lookup.h	Thu May  3 14:49:24 2001
@@ -125,11 +125,10 @@ FCT (const char *undef_name, unsigned lo
 	  if (verstab != NULL)
 	    {
 	      ElfW(Half) ndx = verstab[symidx] & 0x7fff;
-	      if (ndx > 2) /* map->l_versions[ndx].hash != 0) */
+	      if (ndx > 1) /* map->l_versions[ndx].hash != 0) */
 		{
-		  /* Don't accept hidden symbols.  */
-		  if ((verstab[symidx] & 0x8000) == 0 && num_versions++ == 0)
-		    /* No version so far.  */
+		  if (num_versions++ == 0)
+		    /* Only one version so far.  */
 		    versioned_sym = sym;
 		  continue;
 		}
Reply-To: 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: version15.tar.gz
Type: application/x-gzip
Size: 726 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20010503/29aed2c7/attachment.bin>


More information about the Libc-alpha mailing list