diff options
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/generic/errno-loc.c | 4 | ||||
-rw-r--r-- | sysdeps/mips/dl-machine.h | 9 | ||||
-rw-r--r-- | sysdeps/powerpc/powerpc32/dl-machine.c | 56 | ||||
-rw-r--r-- | sysdeps/sparc/fpu/bits/mathinline.h | 24 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/setresgid.c | 4 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/i386/setresuid.c | 4 |
6 files changed, 51 insertions, 50 deletions
diff --git a/sysdeps/generic/errno-loc.c b/sysdeps/generic/errno-loc.c index fd16103b11..633590f4f9 100644 --- a/sysdeps/generic/errno-loc.c +++ b/sysdeps/generic/errno-loc.c @@ -1,6 +1,6 @@ /* MT support function to get address of `errno' variable, non-threaded version. - Copyright (C) 1996, 1998, 2002 Free Software Foundation, Inc. + Copyright (C) 1996, 1998, 2002, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -21,7 +21,7 @@ #include <errno.h> #include <tls.h> -#if ! USE___THREAD +#if ! USE___THREAD && !RTLD_PRIVATE_ERRNO #undef errno extern int errno; #endif diff --git a/sysdeps/mips/dl-machine.h b/sysdeps/mips/dl-machine.h index 944f3c10a5..49fdffb93d 100644 --- a/sysdeps/mips/dl-machine.h +++ b/sysdeps/mips/dl-machine.h @@ -231,10 +231,11 @@ elf_machine_runtime_link_map (ElfW(Addr) gpreg, ElfW(Addr) stub_pc) } } - { - struct link_map *l = GL(dl_loaded); + struct link_map *l; + Lmid_t nsid; - while (l) + for (nsid = 0; nsid < DL_NNS; ++nsid) + for (l = GL(dl_ns)[nsid]._ns_loaded; l != NULL; l = l->l_next) { ElfW(Addr) base, limit; const ElfW(Phdr) *p = l->l_phdr; @@ -250,9 +251,7 @@ elf_machine_runtime_link_map (ElfW(Addr) gpreg, ElfW(Addr) stub_pc) return l; } } - l = l->l_next; } - } _dl_signal_error (0, NULL, NULL, "cannot find runtime link map"); return NULL; 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) diff --git a/sysdeps/sparc/fpu/bits/mathinline.h b/sysdeps/sparc/fpu/bits/mathinline.h index 2b578d04cd..7add493660 100644 --- a/sysdeps/sparc/fpu/bits/mathinline.h +++ b/sysdeps/sparc/fpu/bits/mathinline.h @@ -112,7 +112,7 @@ /* Test for negative number. Used in the signbit() macro. */ __MATH_INLINE int -__signbitf (float __x) __THROW +__NTH (__signbitf (float __x)) { __extension__ union { float __f; int __i; } __u = { __f: __x }; return __u.__i < 0; @@ -121,14 +121,14 @@ __signbitf (float __x) __THROW # if __WORDSIZE == 32 __MATH_INLINE int -__signbit (double __x) __THROW +__NTH (__signbit (double __x)) { __extension__ union { double __d; int __i[2]; } __u = { __d: __x }; return __u.__i[0] < 0; } __MATH_INLINE int -__signbitl (long double __x) __THROW +__NTH (__signbitl (long double __x)) { return __signbit ((double)__x); } @@ -136,14 +136,14 @@ __signbitl (long double __x) __THROW # else /* sparc64 */ __MATH_INLINE int -__signbit (double __x) __THROW +__NTH (__signbit (double __x)) { __extension__ union { double __d; long int __i; } __u = { __d: __x }; return __u.__i < 0; } __MATH_INLINE int -__signbitl (long double __x) __THROW +__NTH (__signbitl (long double __x)) { __extension__ union { long double __l; long int __i[2]; } __u = { __l: __x }; return __u.__i[0] < 0; @@ -156,7 +156,7 @@ __signbitl (long double __x) __THROW # if !defined __NO_MATH_INLINES && !__GNUC_PREREQ (3, 2) __MATH_INLINE double -sqrt (double __x) __THROW +__NTH (sqrt (double __x)) { register double __r; __asm ("fsqrtd %1,%0" : "=f" (__r) : "f" (__x)); @@ -164,7 +164,7 @@ sqrt (double __x) __THROW } __MATH_INLINE float -sqrtf (float __x) __THROW +__NTH (sqrtf (float __x)) { register float __r; __asm ("fsqrts %1,%0" : "=f" (__r) : "f" (__x)); @@ -173,7 +173,7 @@ sqrtf (float __x) __THROW # if __WORDSIZE == 64 __MATH_INLINE long double -sqrtl (long double __x) __THROW +__NTH (sqrtl (long double __x)) { long double __r; extern void _Qp_sqrt (long double *, __const__ long double *); @@ -219,16 +219,16 @@ __ieee754_sqrtl (long double __x) # ifndef __NO_MATH_INLINES -__MATH_INLINE double fdim (double __x, double __y) __THROW; +__MATH_INLINE double __NTH (fdim (double __x, double __y)); __MATH_INLINE double -fdim (double __x, double __y) __THROW +__NTH (fdim (double __x, double __y)) { return __x <= __y ? 0 : __x - __y; } -__MATH_INLINE float fdimf (float __x, float __y) __THROW; +__MATH_INLINE float __NTH (fdimf (float __x, float __y)); __MATH_INLINE float -fdimf (float __x, float __y) __THROW +__NTH (fdimf (float __x, float __y)) { return __x <= __y ? 0 : __x - __y; } diff --git a/sysdeps/unix/sysv/linux/i386/setresgid.c b/sysdeps/unix/sysv/linux/i386/setresgid.c index ee782e49f3..614e2c256d 100644 --- a/sysdeps/unix/sysv/linux/i386/setresgid.c +++ b/sysdeps/unix/sysv/linux/i386/setresgid.c @@ -28,7 +28,7 @@ #include <pthread-functions.h> -#ifdef __NR_setresgid +#if defined __NR_setresgid || defined __NR_setresgid32 # ifdef __NR_setresgid32 # if __ASSUME_32BITUIDS == 0 @@ -43,7 +43,7 @@ __setresgid (gid_t rgid, gid_t egid, gid_t sgid) { int result; -# if __ASSUME_32BITUIDS > 0 +# if __ASSUME_32BITUIDS > 0 || !defined __NR_setresgid result = INLINE_SYSCALL (setresgid32, 3, rgid, egid, sgid); # else # ifdef __NR_setresgid32 diff --git a/sysdeps/unix/sysv/linux/i386/setresuid.c b/sysdeps/unix/sysv/linux/i386/setresuid.c index 66e5a1c0c1..4d735ca0f9 100644 --- a/sysdeps/unix/sysv/linux/i386/setresuid.c +++ b/sysdeps/unix/sysv/linux/i386/setresuid.c @@ -28,7 +28,7 @@ #include <pthread-functions.h> -#ifdef __NR_setresuid +#if defined __NR_setresuid || defined __NR_setresuid32 # ifdef __NR_setresuid32 # if __ASSUME_32BITUIDS == 0 @@ -43,7 +43,7 @@ __setresuid (uid_t ruid, uid_t euid, uid_t suid) { int result; -# if __ASSUME_32BITUIDS > 0 +# if __ASSUME_32BITUIDS > 0 || !defined __NR_setresuid result = INLINE_SYSCALL (setresuid32, 3, ruid, euid, suid); # else # ifdef __NR_setresuid32 |