#1948 closed enhancement (fixed)
Make dl*() Functions Standard Compliant
Reported by: | bonefish | Owned by: | axeld |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | System/libroot.so | Version: | R1/pre-alpha1 |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
Our dl*() have several issues ATM:
- Multiple calls to dlopen() should open the object only once.
- Passing NULL to dlopen() should open the executable.
- The flags passed to dlopen() are ignored. That is OK for RTLD_LAZY/RTLD_NOW (we always relocate everything when loading), but probably not for RTLD_GLOBAL/RTLD_LOCAL.
- dlsym() searches only the object itself, not dependencies.
- Other issues I have missed.
Change History (9)
follow-up: 2 comment:1 by , 17 years ago
comment:2 by , 17 years ago
Replying to jackburton:
Maybe we should use glibc's dl* functions instead of rolling our own ?
I don't think glibc provides those functions. Given that they need to interface with the platform-specific runtime loader there would be little they could do anyway.
comment:4 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:5 by , 16 years ago
Resolution: | fixed |
---|---|
Status: | closed → reopened |
It seem both the cmake and python ports (others?) are having issues with the dl*() functions still not being quite standards compliant.
comment:6 by , 16 years ago
Scratch python from that last statement, I checked the regression test "test_dl" and it was looking for getpid(), adding ('libroot.so', 'getpid'), to the test seems to fix it.
comment:7 by , 16 years ago
Unlike I assumed before, the POSIX standard requirement that for the relocation of dlopen()ed objects the executable symbols are available as well, is indeed respected by Linux. The runtime loader test suite src/tests/system/runtime_loader/test_suite
just doesn't provide the --export-dynamic
linker flag when building the exectuables.
comment:8 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
Fixed in hrev29112. BTW, please don't reopen enhancement tickets for bug report.
Maybe we should use glibc's dl* functions instead of rolling our own ?