Comments (6)
It isn't part of POSIX so it should stay out for portability reasons IMHO.
from dlfcn-win32.
Proper implementation of dladdr() tool half of year. So it is hard to do it properly and takes lot of manpower and time. Anyway can work on it, prepare pull request, but do not expect that it would be merged quickly... be prepared that people do not have time for review and also that it may take year (or more) for merging...
from dlfcn-win32.
What I tend to do is have code like:
#ifndef RTLD_WHATEVER
#define RTLD_WHATEVER 0
#endif
Admittedly that won't do here if you really want to... not load. One thing you can do is dlsym(RTLD_DEFAULT, some_sym_only_in_target_DLL)
to check if some symbol you know would only come from that DLL is available, and if it is then you infer that that DLL is loaded. That's not foolproof.
IMO useful extensions should get supported, but if upstream doesn't want them...
from dlfcn-win32.
It isn't part of POSIX so it should stay out for portability reasons IMHO.
But @markand, the whole purpose of this repository is enhancing portability by bringing to WIN32 an API that's foreign to it. One could just as well say "don't use POSIX dlfcn on WIN32, use WIN32 native APIs".
Useful extensions to POSIX are still useful, and if widely used, then one tends to build compatible implementations for systems where those extensions are not available.
from dlfcn-win32.
Well, RTLD_NOLOAD
is not really part of POSIX and I do not think that it is possible to implement this GNU flag on Windows. So I do not see any reason to implement a new flag RTLD_NOLOAD
which would be incompatible with GNU dlopen implementation. Applications would still need to #ifdef code for windows, so it does not bring any value. Just cause problems as people would think that this flag is same as in GNU dlopen which would not be truth.
from dlfcn-win32.
FYI, RTLD_NOLOAD
is not just GNU, but also BSD (FreeBSD, NetBSD, possibly others, have it) and Solaris/Illumos. Given that, it might as well be POSIX. In any case, presumably you'd accept a PR for more non-POSIX extensions provided they are useful enough and not too complex or whatever criteria were applied to dladdr()
.
I'm not sure if there's many apps using it, and it's hard to find any with a GitHub code search (GH: please implement negative filters!), but if you search issues it's much easier (there's only 159 hits), one of which tells how to implement RTLD_NOLOAD
on Windows:
- https://github.com/nagisa/rust_libloading/pull/85/files references https://docs.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-getmodulehandleexw
Basically, GetModuleHandleExW()
will not load the DLL if it isn't already loaded, so it can tell you if it's been loaded.
Searching commits instead of code or issues, I find that, e.g., SBCL (a Common Lisp) uses RTLD_NOLOAD
. Even so, most references are in clones of bionic and what not.
Also, note the RTLD_NOLOAD | RTLD_GLOBAL
combination for promoting an already-loaded object from local to global. This makes RTLD_NOLOAD
at least a wee bit less trivial than just calling GetModuleHandleEx()
.
from dlfcn-win32.
Related Issues (20)
- Understand why settting cmake_minimum_required to 3.20 make test fail HOT 1
- Use of LoadLibraryExA with LOAD_WITH_ALTERED_SEARCH_PATH flag HOT 9
- config.mak: No such file or directory HOT 5
- can I dlsym malloc function? HOT 5
- Add support and docs for using dlfcn-win32 using CMake's FetchContent module HOT 1
- Installation instructions HOT 7
- MAX_PATH restriction feasible after Windows dropped it for Win10? HOT 3
- ERROR Non-library file %TEMP%\temp.dll was processed via WINAPI: 18 From line 138 HOT 3
- Should common subset of ZDICT_cover_params_t and ZDICT_fastCover_params_t be moved into a separate struct and put it into the front of the struct, implementing inheritance this way? HOT 1
- UTF-8 path failes to dlopen HOT 11
- Add automatic tests with Dr. Memory
- dlsym multiple defintion HOT 2
- undefined reference to `GetModuleHandleExA' HOT 6
- AppVeyor test problems HOT 4
- Using dlfcn-win32 as a subproject of libbacktrace, gollvm HOT 3
- Write docs on how to use the dlfcn-win32 in a buildsystem agnostic way
- Add support to dladdr() to inspect export table for additional symbols
- Release 1.3.0 HOT 7
- Testing i586-mingw32msvc-gcc builds via cmake HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dlfcn-win32.