dl: fix dlsym lookups with RTLD_NEXT
dl: fix dlsym lookups with RTLD_NEXT

The current code for dlsym() when invoked with RTLD_NEXT lookup
searches for the module where it's being called from, and executes the
_dl_find_hash only for the next module in the chain. However, if the
looked symbol is not there, the rest of the modules are not checked.

Generally this is not a problem as symbols are merged for the parent
modules; so this affects only RTLD_NEXT.

This patch adds a loop iterating through all the following modules.

Signed-off-by: Timo Teräs <266f729f1f620250264df63d5dfd302c2a88080e@iki.fi>
Reviewed-by: Filippo ARCIDIACONO <26825f07340f791bc0d38da89fcffcd93550a83c@st.com>
Tested-by: Florian Fainelli <73262ad0334ab37227b2f7a0205f51db1e606681@openwrt.org>
Signed-off-by: Bernhard Reutner-Fischer <ce1ac9e9ad16abccd7821f371ad381197b4768ac@gmail.com>

ndmsystems/uClibc,ndmsystems/uClibc,ndmsystems/uClibc,ndmsystems/uClibc