From dec989164ab5a3f1af3d20f8022e5a0d04964726 Mon Sep 17 00:00:00 2001 From: Brian Fraser Date: Mon, 3 Feb 2014 21:36:31 +0100 Subject: [PATCH] DynaLoader: On android, dl_load_flags should always be 0x00 The linker ignores all the flags and works as if under RTLD_LOCAL, so don't give users the headache of seeing warnings ala "Can't make loaded symbols global on this platform while loading %s" when using a module that subclasses DynaLoader and defines dl_load_flags to anything else. --- ext/DynaLoader/DynaLoader_pm.PL | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/ext/DynaLoader/DynaLoader_pm.PL b/ext/DynaLoader/DynaLoader_pm.PL index 584f9cb..5fb52a2 100644 --- a/ext/DynaLoader/DynaLoader_pm.PL +++ b/ext/DynaLoader/DynaLoader_pm.PL @@ -85,7 +85,7 @@ package DynaLoader; # Tim.Bunce@ig.co.uk, August 1994 BEGIN { - $VERSION = '1.24_1'; + $VERSION = '1.25'; } use Config; @@ -98,6 +98,7 @@ $dl_debug = $ENV{PERL_DL_DEBUG} || 0 unless defined $dl_debug; # 0x01 make symbols available for linking later dl_load_file's. # (only known to work on Solaris 2 using dlopen(RTLD_GLOBAL)) # (ignored under VMS; effect is built-in to image linking) +# (ignored under Android; the linker always uses RTLD_LOCAL) # # This is called as a class method $module->dl_load_flags. The # definition here will be inherited and result on "default" loading @@ -383,7 +384,12 @@ sub bootstrap { # in this perl code simply because this was the last perl code # it executed. - my $libref = dl_load_file($file, $module->dl_load_flags) or + my $flags = $module->dl_load_flags; + <<$^O-eq-android>> + # See the note above regarding the linker. + $flags = 0x00; + <> + my $libref = dl_load_file($file, $flags) or croak("Can't load '$file' for module $module: ".dl_error()); push(@dl_librefs,$libref); # record loaded object -- 2.7.4