rt-thread/components
kenneth.liu cffaa514e2 components: libc: fix reset static variable unsolved in dlmodule_load_shared_object
[Problem Description]
In the dlmodule_load_shared_object function,
if a module loading fails once due to an unresolved symbol,
all subsequent attempts to load any module will fail.
The system becomes unable to load modules correctly until a reboot.

[Problem Analysis]
The root cause is that the variable unsolved is defined as static.
Static variables retain their value between function calls.
If a relocation error occurs, unsolved is set to RT_TRUE.
However, when the function returns with an error, the value of unsolved is not reset.
Consequently, on the next function call, unsolved remains RT_TRUE from the previous execution.
This causes the check if (unsolved) to trigger immediately (or after the loop),
forcing the function to return an error regardless of whether the current module is valid or not.

[Solution]
Reset the unsolved variable to RT_FALSE before returning the error code -RT_ERROR.
This ensures the variable is in a clean state for the next function call, preventing state leakage between invocations.

Signed-off-by: Liu Gui <kenneth.liu@sophgo.com>
2026-03-12 13:59:15 +08:00
..
dfs fix[dfs_v1]: prevent vnode ref underflow and double release on close/fd release 2026-02-02 13:33:32 +08:00
drivers [bsp][gd32]:gd32vw553h-eval add wifi support#11175 2026-03-04 18:07:10 +08:00
fal [style][components/fal_rtt] misrac style 2026-02-11 14:51:46 +08:00
finsh fix(finsh): dup / cause error 2026-02-25 18:23:22 +08:00
legacy fix: warnings generated by Kconfig. 2025-09-01 11:50:41 +08:00
libc components: libc: fix reset static variable unsolved in dlmodule_load_shared_object 2026-03-12 13:59:15 +08:00
lwp chore: fix typo in components and libcpu 2026-02-13 21:54:59 +08:00
mm [MM] Update MM System (#10989) 2025-12-03 21:49:52 +08:00
mprotect 实现MPU抽象层 (#8080) 2023-10-30 08:24:55 -04:00
net [bsp][gd32]:gd32vw553h-eval add wifi support#11175 2026-03-04 18:07:10 +08:00
rust [rust] Tidy core defaults and migrate docs to README 2025-12-15 12:50:49 +08:00
utilities fix(ymodem): improve send read loop and unify session cleanup 2026-02-27 09:54:28 +08:00
Kconfig Adding Rust Language Support for RT-Thread #10910 2025-12-08 18:34:25 +08:00
SConscript Adding Rust Language Support for RT-Thread #10910 2025-12-08 18:34:25 +08:00