mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
libs/libc/symtab: fix g_allsyms link failure in BUILD_PROTECTED/KERNEL
g_allsyms/g_nallsyms only exist in the kernel image, but symtab_allsyms.c is unconditionally built into libc.a, so user-mode code under CONFIG_BUILD_PROTECTED/CONFIG_BUILD_KERNEL fails to link. Guard the affected code so user-mode libc.a no longer references these kernel-only symbols. Signed-off-by: liang.huang <liang.huang@houmo.ai> Assisted-by: Claude Code:claude-sonnet-5
This commit is contained in:
parent
69249fc9e6
commit
1393567e31
1 changed files with 20 additions and 0 deletions
|
|
@ -31,6 +31,8 @@
|
|||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_BUILD_FLAT) || defined(__KERNEL__)
|
||||
|
||||
extern const struct symtab_s g_allsyms[];
|
||||
extern const int g_nallsyms;
|
||||
|
||||
|
|
@ -115,3 +117,21 @@ FAR const struct symtab_s *allsyms_findbyvalue(FAR void *value,
|
|||
{
|
||||
return allsyms_lookup(NULL, value, size);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
FAR const struct symtab_s *allsyms_findbyname(FAR const char *name,
|
||||
FAR size_t *size)
|
||||
{
|
||||
*size = 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
FAR const struct symtab_s *allsyms_findbyvalue(FAR void *value,
|
||||
FAR size_t *size)
|
||||
{
|
||||
*size = 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_BUILD_FLAT || __KERNEL__ */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue