diff options
author | Ulrich Drepper <drepper@redhat.com> | 2004-10-14 16:18:09 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2004-10-14 16:18:09 +0000 |
commit | 5ca3d19c74195e45f48d83b24b10bac55fa078a4 (patch) | |
tree | 033306c56ec1bb5bea3c0db04e54978edf585010 /sysdeps/powerpc/powerpc32/dl-machine.c | |
parent | 7cb92a99fafb8f9f43ba97d4790eff49c206a8e2 (diff) | |
download | glibc-5ca3d19c74195e45f48d83b24b10bac55fa078a4.tar.gz glibc-5ca3d19c74195e45f48d83b24b10bac55fa078a4.tar.xz glibc-5ca3d19c74195e45f48d83b24b10bac55fa078a4.zip |
Update.
2004-10-14 Ulrich Drepper <drepper@redhat.com> * nscd/connections.c (nscd_init): Remove file if not persistent and not shared. Patch by Jerome Borsboom <j.borsboom@erasmusmc.nl>. * sysdeps/unix/sysv/linux/i386/setresuid.c: Handle defined __NR_setresuid32 && !defined __NR_setresuid. * sysdeps/unix/sysv/linux/i386/setresgid.c: Handle defined __NR_setresgid32 && !defined __NR_setresgid. * sysdeps/sparc/fpu/bits/mathinline.h (__signbitf, __signbit, __signbitl, sqrtf, sqrt, sqrtl, fdim, fdimf): Use __NTH macro. * sysdeps/generic/errno-loc.c: Don't undef #errno if RTLD_PRIVATE_ERRNO. * include/errno.h (__errno_location): If RTLD_PRIVATE_ERRNO, add attribute_hidden. * dlfcn/dlinfo.c (dlinfo_doit): Replace iteration over GL(dl_loaded) chain with iteration over all namespaces' _ns_loaded chains. * sysdeps/powerpc/powerpc32/dl-machine.c (__elf_preferred_address): Likewise. * sysdeps/mips/dl-machine.h (elf_machine_runtime_link_map): Likewise.
Diffstat (limited to 'sysdeps/powerpc/powerpc32/dl-machine.c')
-rw-r--r-- | sysdeps/powerpc/powerpc32/dl-machine.c | 56 |
1 files changed, 29 insertions, 27 deletions
diff --git a/sysdeps/powerpc/powerpc32/dl-machine.c b/sysdeps/powerpc/powerpc32/dl-machine.c index 0dce04088b..06960716b9 100644 --- a/sysdeps/powerpc/powerpc32/dl-machine.c +++ b/sysdeps/powerpc/powerpc32/dl-machine.c @@ -101,11 +101,12 @@ weak_extern (__cache_line_size) mapped somewhere else. */ ElfW(Addr) -__elf_preferred_address(struct link_map *loader, size_t maplength, - ElfW(Addr) mapstartpref) +__elf_preferred_address (struct link_map *loader, size_t maplength, + ElfW(Addr) mapstartpref) { ElfW(Addr) low, high; struct link_map *l; + Lmid_t nsid; /* If the object has a preference, load it there! */ if (mapstartpref != 0) @@ -117,29 +118,30 @@ __elf_preferred_address(struct link_map *loader, size_t maplength, be superceded by the program's load address). */ low = 0x0003FFFF; high = 0x70000000; - for (l = GL(dl_loaded); l; l = l->l_next) - { - ElfW(Addr) mapstart, mapend; - mapstart = l->l_map_start & ~(GLRO(dl_pagesize) - 1); - mapend = l->l_map_end | (GLRO(dl_pagesize) - 1); - assert (mapend > mapstart); - - /* Prefer gaps below the main executable, note that l == - _dl_loaded does not work for static binaries loading - e.g. libnss_*.so. */ - if ((mapend >= high || l->l_type == lt_executable) - && high >= mapstart) - high = mapstart; - else if (mapend >= low && low >= mapstart) - low = mapend; - else if (high >= mapend && mapstart >= low) - { - if (high - mapend >= mapstart - low) - low = mapend; - else - high = mapstart; - } - } + for (nsid = 0; nsid < DL_NNS; ++nsid) + for (l = GL(dl_ns)[nsid]._ns_loaded; l; l = l->l_next) + { + ElfW(Addr) mapstart, mapend; + mapstart = l->l_map_start & ~(GLRO(dl_pagesize) - 1); + mapend = l->l_map_end | (GLRO(dl_pagesize) - 1); + assert (mapend > mapstart); + + /* Prefer gaps below the main executable, note that l == + _dl_loaded does not work for static binaries loading + e.g. libnss_*.so. */ + if ((mapend >= high || l->l_type == lt_executable) + && high >= mapstart) + high = mapstart; + else if (mapend >= low && low >= mapstart) + low = mapend; + else if (high >= mapend && mapstart >= low) + { + if (high - mapend >= mapstart - low) + low = mapend; + else + high = mapstart; + } + } high -= 0x10000; /* Allow some room between objects. */ maplength = (maplength | (GLRO(dl_pagesize) - 1)) + 1; @@ -341,8 +343,8 @@ __elf_machine_runtime_setup (struct link_map *map, int lazy, int profile) } Elf32_Addr -__elf_machine_fixup_plt(struct link_map *map, const Elf32_Rela *reloc, - Elf32_Addr *reloc_addr, Elf32_Addr finaladdr) +__elf_machine_fixup_plt (struct link_map *map, const Elf32_Rela *reloc, + Elf32_Addr *reloc_addr, Elf32_Addr finaladdr) { Elf32_Sword delta = finaladdr - (Elf32_Word) reloc_addr; if (delta << 6 >> 6 == delta) |