Fix some fragileness in dlopen/do_dlopen wrapper & worker pair.
Fix some fragileness in dlopen/do_dlopen wrapper & worker pair.

do_dlopen contains __builtin_return_address to determine from
whence it was called, and uses that to determine which dynamic
object's data it should use to start the search.  (In the bug I was
tracking, this related to whether the application's RPATH was used or
not.)  For that to work, it has to have been inlined into the wrapper
function.

As it happens, it wasn't being inlined.  That's an unfortunate compiler
behaviour, but it isn't wrong and shouldn't have caused dlopen to fail.

This patch changes things so the wrapper function determines the
return address, and passes it to the worker.  If the worker's inlined,
the generated code should be exactly the same as before.

Signed-off-by: Nathan Sidwell <2e8aa918660411855c6d44d5bb2da677aa033255@codesourcery.com>
Signed-off-by: Bernd Schmidt <c931ab6ac2d0c45d944fa77d0e13e53c91dbbf4d@codesourcery.com>
Signed-off-by: Bernhard Reutner-Fischer <ce1ac9e9ad16abccd7821f371ad381197b4768ac@gmail.com>

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