summaryrefslogtreecommitdiff
path: root/src/ldso
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-07-25 09:22:05 -0400
committerRich Felker <dalias@aerifal.cx>2011-07-25 09:22:05 -0400
commite01ac67599dea1fd78a1bd1a0339a1da07dc9578 (patch)
tree2d8c0218c158ec6fcce0d67176c01a99e0d6c1de /src/ldso
parentdd92a09ecac74760823b047c074e4b21a8cb531f (diff)
downloadmusl-e01ac67599dea1fd78a1bd1a0339a1da07dc9578.tar.gz
when resolving symbols with only weak defs, use first def, not last def
Diffstat (limited to 'src/ldso')
-rw-r--r--src/ldso/dynlink.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/ldso/dynlink.c b/src/ldso/dynlink.c
index 6c4abbfe..7a26e9ed 100644
--- a/src/ldso/dynlink.c
+++ b/src/ldso/dynlink.c
@@ -107,6 +107,7 @@ static void *find_sym(struct dso *dso, const char *s, int need_def)
if (sym && (!need_def || sym->st_shndx) && sym->st_value
&& (1<<(sym->st_info&0xf) & OK_TYPES)
&& (1<<(sym->st_info>>4) & OK_BINDS)) {
+ if (def && sym->st_info>>4 == STB_WEAK) continue;
def = dso->base + sym->st_value;
if (sym->st_info>>4 == STB_GLOBAL) break;
}