x-load git: bump SRCREV
[openembedded.git] / recipes / glibc / glibc-2.3.2 / 30_glibc232-base.patch
blob91c9b557d1f2766b1066b064705038e38431325b
1 --- elf/do-lookup.h.base 2003-05-15 09:29:25.000000000 -0700
2 +++ elf/do-lookup.h 2003-05-15 09:24:24.000000000 -0700
3 @@ -52,7 +52,8 @@ FCT (const char *undef_name, unsigned lo
4 const ElfW(Sym) *sym;
5 #if ! VERSIONED
6 int num_versions = 0;
7 - const ElfW(Sym) *versioned_sym = NULL;
8 + const ElfW(Sym) *default_version = NULL;
9 + const ElfW(Sym) *first_version = NULL;
10 #endif
12 map = list[i];
13 @@ -155,16 +156,29 @@ FCT (const char *undef_name, unsigned lo
14 public interface should be returned. */
15 if (verstab != NULL)
17 - if ((verstab[symidx] & 0x7fff)
18 - >= ((flags & DL_LOOKUP_RETURN_NEWEST) ? 2 : 3))
19 + ElfW(Half) ndx = verstab[symidx] & 0x7fff;
20 + if (ndx >= ((flags & DL_LOOKUP_RETURN_NEWEST) ? 2 : 3))
22 /* Don't accept hidden symbols. */
23 if ((verstab[symidx] & 0x8000) == 0 && num_versions++ == 0)
24 /* No version so far. */
25 - versioned_sym = sym;
26 + default_version = sym;
28 continue;
30 + if ((flags & DL_LOOKUP_RETURN_NEWEST) == 0 && ndx != 0)
31 + {
32 + /* ndx == 1 is the base version. We will use it for
33 + old unversioned application. */
34 + if (ndx != 1)
35 + {
36 + /* We remember the first version and keep looking
37 + for the base version. */
38 + if (ndx == 2)
39 + first_version = sym;
40 + continue;
41 + }
42 + }
44 #endif
46 @@ -179,7 +193,8 @@ FCT (const char *undef_name, unsigned lo
47 #if VERSIONED
48 sym = NULL;
49 #else
50 - sym = num_versions == 1 ? versioned_sym : NULL;
51 + sym = first_version ?: (num_versions == 1
52 + ? default_version : NULL);
53 #endif
55 if (sym != NULL)