Skip to content

Commit

Permalink
Make RTLD_LOCAL work correctly for preloaded DSOs
Browse files Browse the repository at this point in the history
Follow-up to commit c9a5e63, for the FS.createPreloadedFile()
case.

Make sure loadWebAssemblyModule() and loadDynamicLibrary()
are called with a valid 'localScope' object when invoked
from the .so file type preload handler.
  • Loading branch information
Morten Sørvig committed May 31, 2024
1 parent 9fdffa2 commit 411c380
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -3960,7 +3960,7 @@ def test_dlfcn_rtld_local(self):

def test_dlfcn_with_preload(self):
# Create chain of dependencies and load the first libary with preload plugin.
# main -> libB.so -> libA.sp
# main -> libB.so -> libA.so
create_file('libA.c', r'''
#include <stdio.h>
int libA_fun() {
Expand All @@ -3987,7 +3987,7 @@ def test_dlfcn_with_preload(self):
// Check the file exists in the VFS
struct stat statbuf;
assert(stat("/libB.so", &statbuf) == 0);
void *lib_handle = dlopen("/libB.so", RTLD_NOW);
void *lib_handle = dlopen("/libB.so", RTLD_LOCAL | RTLD_NOW);
assert(lib_handle);
typedef int (*intfunc)();
intfunc x = (intfunc)dlsym(lib_handle, "libB_fun");
Expand Down

0 comments on commit 411c380

Please sign in to comment.