mirror of
https://sourceware.org/git/glibc.git
synced 2025-05-30 04:04:54 +03:00
Update.
2001-08-22 Ulrich Drepper <drepper@redhat.com> * elf/dl-addr.c (_dl_addr): Fix tests to determine dli_sname. * malloc/mtrace.c (tr_where): dli_sname always points to a non-empty string is != NULL. Reported by Tim Janik <timj@gtk.org>.
This commit is contained in:
parent
2e3e5db668
commit
46b05e5d74
@ -1,3 +1,10 @@
|
|||||||
|
2001-08-22 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* elf/dl-addr.c (_dl_addr): Fix tests to determine dli_sname.
|
||||||
|
* malloc/mtrace.c (tr_where): dli_sname always points to a
|
||||||
|
non-empty string is != NULL.
|
||||||
|
Reported by Tim Janik <timj@gtk.org>.
|
||||||
|
|
||||||
2001-08-22 Jakub Jelinek <jakub@redhat.com>
|
2001-08-22 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
* sunrpc/xdr_rec.c (xdrrec_create): Fix buf sizes before allocating
|
* sunrpc/xdr_rec.c (xdrrec_create): Fix buf sizes before allocating
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/* Locate the shared object symbol nearest a given address.
|
/* Locate the shared object symbol nearest a given address.
|
||||||
Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
|
Copyright (C) 1996-2000, 2001 Free Software Foundation, Inc.
|
||||||
This file is part of the GNU C Library.
|
This file is part of the GNU C Library.
|
||||||
|
|
||||||
The GNU C Library is free software; you can redistribute it and/or
|
The GNU C Library is free software; you can redistribute it and/or
|
||||||
@ -30,6 +30,7 @@ _dl_addr (const void *address, Dl_info *info)
|
|||||||
struct link_map *l, *match;
|
struct link_map *l, *match;
|
||||||
const ElfW(Sym) *symtab, *matchsym;
|
const ElfW(Sym) *symtab, *matchsym;
|
||||||
const char *strtab;
|
const char *strtab;
|
||||||
|
ElfW(Word) strtabsize;
|
||||||
|
|
||||||
/* Find the highest-addressed object that ADDRESS is not below. */
|
/* Find the highest-addressed object that ADDRESS is not below. */
|
||||||
match = NULL;
|
match = NULL;
|
||||||
@ -70,15 +71,17 @@ _dl_addr (const void *address, Dl_info *info)
|
|||||||
|
|
||||||
symtab = (const void *) D_PTR (match, l_info[DT_SYMTAB]);
|
symtab = (const void *) D_PTR (match, l_info[DT_SYMTAB]);
|
||||||
strtab = (const void *) D_PTR (match, l_info[DT_STRTAB]);
|
strtab = (const void *) D_PTR (match, l_info[DT_STRTAB]);
|
||||||
|
strtabsize = match->l_info[DT_STRSZ]->d_un.d_val;
|
||||||
|
|
||||||
/* We assume that the string table follows the symbol table, because
|
/* We assume that the string table follows the symbol table, because
|
||||||
there is no way in ELF to know the size of the dynamic symbol table!! */
|
there is no way in ELF to know the size of the dynamic symbol table!! */
|
||||||
for (matchsym = NULL; (void *) symtab < (void *) strtab; ++symtab)
|
for (matchsym = NULL; (void *) symtab < (void *) strtab; ++symtab)
|
||||||
if (addr >= match->l_addr + symtab->st_value
|
if (addr >= match->l_addr + symtab->st_value
|
||||||
&& (!matchsym
|
&& addr < match->l_addr + symtab->st_value + symtab->st_size
|
||||||
|| (matchsym->st_value < symtab->st_value
|
&& symtab->st_name < strtabsize
|
||||||
|
&& (matchsym == NULL || matchsym->st_value < symtab->st_value)
|
||||||
&& (ELFW(ST_BIND) (symtab->st_info) == STB_GLOBAL
|
&& (ELFW(ST_BIND) (symtab->st_info) == STB_GLOBAL
|
||||||
|| ELFW(ST_BIND) (symtab->st_info) == STB_WEAK))))
|
|| ELFW(ST_BIND) (symtab->st_info) == STB_WEAK))
|
||||||
matchsym = symtab;
|
matchsym = symtab;
|
||||||
|
|
||||||
if (matchsym)
|
if (matchsym)
|
||||||
|
@ -97,7 +97,7 @@ tr_where (caller)
|
|||||||
if (_dl_addr (caller, &info))
|
if (_dl_addr (caller, &info))
|
||||||
{
|
{
|
||||||
char *buf = (char *) "";
|
char *buf = (char *) "";
|
||||||
if (info.dli_sname && info.dli_sname[0])
|
if (info.dli_sname != NULL)
|
||||||
{
|
{
|
||||||
size_t len = strlen (info.dli_sname);
|
size_t len = strlen (info.dli_sname);
|
||||||
buf = alloca (len + 6 + 2 * sizeof (void *));
|
buf = alloca (len + 6 + 2 * sizeof (void *));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user