1 // we do better not export anything from LDSO
5 #include <l4/crtn/initpriorities.h>
6 #include <l4/util/util.h>
9 #include <l4/re/util/bitmap_cap_alloc>
15 void *memset(void *dst, int v, size_t s)
18 for (; s > 0; --s, ++d)
25 void *memcpy(void *dst, void const *src, size_t si)
27 char *d = (char *)dst;
28 char const *s = (char const *)src;
29 for (; si > 0; --si, ++s, ++d)
40 size_t strlen(char const *s)
50 #include <l4/re/impl/dataspace_impl.h>
51 #include <l4/re/impl/rm_impl.h>
52 #include <l4/re/impl/namespace_impl.h>
53 #include <l4/re/impl/mem_alloc_impl.h>
55 // must correspond to dl-elf.h
56 #define ELF_RTYPE_CLASS_PLT (0x1)
58 // must correspond to dl-hash.h
60 struct elf_resolve * dyn;
62 struct dyn_elf * next_handle; /* Used by dlopen et al. */
63 struct init_fini init_fini;
64 struct dyn_elf * next;
65 struct dyn_elf * prev;
69 extern struct dyn_elf *_dl_symbol_tables;
70 extern "C" char * _dl_find_hash(const char * name, struct dyn_elf * rpnt,
71 struct elf_resolve *mytpnt, int type_class,
72 struct elf_resolve **tpntp);
74 extern "C" attribute_hidden void *__rtld_l4re_global_env;
75 extern "C" void _dl_dprintf(int, const char *, ...);
76 namespace Vfs_config {
79 typedef void *Dl_open(const char *libname, int flag);
80 static Dl_open *_dl_open;
84 L4Re::Util::Cap_alloc<256> __attribute__((init_priority(INIT_PRIO_L4RE_UTIL_CAP_ALLOC))) __cap_alloc(256); //L4Re::Env::env()->first_free_cap() - 256);
86 L4Re::Util::Cap_alloc_base &cap_alloc = __cap_alloc;
90 L4::Cap<L4Re::Mem_alloc> allocator()
92 return reinterpret_cast<L4Re::Env const *>(__rtld_l4re_global_env)->mem_alloc();
96 load_module(char const *fstype)
100 _dl_open = (Dl_open*)_dl_find_hash("dlopen", _dl_symbol_tables, NULL, ELF_RTYPE_CLASS_PLT, NULL);
105 char const prefix[] = "libl4revfs-fs-";
106 char const suffix[] = ".so";
108 memcpy(name, prefix, sizeof(prefix) - 1);
109 memcpy(name + sizeof(prefix) - 1, fstype, strlen(fstype));
110 memcpy(name + sizeof(prefix) + strlen(fstype) - 1, suffix, sizeof(suffix));
111 return _dl_open(name, RTLD_LOCAL | RTLD_LAZY) ? 0 : -1;
117 extern "C" void __cxa_pure_virtual(void)
122 extern "C" void __cxa_atexit(void)
126 extern "C" void __aeabi_atexit(void)
130 #include <l4/l4re_vfs/impl/ns_fs_impl.h>
131 #include <l4/l4re_vfs/impl/ro_file_impl.h>
132 #include <l4/l4re_vfs/impl/fd_store_impl.h>
133 #include <l4/l4re_vfs/impl/vcon_stream_impl.h>
134 #include <l4/l4re_vfs/impl/vfs_api_impl.h>
135 #include <l4/l4re_vfs/impl/vfs_impl.h>