const char *name;
uintptr_t addr;
size_t size;
+ int weak;
uintmax_t ticks;
uintmax_t calls;
newsym->name = &shobj->strtab[sym->st_name];
newsym->addr = sym->st_value;
newsym->size = sym->st_size;
+ newsym->weak = ELFW(ST_BIND) (sym->st_info) == STB_WEAK;
newsym->ticks = 0;
newsym->calls = 0;
{
/* The function is already defined. See whether we have
a better name here. */
- if ((*existp)->name[0] == '_' && newsym->name[0] != '_')
+ if (((*existp)->name[0] == '_' && newsym->name[0] != '_')
+ || ((*existp)->name[0] != '_' && newsym->name[0] != '_'
+ && (*existp)->weak && !newsym->weak))
*existp = newsym;
else
/* We don't need the allocated memory. */
newsym->name = &strtab[symtab->st_name];
newsym->addr = symtab->st_value;
newsym->size = symtab->st_size;
+ newsym->weak = ELFW(ST_BIND) (symtab->st_info) == STB_WEAK;
newsym->ticks = 0;
newsym->froms = NULL;
newsym->tos = NULL;
{
/* The function is already defined. See whether we have
a better name here. */
- if ((*existp)->name[0] == '_' && newsym->name[0] != '_')
+ if (((*existp)->name[0] == '_' && newsym->name[0] != '_')
+ || ((*existp)->name[0] != '_' && newsym->name[0] != '_'
+ && (*existp)->weak && !newsym->weak))
*existp = newsym;
else
/* We don't need the allocated memory. */
}
weak_alias (__posix_memalign, posix_memalign)
-weak_alias (__libc_calloc, __calloc) weak_alias (__libc_calloc, calloc)
-weak_alias (__libc_free, __cfree) weak_alias (__libc_free, cfree)
-weak_alias (__libc_free, __free) weak_alias (__libc_free, free)
-weak_alias (__libc_malloc, __malloc) weak_alias (__libc_malloc, malloc)
-weak_alias (__libc_memalign, __memalign) weak_alias (__libc_memalign, memalign)
-weak_alias (__libc_realloc, __realloc) weak_alias (__libc_realloc, realloc)
-weak_alias (__libc_valloc, __valloc) weak_alias (__libc_valloc, valloc)
-weak_alias (__libc_pvalloc, __pvalloc) weak_alias (__libc_pvalloc, pvalloc)
-weak_alias (__libc_mallinfo, __mallinfo) weak_alias (__libc_mallinfo, mallinfo)
-weak_alias (__libc_mallopt, __mallopt) weak_alias (__libc_mallopt, mallopt)
+strong_alias (__libc_calloc, __calloc) weak_alias (__libc_calloc, calloc)
+strong_alias (__libc_free, __cfree) weak_alias (__libc_free, cfree)
+strong_alias (__libc_free, __free) strong_alias (__libc_free, free)
+strong_alias (__libc_malloc, __malloc) strong_alias (__libc_malloc, malloc)
+strong_alias (__libc_memalign, __memalign)
+weak_alias (__libc_memalign, memalign)
+strong_alias (__libc_realloc, __realloc) strong_alias (__libc_realloc, realloc)
+strong_alias (__libc_valloc, __valloc) weak_alias (__libc_valloc, valloc)
+strong_alias (__libc_pvalloc, __pvalloc) weak_alias (__libc_pvalloc, pvalloc)
+strong_alias (__libc_mallinfo, __mallinfo)
+weak_alias (__libc_mallinfo, mallinfo)
+strong_alias (__libc_mallopt, __mallopt) weak_alias (__libc_mallopt, mallopt)
weak_alias (__malloc_stats, malloc_stats)
weak_alias (__malloc_usable_size, malloc_usable_size)