projects
/
platform
/
upstream
/
glib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cleanup
[platform/upstream/glib.git]
/
gmodule
/
gmodule-dl.c
diff --git
a/gmodule/gmodule-dl.c
b/gmodule/gmodule-dl.c
index
28dc8a9
..
20225df
100644
(file)
--- a/
gmodule/gmodule-dl.c
+++ b/
gmodule/gmodule-dl.c
@@
-12,9
+12,7
@@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
/*
*/
/*
@@
-27,6
+25,7
@@
/*
* MT safe
*/
/*
* MT safe
*/
+#include "config.h"
#include <dlfcn.h>
#include <dlfcn.h>
@@
-90,11
+89,13
@@
fetch_dlerror (gboolean replace_null)
static gpointer
_g_module_open (const gchar *file_name,
static gpointer
_g_module_open (const gchar *file_name,
- gboolean bind_lazy)
+ gboolean bind_lazy,
+ gboolean bind_local)
{
gpointer handle;
{
gpointer handle;
- handle = dlopen (file_name, RTLD_GLOBAL | (bind_lazy ? RTLD_LAZY : RTLD_NOW));
+ handle = dlopen (file_name,
+ (bind_local ? 0 : RTLD_GLOBAL) | (bind_lazy ? RTLD_LAZY : RTLD_NOW));
if (!handle)
g_module_set_error (fetch_dlerror (TRUE));
if (!handle)
g_module_set_error (fetch_dlerror (TRUE));
@@
-110,7
+111,11
@@
_g_module_self (void)
* are required on some systems.
*/
* are required on some systems.
*/
+#ifdef __BIONIC__
+ handle = RTLD_DEFAULT;
+#else
handle = dlopen (NULL, RTLD_GLOBAL | RTLD_LAZY);
handle = dlopen (NULL, RTLD_GLOBAL | RTLD_LAZY);
+#endif
if (!handle)
g_module_set_error (fetch_dlerror (TRUE));
if (!handle)
g_module_set_error (fetch_dlerror (TRUE));
@@
-138,10
+143,13
@@
_g_module_symbol (gpointer handle,
const gchar *symbol_name)
{
gpointer p;
const gchar *symbol_name)
{
gpointer p;
-
+ gchar *msg;
+
+ fetch_dlerror (FALSE);
p = dlsym (handle, symbol_name);
p = dlsym (handle, symbol_name);
- if (!p)
- g_module_set_error (fetch_dlerror (FALSE));
+ msg = fetch_dlerror (FALSE);
+ if (msg)
+ g_module_set_error (msg);
return p;
}
return p;
}