casaroli commented on code in PR #20723: URL: https://github.com/apache/nuttx/pull/20723#discussion_r4319969864
########## libs/libc/libc.h: ########## @@ -332,12 +332,15 @@ ssize_t lib_parse_hostfile(FAR FILE *stream, FAR struct hostent *host, int lib_restoredir(void); #endif -/* Defined in tls/tls_emutls.c. exit() and pthread_exit() call - * tls_emutls_destruct() through g_tls_emutls_destruct (tls/tls_getinfo.c). +/* Defined in tls/tls_emutls.c. exit(), pthread_exit() and the loader call + * them through these pointers (tls/tls_getinfo.c). */ extern CODE void (*g_tls_emutls_destruct)(void); +extern CODE void (*g_tls_emutls_release)(FAR const void *start, Review Comment: The loader is in every image with ELF support. A direct call links the emutls code there also without `__thread`; `lm3s6965-ek:qemu-protected` (dlopen in the user image) then overflowed its flash by 628 bytes. The pointer is set when the first `__thread` variable gets its index, so a system without `__thread` pays nothing. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
