2004-08-13  Ulrich Drepper  <drepper@redhat.com>

	* elf/sprof.c (read_symbols): When comparing aliases, prefer
	strong over weak symbols if both don't start with '_'.

	* malloc/malloc.c: Use strong_alias instead of weak_alias wherever
	possible.
This commit is contained in:
Ulrich Drepper 2004-08-13 18:39:44 +00:00
parent 5b6f86b374
commit eba19d2be7
3 changed files with 29 additions and 12 deletions

View File

@ -1,3 +1,11 @@
2004-08-13 Ulrich Drepper <drepper@redhat.com>
* elf/sprof.c (read_symbols): When comparing aliases, prefer
strong over weak symbols if both don't start with '_'.
* malloc/malloc.c: Use strong_alias instead of weak_alias wherever
possible.
2004-08-12 Jakub Jelinek <jakub@redhat.com>
* sysdeps/unix/sysv/linux/bits/resource.h: Define non-standard

View File

@ -148,6 +148,7 @@ struct known_symbol
const char *name;
uintptr_t addr;
size_t size;
int weak;
uintmax_t ticks;
uintmax_t calls;
@ -938,6 +939,7 @@ read_symbols (struct shobj *shobj)
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;
@ -952,7 +954,9 @@ read_symbols (struct shobj *shobj)
{
/* 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. */
@ -990,6 +994,7 @@ read_symbols (struct shobj *shobj)
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;
@ -1005,7 +1010,9 @@ read_symbols (struct shobj *shobj)
{
/* 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. */

View File

@ -5439,16 +5439,18 @@ __posix_memalign (void **memptr, size_t alignment, size_t size)
}
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)