2 /* Support for dynamic loading of extension modules */
4 #include <atheos/image.h>
11 const struct filedescr _PyImport_DynLoadFiletab
[] = {
12 {".so", "rb", C_EXTENSION
},
13 {"module.so", "rb", C_EXTENSION
},
17 dl_funcptr
_PyImport_GetDynLoadFunc(const char *fqname
, const char *shortname
,
18 const char *pathname
, FILE *fp
)
25 printf("load_library %s\n", pathname
);
27 lib
= load_library(pathname
, 0);
32 PyOS_snprintf(buf
, sizeof(buf
), "Failed to load %.200s: %.200s",
33 pathname
, strerror(errno
));
34 PyErr_SetString(PyExc_ImportError
, buf
);
37 PyOS_snprintf(funcname
, sizeof(funcname
), "PyInit_%.200s", shortname
);
39 printf("get_symbol_address %s\n", funcname
);
40 if (get_symbol_address(lib
, funcname
, -1, &p
) < 0) {
46 return (dl_funcptr
) p
;