Replace if() NADA else if() NADA else continue logic with one explicit
block. Split out the MIPS handling to make it explicit and readable.
This commit is contained in:
parent
704f670280
commit
7878f85385
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: symbol.c,v 1.58 2011/08/13 22:24:57 christos Exp $ */
|
||||
/* $NetBSD: symbol.c,v 1.59 2011/11/25 14:39:02 joerg Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright 1996 John D. Polstra.
|
||||
@ -40,7 +40,7 @@
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#ifndef lint
|
||||
__RCSID("$NetBSD: symbol.c,v 1.58 2011/08/13 22:24:57 christos Exp $");
|
||||
__RCSID("$NetBSD: symbol.c,v 1.59 2011/11/25 14:39:02 joerg Exp $");
|
||||
#endif /* not lint */
|
||||
|
||||
#include <err.h>
|
||||
@ -258,9 +258,10 @@ _rtld_symlook_obj(const char *name, unsigned long hash,
|
||||
rdbg(("check \"%s\" vs \"%s\" in %s", name, strp, obj->path));
|
||||
if (name[1] != strp[1] || strcmp(name, strp))
|
||||
continue;
|
||||
if (symp->st_shndx != SHN_UNDEF)
|
||||
/* Nothing to do */;
|
||||
#ifndef __mips__
|
||||
#ifdef __mips__
|
||||
if (symp->st_shndx == SHN_UNDEF)
|
||||
continue;
|
||||
#else
|
||||
/*
|
||||
* XXX DANGER WILL ROBINSON!
|
||||
* If we have a function pointer in the executable's
|
||||
@ -271,13 +272,12 @@ _rtld_symlook_obj(const char *name, unsigned long hash,
|
||||
* in the libraries to point to PLT slots in the
|
||||
* executable, if they exist.
|
||||
*/
|
||||
else if (!(flags & SYMLOOK_IN_PLT) &&
|
||||
symp->st_value != 0 &&
|
||||
ELF_ST_TYPE(symp->st_info) == STT_FUNC)
|
||||
/* Nothing to do */;
|
||||
#endif
|
||||
else
|
||||
if (symp->st_shndx == SHN_UNDEF &&
|
||||
((flags & SYMLOOK_IN_PLT) ||
|
||||
symp->st_value == 0 ||
|
||||
ELF_ST_TYPE(symp->st_info) != STT_FUNC))
|
||||
continue;
|
||||
#endif
|
||||
|
||||
if (ventry == NULL) {
|
||||
if (obj->versyms != NULL) {
|
||||
|
Loading…
Reference in New Issue
Block a user