summaryrefslogtreecommitdiff
path: root/elf
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2005-09-12 07:10:59 +0000
committerJakub Jelinek <jakub@redhat.com>2005-09-12 07:10:59 +0000
commit5e6e144e096c83beefb5bd50ea22da7266e72aee (patch)
tree80b4ba2f5794225b6f0dbee4171394423dc82cf2 /elf
parent753ea4414a6a5994cf156d9a11582d18a1fb2a6f (diff)
Updated to fedora-glibc-20050912T0656
Diffstat (limited to 'elf')
-rw-r--r--elf/dl-addr.c15
-rw-r--r--elf/dl-load.c2
2 files changed, 5 insertions, 12 deletions
diff --git a/elf/dl-addr.c b/elf/dl-addr.c
index 6bd7f7b69c..fa62e40840 100644
--- a/elf/dl-addr.c
+++ b/elf/dl-addr.c
@@ -85,22 +85,15 @@ _dl_addr (const void *address, Dl_info *info,
the string table which generally follows the symbol table. */
symtabend = (const ElfW(Sym) *) strtab;
- /* 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!! */
const ElfW(Sym) *matchsym;
for (matchsym = NULL; (void *) symtab < (void *) symtabend; ++symtab)
- if (addr >= match->l_addr + symtab->st_value
+ if ((ELFW(ST_BIND) (symtab->st_info) == STB_GLOBAL
+ || ELFW(ST_BIND) (symtab->st_info) == STB_WEAK)
#if defined USE_TLS
&& ELFW(ST_TYPE) (symtab->st_info) != STT_TLS
#endif
- && ((symtab->st_size == 0
- && addr == match->l_addr + symtab->st_value)
- || addr < match->l_addr + symtab->st_value + symtab->st_size)
- && 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_WEAK))
+ && DL_ADDR_SYM_MATCH (match, symtab, matchsym, addr)
+ && symtab->st_name < strtabsize)
matchsym = (ElfW(Sym) *) symtab;
if (mapp)
diff --git a/elf/dl-load.c b/elf/dl-load.c
index 677174d036..58b0f91731 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -1200,7 +1200,7 @@ cannot allocate TLS data structures for initial thread");
handle the portion of the segment past the end of the file
mapping. */
__mprotect ((caddr_t) (l->l_addr + c->mapend),
- loadcmds[nloadcmds - 1].allocend - c->mapend,
+ loadcmds[nloadcmds - 1].mapstart - c->mapend,
PROT_NONE);
goto postmap;