-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
The current dlopen-rs does not implement RTLD_NEXT, which causes issues when loading certain shared libraries that rely on dlsym with the RTLD_NEXT parameter.
Reference implementation approach:
- Use the return address register to retrieve the caller's address.
- Use
add2dsoto locate the shared library corresponding to that address. - Search subsequent shared libraries after that one to resolve the symbol.
This logic aligns with the implementation in musl libc.
If you're interested in implementing this, feel free to give it a try—just make sure to comment in this issue to let me know!😊
目前dlopen-rs还没有实现RTLD_NEXT,这会导致其加载某些动态库时出现问题,因为这些动态库会使用到带有RTLD_NEXT参数的dlsym。
实现方式:
- 使用保存返回地址的寄存器获得调用者的地址。
- 使用add2dso获得该地址对应的动态库。
- 从该动态库之后的动态库中获取符号。
可以参考musl中的实现。
如果你有兴趣实现它的话可以去尝试一下,不过需要在本issue中告诉我一下。😊
Metadata
Metadata
Assignees
Labels
No labels