summaryrefslogtreecommitdiff
path: root/components/libc/posix/libdl/dlopen.c
AgeCommit message (Collapse)Author
2026-03-19[libc][libdl] Extract name extraction to shared function and fix edge casescopilot-swe-agent[bot]
Address code review feedback: 1. Extract path stripping logic into shared dlmodule_extract_name() function to avoid code duplication between dlopen() and _dlmodule_set_name(). 2. Fix edge case handling for filenames starting with dot (e.g., .hidden). 3. Add proper documentation for the new function. This ensures consistent module name extraction across all code paths. Co-authored-by: BernardXiong <[email protected]>
2026-03-19[libc][libdl] Fix dlopen() failing to find already-loaded modulescopilot-swe-agent[bot]
Fix name mismatch between dlmodule_find() and _dlmodule_set_name() that caused dlopen() to always reload modules instead of reusing them: 1. In dlopen(): Extract module name from full path before calling dlmodule_find(), matching the stripped name stored by _dlmodule_set_name(). This allows dlopen() to properly find and reuse already-loaded modules. 2. In _dlmodule_set_name(): Fix bug where extension detection searched the entire path instead of just the filename portion. For paths like "/mnt/v1.2/app.so", it would incorrectly find "." in "v1.2" directory name instead of the ".so" extension. Fixes: Module reloading on every dlopen() call, memory leaks from duplicate module instances, and dlclose() cleanup issues. Co-authored-by: BernardXiong <[email protected]>
2024-11-13[libc] add comments for libdl APIs.ligr
2022-01-20[libdl] move libdl to posix folder (#5523)Man, Jianting (Meco)