runtime_loader: implement RTLD_GROUP

The RTLD_GROUP flag to dlopen comes from Solaris. It makes the symbol
resolution for dlopen not use the global symbols from the current team
(anything that's already loaded). The loaded object must be explicitly
linked against any symbol it needs to use (or it can use dlsym to search
symbols in the global scope explicitly).

This is also how symbol resolution worked in BeOS, meaning we already
have the code to do this, and just need to enable it.

This can be used in dosemu, where DOS-like executable are linked against
their own C library and should not use symbols from libroot.

Fixes #19674.

Change-Id: I8d127c7812a31e231edb1e44edf70b868c2670e7
Reviewed-on: https://review.haiku-os.org/c/haiku/+/9450
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
PulkoMandy
2025-07-11 06:56:43 +00:00
committed by Adrien Destugues
parent aa31f66532
commit d27a926578
5 changed files with 13 additions and 4 deletions
+1
View File
@@ -14,6 +14,7 @@
#define RTLD_LOCAL 0 /* symbols are not available for relocating any other object */
#define RTLD_GLOBAL 2 /* all symbols are available */
#define RTLD_NOLOAD 4 /* do not load any new object */
#define RTLD_GROUP 8 /* do not lookup symbols in the global symbol table */
/* not-yet-POSIX extensions (dlsym() handles) */
#define RTLD_DEFAULT ((void*)0)