OSDN Git Service

utils: Fix ldd segfault
authorNatanael Copa <ncopa@alpinelinux.org>
Mon, 24 May 2010 07:07:45 +0000 (09:07 +0200)
committerCarmelo Amoroso <carmelo.amoroso@st.com>
Mon, 24 May 2010 07:07:45 +0000 (09:07 +0200)
Fixes ldd segfault on this testcase:

extern void _dl_getenv(void);
void foo(void)
{
    printf("foo: %x\n", &_dl_getenv);
}

linked as -shared

It fixes bug #1507

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
utils/ldd.c

index 7411c32..3858c81 100644 (file)
@@ -576,7 +576,7 @@ static struct library *find_elf_interpreter(ElfW(Ehdr) *ehdr)
                                }
                                newlib->name = NULL;
                                newlib->path = NULL;
-                               return NULL;
+                               break;
                        }
                }
                if (newlib == NULL)