use new search_vec function to find vdso in dynamic linker
authorRich Felker <dalias@aerifal.cx>
Sat, 25 Aug 2012 21:30:59 +0000 (17:30 -0400)
committerRich Felker <dalias@aerifal.cx>
Sat, 25 Aug 2012 21:30:59 +0000 (17:30 -0400)
src/ldso/dynlink.c

index 6ffda49cf42c545b889d53ef0bda9a7cfb313f18..7c1bd890d024384041858ae53d04fdd1c67a9ddc 100644 (file)
@@ -701,9 +701,8 @@ void *__dynlink(int argc, char **argv)
        decode_dyn(app);
 
        /* Attach to vdso, if provided by the kernel */
-       for (i=0; auxv[i]; i+=2) {
-               size_t vdso_base = auxv[i+1];
-               if (auxv[i] != AT_SYSINFO_EHDR) continue;
+       if (search_vec(auxv, aux, AT_SYSINFO_EHDR)) {
+               size_t vdso_base = *aux;
                ehdr = (void *)vdso_base;
                phdr = (void *)(vdso_base + ehdr->e_phoff);
                for (i=ehdr->e_phnum; i; i--, phdr=(void *)((char *)phdr + ehdr->e_phentsize)) {
@@ -717,7 +716,6 @@ void *__dynlink(int argc, char **argv)
                decode_dyn(vdso);
                vdso->prev = lib;
                lib->next = vdso;
-               break;
        }
 
        /* Initial dso chain consists only of the app. We temporarily