Browse Source

utils: Fix ldd segfault

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>
Natanael Copa 14 years ago
parent
commit
b2c4199f0f
1 changed files with 1 additions and 1 deletions
  1. 1 1
      utils/ldd.c

+ 1 - 1
utils/ldd.c

@@ -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)