diff options
author | Roland McGrath <roland@gnu.org> | 1995-05-31 13:23:14 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1995-05-31 13:23:14 +0000 |
commit | a1a9d215963c548aef245cacd8efa944de69503b (patch) | |
tree | ff96263310f3c2e3c1f90d4ec8b332b7af028d84 /elf/dl-load.c | |
parent | 4174072112e4e2b43cc65a5093a433b4270aed49 (diff) | |
download | glibc-a1a9d215963c548aef245cacd8efa944de69503b.tar glibc-a1a9d215963c548aef245cacd8efa944de69503b.tar.gz glibc-a1a9d215963c548aef245cacd8efa944de69503b.tar.bz2 glibc-a1a9d215963c548aef245cacd8efa944de69503b.zip |
Tue May 30 15:52:32 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* mach/Makefile (server-interfaces): Removed notify and
device_reply. For shlibs with eager binding, libmachuser.so must
not refer to any functions not defined in libc.
Diffstat (limited to 'elf/dl-load.c')
-rw-r--r-- | elf/dl-load.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/elf/dl-load.c b/elf/dl-load.c index f8b37ba346..bb1ad972d4 100644 --- a/elf/dl-load.c +++ b/elf/dl-load.c @@ -158,11 +158,12 @@ _dl_map_object (struct link_map *loader, const char *name, size_t namelen = strlen (name) + 1; - void trypath (const char *dirpath) + inline void trypath (const char *dirpath) { fd = open_path (name, namelen, dirpath, &realname); } + fd = -1; if (loader && loader->l_info[DT_RPATH]) trypath ((const char *) (loader->l_addr + loader->l_info[DT_RPATH]->d_un.d_ptr)); @@ -317,14 +318,14 @@ _dl_map_object (struct link_map *loader, const char *name, if (ph->p_memsz > ph->p_filesz) { /* Extra zero pages should appear at the end of this segment, - after the data mapped from the file. Adjust MAPEND to map - only the data from the file. We will later allocate zero - pages following the data mapping. */ - caddr_t zero = mapat - mapstart + ph->p_filesz; - caddr_t zeroend = mapat - mapstart + ph->p_memsz; - caddr_t zeropage - = (caddr_t) ((Elf32_Addr) (zero + pagesize - 1) - & ~(pagesize - 1)); + after the data mapped from the file. */ + caddr_t zero, zeroend, zeropage; + + mapat += ph->p_vaddr - mapstart; + zero = mapat + ph->p_filesz; + zeroend = mapat + ph->p_memsz; + zeropage = (caddr_t) ((Elf32_Addr) (zero + pagesize - 1) + & ~(pagesize - 1)); if (zeroend < zeropage) /* All the extra data is in the last page of the segment. @@ -342,7 +343,7 @@ _dl_map_object (struct link_map *loader, const char *name, prot|PROT_WRITE) < 0) lose (errno, "cannot change memory protections"); } - memset (zero, 0, zeroend - zero); + memset (zero, 0, zeropage - zero); if ((prot & PROT_WRITE) == 0) mprotect ((caddr_t) ((Elf32_Addr) zero & ~(pagesize - 1)), |