mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
symtabs: improve handling of symbol lookups
When CONFIG_SYMTAB_ORDEREDBYNAME is selected most code will use the ordered search function. When it is not selected no code will use the ordered search function. This change merges the two functions and varies its behaviour based on the config setting, such that all callers can simply call the one search function and get the best behaviour. An additional configuration option allows leading underscores to be stripped from symbols being relocated in loaded objects. This allows toolchains which prefix C symbol with underscores to make loadable ELF objects.
This commit is contained in:
committed by
Xiang Xiao
parent
c80cdf06c2
commit
c9db653c8d
@@ -290,14 +290,8 @@ int elf_symvalue(FAR struct elf_loadinfo_s *loadinfo, FAR Elf_Sym *sym,
|
||||
|
||||
/* Check if the base code exports a symbol of this name */
|
||||
|
||||
#ifdef CONFIG_SYMTAB_ORDEREDBYNAME
|
||||
symbol = symtab_findorderedbyname(exports,
|
||||
(FAR char *)loadinfo->iobuffer,
|
||||
nexports);
|
||||
#else
|
||||
symbol = symtab_findbyname(exports, (FAR char *)loadinfo->iobuffer,
|
||||
nexports);
|
||||
#endif
|
||||
if (!symbol)
|
||||
{
|
||||
berr("SHN_UNDEF: Exported symbol \"%s\" not found\n",
|
||||
|
||||
Reference in New Issue
Block a user