Commit d32fedc
Luca Toniolo
rtapi: Refuse to load uspace components missing rtapi_app_exit
rtapi_app.h mandates that every component exports both rtapi_app_main
and rtapi_app_exit, but do_load_cmd() only checked for main and
do_unload_cmd() silently skipped the exit call when it was absent.
That let enum.c slip into the tree without rtapi_app_exit for years
(Fixes #3191), visible only once lld 17+'s default
--no-undefined-version made it a hard link error.
Check for rtapi_app_exit in do_load_cmd() alongside rtapi_app_main
and refuse to load the component otherwise, so future omissions
surface immediately at load time with a clear error message.
While here, also correct the dlsym cast for rtapi_app_exit in both
do_load_cmd() and do_unload_cmd() from int(*)(void) to void(*)(void)
to match the component's actual declaration. The int version was
copy-pasted from the rtapi_app_main lookup and while harmless in
practice (the return value was never read) it misrepresents the
function signature.1 parent 387ccce commit d32fedc
1 file changed
+7
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
292 | 298 | | |
293 | 299 | | |
294 | 300 | | |
| |||
320 | 326 | | |
321 | 327 | | |
322 | 328 | | |
323 | | - | |
| 329 | + | |
324 | 330 | | |
325 | 331 | | |
326 | 332 | | |
| |||
0 commit comments