Accepting request 98777 from Base:System

Update to 2.15

OBS-URL: https://build.opensuse.org/request/show/98777
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/glibc?expand=0&rev=100
This commit is contained in:
Stephan Kulow 2012-01-06 10:44:07 +00:00 committed by Git OBS Bridge
parent f18b4d2632
commit e80af12f3a
31 changed files with 522 additions and 3629 deletions

View File

@ -13,7 +13,7 @@ Index: sysdeps/posix/getaddrinfo.c
{
const struct gaih_typeproto *tp = gaih_inet_typeproto;
struct gaih_servtuple *st = (struct gaih_servtuple *) &nullserv;
@@ -766,7 +766,7 @@ gaih_inet (const char *name, const struc
@@ -935,7 +935,7 @@ gaih_inet (const char *name, const struc
if (fct != NULL)
{
if (req->ai_family == AF_INET6
@ -22,7 +22,7 @@ Index: sysdeps/posix/getaddrinfo.c
{
gethosts (AF_INET6, struct in6_addr);
no_inet6_data = no_data;
@@ -2157,7 +2157,7 @@ getaddrinfo (const char *name, const cha
@@ -2418,7 +2418,7 @@ getaddrinfo (const char *name, const cha
if (hints->ai_family == AF_UNSPEC || hints->ai_family == AF_INET
|| hints->ai_family == AF_INET6)
{

View File

@ -1,37 +0,0 @@
From http://sourceware.org/bugzilla/show_bug.cgi?id=10855
2009-10-27 Aurelien Jarno <aurelien@aurel32.net>
* locale/programs/locarchive.c: use MMAP_SHARED to reserve memory
used later with MMAP_FIXED | MMAP_SHARED to cope with different
alignment restrictions.
--- a/locale/programs/locarchive.c
+++ b/locale/programs/locarchive.c
@@ -134,7 +134,7 @@
size_t reserved = RESERVE_MMAP_SIZE;
int xflags = 0;
if (total < reserved
- && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_PRIVATE | MAP_ANON,
+ && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_SHARED | MAP_ANON,
-1, 0)) != MAP_FAILED))
xflags = MAP_FIXED;
else
@@ -397,7 +397,7 @@
size_t reserved = RESERVE_MMAP_SIZE;
int xflags = 0;
if (total < reserved
- && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_PRIVATE | MAP_ANON,
+ && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_SHARED | MAP_ANON,
-1, 0)) != MAP_FAILED))
xflags = MAP_FIXED;
else
@@ -615,7 +615,7 @@
int xflags = 0;
void *p;
if (st.st_size < reserved
- && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_PRIVATE | MAP_ANON,
+ && ((p = mmap64 (NULL, reserved, PROT_NONE, MAP_SHARED | MAP_ANON,
-1, 0)) != MAP_FAILED))
xflags = MAP_FIXED;
else

View File

@ -1,33 +0,0 @@
commit 5615eaf26469f20c2d8c3be5770e12564a1edfff
Author: Roland McGrath <roland@hack.frob.com>
Date: Fri Jun 10 12:45:09 2011 -0700
Quash some new warnings from GCC 4.6.
2011-06-10 Roland McGrath <roland@hack.frob.com>
* elf/dl-open.c (_dl_open): Quash warnings when DL_NNS==1.
diff --git a/elf/dl-open.c b/elf/dl-open.c
index 8d90b56..19fda91 100644
--- a/elf/dl-open.c
+++ b/elf/dl-open.c
@@ -516,7 +516,7 @@ _dl_open (const char *file, int mode, const void *caller_dlopen, Lmid_t nsid,
if (__builtin_expect (nsid == LM_ID_NEWLM, 0))
{
/* Find a new namespace. */
- for (nsid = 1; nsid < GL(dl_nns); ++nsid)
+ for (nsid = 1; DL_NNS > 1 && nsid < GL(dl_nns); ++nsid)
if (GL(dl_ns)[nsid]._ns_loaded == NULL)
break;
@@ -528,8 +528,7 @@ _dl_open (const char *file, int mode, const void *caller_dlopen, Lmid_t nsid,
_dl_signal_error (EINVAL, file, NULL, N_("\
no more namespaces available for dlmopen()"));
}
-
- if (nsid == GL(dl_nns))
+ else if (nsid == GL(dl_nns))
{
__rtld_lock_initialize (GL(dl_ns)[nsid]._ns_unique_sym_table.lock);
++GL(dl_nns);

View File

@ -1,24 +0,0 @@
# patch to fix printf when register_printf_function is in use and the format to
# printf contains more than 64 elements.
#
# extend_alloca modifies nspecs_max (2nd arg) with the size of the space, not the
# number of elements. Use a temporary to store the return value. Explicitly set the correct size.
#
# bnc#733140
#
# Rich Coe (rcoe@wi.rr.com)
#
--- stdio-common/vfprintf.c.orig 2011-11-28 11:53:32.937976831 -0600
+++ stdio-common/vfprintf.c 2011-11-28 16:07:35.546839533 -0600
@@ -1683,8 +1683,10 @@ do_positional:
{
/* Extend the array of format specifiers. */
struct printf_spec *old = specs;
- specs = extend_alloca (specs, nspecs_max,
+ size_t nsize = nspecs_max;
+ specs = extend_alloca (specs, nsize,
2 * nspecs_max * sizeof (*specs));
+ nspecs_max = 2 * nspecs_max;
/* Copy the old array's elements to the new space. */
memmove (specs, old, nspecs * sizeof (struct printf_spec));

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:5a1f7ea9ea887d7d0e7174d76b9f2b99aceae9efedc9d0c708446ae5a2fd4f35
size 15650076

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:65aacbb4b5218b686da63994150e7e34e71d85c45cc7c264b1d6ee55207d0b05
size 15776871

View File

@ -1,569 +0,0 @@
commit d53a73acdbf6ac6eb99cd06f5dd695da58d9e8f5
Author: Ulrich Drepper <drepper@gmail.com>
Date: Tue Sep 6 20:22:37 2011 -0400
Avoid gettimeofday vsyscall
2011-09-06 Ulrich Drepper <drepper@gmail.com>
* sysdeps/unix/sysv/linux/getsysstats.c (__get_nprocs): Don't use
gettimeofday vsyscall, just use time.
diff --git a/sysdeps/unix/sysv/linux/getsysstats.c b/sysdeps/unix/sysv/linux/getsysstats.c
index b9bae3d..7feb7a1 100644
--- a/sysdeps/unix/sysv/linux/getsysstats.c
+++ b/sysdeps/unix/sysv/linux/getsysstats.c
@@ -37,15 +37,6 @@
#include <not-cancel.h>
#include <kernel-features.h>
-#ifndef HAVE_CLOCK_GETTIME_VSYSCALL
-# undef INTERNAL_VSYSCALL
-# define INTERNAL_VSYSCALL INTERNAL_SYSCALL
-# undef INLINE_VSYSCALL
-# define INLINE_VSYSCALL INLINE_SYSCALL
-#else
-# include <bits/libc-vdso.h>
-#endif
-
/* How we can determine the number of available processors depends on
the configuration. There is currently (as of version 2.0.21) no
@@ -141,17 +132,10 @@ __get_nprocs ()
static int cached_result;
static time_t timestamp;
-#ifdef __ASSUME_POSIX_TIMERS
- struct timespec ts;
- INTERNAL_SYSCALL_DECL (err);
- INTERNAL_VSYSCALL (clock_gettime, err, 2, CLOCK_REALTIME, &ts);
-#else
- struct timeval ts;
- __gettimeofday (&ts, NULL);
-#endif
+ time_t now = time (NULL);
time_t prev = timestamp;
atomic_read_barrier ();
- if (ts.tv_sec == prev)
+ if (now == prev)
return cached_result;
/* XXX Here will come a test for the new system call. */
@@ -243,7 +227,7 @@ __get_nprocs ()
out:
cached_result = result;
atomic_write_barrier ();
- timestamp = ts.tv_sec;
+ timestamp = now;
return result;
}
commit a77d3c17dc6517636c1cf6ab9c6bb8c257772354
Author: Ulrich Drepper <drepper@gmail.com>
Date: Tue Sep 6 21:34:11 2011 -0400
Don't unconditionally use clock_gettime vsyscall on x86-64
2011-09-06 Ulrich Drepper <drepper@gmail.com>
* sysdeps/unix/sysv/linux/x86_64/clock_gettime.c: New file.
* sysdeps/unix/sysv/linux/clock_gettime.c (SYSCALL_GETTIME): Allow
already be defined. Change to take two parameters and don't assign
result to variable. Adjust all users.
Define INTERNAL_GETTIME if not already defined.
Use INTERNAL_GETTIME instead of INTERNAL_VSYSCALL got clock_gettime
call.
* sysdeps/unix/sysv/linux/x86_64/sysdep.h: Don't define
HAVE_CLOCK_GETTIME_VSYSCALL.
* sysdeps/unix/clock_gettime.c: Adjust use of SYSDEP_GETTIME_CPU.
diff --git a/sysdeps/unix/clock_gettime.c b/sysdeps/unix/clock_gettime.c
index fbaaf30..d467f2b 100644
--- a/sysdeps/unix/clock_gettime.c
+++ b/sysdeps/unix/clock_gettime.c
@@ -1,5 +1,5 @@
/* clock_gettime -- Get the current time from a POSIX clockid_t. Unix version.
- Copyright (C) 1999-2004, 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 1999-2004, 2005, 2007, 2011 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
@@ -113,7 +113,7 @@ clock_gettime (clockid_t clock_id, struct timespec *tp)
default:
#ifdef SYSDEP_GETTIME_CPU
- SYSDEP_GETTIME_CPU;
+ retval = SYSDEP_GETTIME_CPU (clock_id, tp);
#endif
#if HP_TIMING_AVAIL
if ((clock_id & ((1 << CLOCK_IDFIELD_SIZE) - 1))
diff --git a/sysdeps/unix/sysv/linux/clock_gettime.c b/sysdeps/unix/sysv/linux/clock_gettime.c
index dd3755c..0ae45de 100644
--- a/sysdeps/unix/sysv/linux/clock_gettime.c
+++ b/sysdeps/unix/sysv/linux/clock_gettime.c
@@ -1,5 +1,5 @@
/* clock_gettime -- Get current time from a POSIX clockid_t. Linux version.
- Copyright (C) 2003,2004,2005,2006,2007,2010 Free Software Foundation, Inc.
+ Copyright (C) 2003,2004,2005,2006,2007,2010,2011 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
@@ -32,9 +32,14 @@
# include <bits/libc-vdso.h>
#endif
-#define SYSCALL_GETTIME \
- retval = INLINE_VSYSCALL (clock_gettime, 2, clock_id, tp); \
- break
+#ifndef SYSCALL_GETTIME
+# define SYSCALL_GETTIME(id, tp) \
+ INLINE_VSYSCALL (clock_gettime, 2, id, tp)
+#endif
+#ifndef INTERNAL_GETTIME
+# define INTERNAL_GETTIME(id, tp) \
+ INTERNAL_VSYSCALL (clock_gettime, err, 2, id, tp)
+#endif
#ifdef __ASSUME_POSIX_TIMERS
@@ -44,7 +49,8 @@
SYSDEP_GETTIME_CPUTIME \
case CLOCK_REALTIME: \
case CLOCK_MONOTONIC: \
- SYSCALL_GETTIME
+ retval = SYSCALL_GETTIME (clock_id, tp); \
+ break
# define __libc_missing_posix_timers 0
#elif defined __NR_clock_gettime
@@ -59,7 +65,7 @@ maybe_syscall_gettime (clockid_t clock_id, struct timespec *tp)
if (!__libc_missing_posix_timers)
{
INTERNAL_SYSCALL_DECL (err);
- int r = INTERNAL_VSYSCALL (clock_gettime, err, 2, clock_id, tp);
+ int r = INTERNAL_GETTIME (clock_id, tp);
if (!INTERNAL_SYSCALL_ERROR_P (r, err))
return 0;
@@ -89,7 +95,7 @@ maybe_syscall_gettime (clockid_t clock_id, struct timespec *tp)
/* Fallback code. */ \
if (retval == EINVAL && clock_id == CLOCK_REALTIME) \
retval = realtime_gettime (tp); \
- else \
+ else \
{ \
__set_errno (retval); \
retval = -1; \
@@ -119,7 +125,7 @@ maybe_syscall_gettime_cpu (clockid_t clock_id, struct timespec *tp)
if (!__libc_missing_posix_cpu_timers)
{
INTERNAL_SYSCALL_DECL (err);
- int r = INTERNAL_VSYSCALL (clock_gettime, err, 2, clock_id, tp);
+ int r = INTERNAL_GETTIME (clock_id, tp);
if (!INTERNAL_SYSCALL_ERROR_P (r, err))
return 0;
diff --git a/sysdeps/unix/sysv/linux/x86_64/clock_gettime.c b/sysdeps/unix/sysv/linux/x86_64/clock_gettime.c
new file mode 100644
index 0000000..9d6cd23
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86_64/clock_gettime.c
@@ -0,0 +1,10 @@
+#include "bits/libc-vdso.h"
+
+#ifdef SHARED
+# define SYSCALL_GETTIME(id, tp) \
+ (*__vdso_clock_gettime) (id, tp)
+# define INTERNAL_GETTIME(id, tp) \
+ (*__vdso_clock_gettime) (id, tp)
+#endif
+
+#include "../clock_gettime.c"
diff --git a/sysdeps/unix/sysv/linux/x86_64/sysdep.h b/sysdeps/unix/sysv/linux/x86_64/sysdep.h
index 2b9ea85..a9821dc 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sysdep.h
+++ b/sysdeps/unix/sysv/linux/x86_64/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001-2005, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2001-2005, 2007, 2011 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
@@ -279,8 +279,8 @@
if (INTERNAL_SYSCALL_ERROR_P (sc_ret, sc_err)) \
{ \
iserr: \
- __set_errno (INTERNAL_SYSCALL_ERRNO (sc_ret, sc_err)); \
- sc_ret = -1L; \
+ __set_errno (INTERNAL_SYSCALL_ERRNO (sc_ret, sc_err)); \
+ sc_ret = -1L; \
} \
out: \
sc_ret; \
@@ -304,9 +304,6 @@
v_ret; \
})
-/* List of system calls which are supported as vsyscalls. */
-# define HAVE_CLOCK_GETTIME_VSYSCALL 1
-
# else
# define INLINE_VSYSCALL(name, nr, args...) \
INLINE_SYSCALL (name, nr, ##args)
commit a0e1f41bd487d2202b6c1e0802c0e6c91630fbea
Author: Ulrich Drepper <drepper@gmail.com>
Date: Tue Sep 6 23:17:53 2011 -0400
Don't call gettimeofday vsyscall in x86-64 sem_timedwait
2011-09-06 Ulrich Drepper <drepper@gmail.com>
* sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S (sem_timedwait): Don't
use gettimeofday vsyscall, just call gettimeofday.
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S b/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S
index ca49cb8..2926b36 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/sem_timedwait.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002,2003,2005,2007,2009,2010 Free Software Foundation, Inc.
+/* Copyright (C) 2002,2003,2005,2007,2009,2010,2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -24,10 +24,6 @@
#include <pthread-errnos.h>
#include <structsem.h>
-
-/* For the calculation see asm/vsyscall.h. */
-#define VSYSCALL_ADDR_vgettimeofday 0xffffffffff600000
-
.text
.globl sem_timedwait
@@ -212,9 +208,10 @@ sem_timedwait:
addq $1, NWAITERS(%r12)
7: xorl %esi, %esi
- movq %rsp, %rdi
- movq $VSYSCALL_ADDR_vgettimeofday, %rax
- callq *%rax
+ movq %rsp,%rdi
+ /* This call works because we directly jump to a system call entry
+ which preserves all the registers. */
+ call JUMPTARGET(__gettimeofday)
/* Compute relative timeout. */
movq 8(%rsp), %rax
commit fc8bffcccf5821bca179486abef83a7f82526715
Author: Ulrich Drepper <drepper@gmail.com>
Date: Tue Sep 6 23:50:04 2011 -0400
Fix handling of __vdso_clock_gettime
2011-09-06 Ulrich Drepper <drepper@gmail.com>
* sysdeps/unix/sysv/linux/x86_64/clock_gettime.c (INTERNAL_GETTIME):
Forgot to demangle the pointer.
diff --git a/sysdeps/unix/sysv/linux/x86_64/clock_gettime.c b/sysdeps/unix/sysv/linux/x86_64/clock_gettime.c
index 9d6cd23..7802701 100644
--- a/sysdeps/unix/sysv/linux/x86_64/clock_gettime.c
+++ b/sysdeps/unix/sysv/linux/x86_64/clock_gettime.c
@@ -2,9 +2,13 @@
#ifdef SHARED
# define SYSCALL_GETTIME(id, tp) \
- (*__vdso_clock_gettime) (id, tp)
+ ({ long int (*f) (clockid_t, struct timespec *) = __vdso_clock_gettime; \
+ PTR_DEMANGLE (f); \
+ f (id, tp); })
# define INTERNAL_GETTIME(id, tp) \
- (*__vdso_clock_gettime) (id, tp)
+ ({ long int (*f) (clockid_t, struct timespec *) = __vdso_clock_gettime; \
+ PTR_DEMANGLE (f); \
+ f (id, tp); })
#endif
#include "../clock_gettime.c"
commit 9e5c9dcd57e80cd56c47fd2bf11de8d167176a0e
Author: Ulrich Drepper <drepper@gmail.com>
Date: Wed Sep 7 00:14:06 2011 -0400
Remove gettimeofday vsyscall use from x86-86 libpthread
* sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S: Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
Likewise.
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S: Likewise.
Simplify __vdso_clock_gettime use.
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S b/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
index 3195db2..018da0c 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2006, 2007, 2009, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2007, 2009, 2010, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -68,10 +68,6 @@
#endif
-/* For the calculation see asm/vsyscall.h. */
-#define VSYSCALL_ADDR_vgettimeofday 0xffffffffff600000
-
-
.globl __lll_lock_wait_private
.type __lll_lock_wait_private,@function
.hidden __lll_lock_wait_private
@@ -250,10 +246,9 @@ __lll_timedlock_wait:
/* Get current time. */
movq %rsp, %rdi
xorl %esi, %esi
- movq $VSYSCALL_ADDR_vgettimeofday, %rax
- /* This is a regular function call, all caller-save registers
- might be clobbered. */
- callq *%rax
+ /* This call works because we directly jump to a system call entry
+ which preserves all the registers. */
+ call JUMPTARGET(__gettimeofday)
/* Compute relative timeout. */
movq 8(%rsp), %rax
@@ -402,8 +397,9 @@ __lll_timedwait_tid:
/* Get current time. */
2: movq %rsp, %rdi
xorl %esi, %esi
- movq $VSYSCALL_ADDR_vgettimeofday, %rax
- callq *%rax
+ /* This call works because we directly jump to a system call entry
+ which preserves all the registers. */
+ call JUMPTARGET(__gettimeofday)
/* Compute relative timeout. */
movq 8(%rsp), %rax
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S b/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
index 5218a4f..b7b8b34 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/lowlevelrobustlock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002=2007, 2009, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2011=2007, 2009, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -50,9 +50,6 @@
orl $FUTEX_WAIT_BITSET | FUTEX_CLOCK_REALTIME, reg
#endif
-/* For the calculation see asm/vsyscall.h. */
-#define VSYSCALL_ADDR_vgettimeofday 0xffffffffff600000
-
.globl __lll_robust_lock_wait
.type __lll_robust_lock_wait,@function
@@ -219,10 +216,9 @@ __lll_robust_timedlock_wait:
/* Get current time. */
movq %rsp, %rdi
xorl %esi, %esi
- movq $VSYSCALL_ADDR_vgettimeofday, %rax
- /* This is a regular function call, all caller-save registers
- might be clobbered. */
- callq *%rax
+ /* This call works because we directly jump to a system call entry
+ which preserves all the registers. */
+ call JUMPTARGET(__gettimeofday)
/* Compute relative timeout. */
movq 8(%rsp), %rax
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
index 48ea8b9..d11b297 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_timedwait.S
@@ -26,9 +26,6 @@
#include <kernel-features.h>
-/* For the calculation see asm/vsyscall.h. */
-#define VSYSCALL_ADDR_vgettimeofday 0xffffffffff600000
-
.text
@@ -453,13 +450,11 @@ __pthread_cond_timedwait:
movq __vdso_clock_gettime@GOTPCREL(%rip), %rax
movq (%rax), %rax
PTR_DEMANGLE (%rax)
- jz 26f
call *%rax
- jmp 27f
-# endif
-26: movl $__NR_clock_gettime, %eax
+# else
+ movl $__NR_clock_gettime, %eax
syscall
-27:
+# endif
# ifndef __ASSUME_POSIX_TIMERS
cmpq $-ENOSYS, %rax
je 19f
@@ -473,8 +468,9 @@ __pthread_cond_timedwait:
# else
leaq 24(%rsp), %rdi
xorl %esi, %esi
- movq $VSYSCALL_ADDR_vgettimeofday, %rax
- callq *%rax
+ /* This call works because we directly jump to a system call entry
+ which preserves all the registers. */
+ call JUMPTARGET(__gettimeofday)
/* Compute relative timeout. */
movq 40(%rsp), %rax
@@ -611,8 +607,9 @@ __pthread_cond_timedwait:
/* clock_gettime not available. */
19: leaq 32(%rsp), %rdi
xorl %esi, %esi
- movq $VSYSCALL_ADDR_vgettimeofday, %rax
- callq *%rax
+ /* This call works because we directly jump to a system call entry
+ which preserves all the registers. */
+ call JUMPTARGET(__gettimeofday)
/* Compute relative timeout. */
movq 40(%rsp), %rax
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
index f5d055c..0e6a6ee 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2005, 2007, 2009, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2005,2007,2009,2010,2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -23,10 +23,6 @@
#include <pthread-errnos.h>
#include <kernel-features.h>
-
-/* For the calculation see asm/vsyscall.h. */
-#define VSYSCALL_ADDR_vgettimeofday 0xffffffffff600000
-
.text
.globl pthread_rwlock_timedrdlock
@@ -123,8 +119,9 @@ pthread_rwlock_timedrdlock:
/* Get current time. */
movq %rsp, %rdi
xorl %esi, %esi
- movq $VSYSCALL_ADDR_vgettimeofday, %rax
- callq *%rax
+ /* This call works because we directly jump to a system call entry
+ which preserves all the registers. */
+ call JUMPTARGET(__gettimeofday)
/* Compute relative timeout. */
movq 8(%rsp), %rax
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
index 6ed8b49..16bf920 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
@@ -1,4 +1,5 @@
-/* Copyright (C) 2002, 2003, 2005, 2007, 2009, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2005, 2007, 2009, 2010, 2011
+ Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
@@ -23,10 +24,6 @@
#include <pthread-errnos.h>
#include <kernel-features.h>
-
-/* For the calculation see asm/vsyscall.h. */
-#define VSYSCALL_ADDR_vgettimeofday 0xffffffffff600000
-
.text
.globl pthread_rwlock_timedwrlock
@@ -120,8 +117,9 @@ pthread_rwlock_timedwrlock:
/* Get current time. */
movq %rsp, %rdi
xorl %esi, %esi
- movq $VSYSCALL_ADDR_vgettimeofday, %rax
- callq *%rax
+ /* This call works because we directly jump to a system call entry
+ which preserves all the registers. */
+ call JUMPTARGET(__gettimeofday)
/* Compute relative timeout. */
movq 8(%rsp), %rax
commit e38ba7ab6a56d53bde4fcff250f6928fb473bc3c
Author: Ulrich Drepper <drepper@gmail.com>
Date: Wed Sep 7 00:07:08 2011 -0400
Make sure __vdso_clock_gettime always contains a valid pointer
2011-09-07 Ulrich Drepper <drepper@gmail.com>
* sysdeps/unix/sysv/linux/x86_64/init-first.c
(_libc_vdso_platform_setup): If vDSO is not present store pointer to
syscall wrapper around clock_gettime in __vdso_clock_gettime.
* sysdeps/unix/sysv/linux/x86_64/syscalls.list: Add entry for
clock_gettime.
diff --git a/sysdeps/unix/sysv/linux/x86_64/init-first.c b/sysdeps/unix/sysv/linux/x86_64/init-first.c
index 25cf08b..cb39aca 100644
--- a/sysdeps/unix/sysv/linux/x86_64/init-first.c
+++ b/sysdeps/unix/sysv/linux/x86_64/init-first.c
@@ -17,6 +17,8 @@
02111-1307 USA. */
#ifdef SHARED
+# include <time.h>
+# include <sysdep.h>
# include <dl-vdso.h>
# include <bits/libc-vdso.h>
@@ -27,12 +29,17 @@ strong_alias (__vdso_clock_gettime, __GI___vdso_clock_gettime attribute_hidden)
long int (*__vdso_getcpu) (unsigned *, unsigned *, void *) attribute_hidden;
+extern long int __syscall_clock_gettime (clockid_t, struct timespec *);
+
+
static inline void
_libc_vdso_platform_setup (void)
{
PREPARE_VERSION (linux26, "LINUX_2.6", 61765110);
void *p = _dl_vdso_vsym ("clock_gettime", &linux26);
+ if (p == NULL)
+ p = __syscall_clock_gettime;
PTR_MANGLE (p);
__GI___vdso_clock_gettime = p;
diff --git a/sysdeps/unix/sysv/linux/x86_64/syscalls.list b/sysdeps/unix/sysv/linux/x86_64/syscalls.list
index 3e231a0..ccddb84 100644
--- a/sysdeps/unix/sysv/linux/x86_64/syscalls.list
+++ b/sysdeps/unix/sysv/linux/x86_64/syscalls.list
@@ -14,6 +14,7 @@ semop - semop i:ipi __semop semop
semtimedop - semtimedop i:ipip semtimedop
semget - semget i:iii __semget semget
semctl - semctl i:iiii __semctl semctl
+syscall_clock_gettime EXTRA clock_gettime Ei:ip __syscall_clock_gettime
# proper socket implementations:

View File

@ -1,145 +0,0 @@
From glibc.git (for 2.15):
2011-06-23 H.J. Lu <hongjiu.lu@intel.com>
* sysdeps/unix/sysv/linux/getsysstats.c (__get_nprocs): Use
__gettimeofday instead of gettimeofday.
2011-06-22 Ulrich Drepper <drepper@gmail.com>
* sysdeps/unix/sysv/linux/getsysstats.c (__get_nprocs): Use
/sys/devices/system/cpu/online if it is usable.
* sysdeps/unix/sysv/linux/getsysstats.c (__get_nprocs): Rate limit
reading the information from the /proc filesystem to once a second.
--- glibc-2.13/sysdeps/unix/sysv/linux/getsysstats.c 2010-04-08 10:45:22.000000000 +0200
+++ glibc.git/sysdeps/unix/sysv/linux/getsysstats.c 2011-06-27 09:56:27.359389056 +0200
@@ -1,5 +1,5 @@
/* Determine various system internal values, Linux version.
- Copyright (C) 1996-2003,2006,2007,2009,2010 Free Software Foundation, Inc.
+ Copyright (C) 1996-2003,2006,2007,2009,2010,2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
@@ -35,6 +35,16 @@
#include <atomic.h>
#include <not-cancel.h>
+#include <kernel-features.h>
+
+#ifndef HAVE_CLOCK_GETTIME_VSYSCALL
+# undef INTERNAL_VSYSCALL
+# define INTERNAL_VSYSCALL INTERNAL_SYSCALL
+# undef INLINE_VSYSCALL
+# define INLINE_VSYSCALL INLINE_SYSCALL
+#else
+# include <bits/libc-vdso.h>
+#endif
/* How we can determine the number of available processors depends on
@@ -128,6 +138,22 @@
int
__get_nprocs ()
{
+ static int cached_result;
+ static time_t timestamp;
+
+#ifdef __ASSUME_POSIX_TIMERS
+ struct timespec ts;
+ INTERNAL_SYSCALL_DECL (err);
+ INTERNAL_VSYSCALL (clock_gettime, err, 2, CLOCK_REALTIME, &ts);
+#else
+ struct timeval ts;
+ __gettimeofday (&ts, NULL);
+#endif
+ time_t prev = timestamp;
+ atomic_read_barrier ();
+ if (ts.tv_sec == prev)
+ return cached_result;
+
/* XXX Here will come a test for the new system call. */
const size_t buffer_size = __libc_use_alloca (8192) ? 8192 : 512;
@@ -135,20 +161,65 @@
char *buffer_end = buffer + buffer_size;
char *cp = buffer_end;
char *re = buffer_end;
- int result = 1;
#ifdef O_CLOEXEC
const int flags = O_RDONLY | O_CLOEXEC;
#else
const int flags = O_RDONLY;
#endif
+ int fd = open_not_cancel_2 ("/sys/devices/system/cpu/online", flags);
+ char *l;
+ int result = 0;
+ if (fd != -1)
+ {
+ l = next_line (fd, buffer, &cp, &re, buffer_end);
+ if (l != NULL)
+ do
+ {
+ char *endp;
+ unsigned long int n = strtoul (l, &endp, 10);
+ if (l == endp)
+ {
+ result = 0;
+ break;
+ }
+
+ unsigned long int m = n;
+ if (*endp == '-')
+ {
+ l = endp + 1;
+ m = strtoul (l, &endp, 10);
+ if (l == endp)
+ {
+ result = 0;
+ break;
+ }
+ }
+
+ result += m - n + 1;
+
+ l = endp;
+ while (l < re && isspace (*l))
+ ++l;
+ }
+ while (l < re);
+
+ close_not_cancel_no_status (fd);
+
+ if (result > 0)
+ goto out;
+ }
+
+ cp = buffer_end;
+ re = buffer_end;
+ result = 1;
+
/* The /proc/stat format is more uniform, use it by default. */
- int fd = open_not_cancel_2 ("/proc/stat", flags);
+ fd = open_not_cancel_2 ("/proc/stat", flags);
if (fd != -1)
{
result = 0;
- char *l;
while ((l = next_line (fd, buffer, &cp, &re, buffer_end)) != NULL)
/* The current format of /proc/stat has all the cpu* entries
at the front. We assume here that stays this way. */
@@ -169,6 +240,11 @@
}
}
+ out:
+ cached_result = result;
+ atomic_write_barrier ();
+ timestamp = ts.tv_sec;
+
return result;
}
weak_alias (__get_nprocs, get_nprocs)

View File

@ -1,716 +0,0 @@
commit 3a62d00d408e9ec19479b6c7d39e89021061f9cd
Author: Andreas Schwab <schwab@redhat.com>
Date: Tue Oct 4 16:10:16 2011 +0200
Don't call ifunc functions in trace mode
2011-10-04 Andreas Schwab <schwab@redhat.com>
* include/dlfcn.h (__RTLD_NOIFUNC): Define.
* elf/do-rel.h (elf_dynamic_do_rel): Add parameter skip_ifunc and
pass it down.
* elf/dynamic-link.h: Adjust prototypes of elf_machine_rel,
elf_machine_rela, elf_machine_lazy_rel.
(_ELF_DYNAMIC_DO_RELOC): Add parameter skip_ifunc and pass it down.
(ELF_DYNAMIC_DO_REL): Likewise.
(ELF_DYNAMIC_DO_RELA): Likewise.
(ELF_DYNAMIC_RELOCATE): Likewise.
* elf/dl-reloc.c (_dl_relocate_object): Pass __RTLD_NOIFUNC down
to ELF_DYNAMIC_DO_REL.
* elf/rtld.c (_dl_start): Adjust use of ELF_DYNAMIC_RELOCATE.
(dl_main): In trace mode always set __RTLD_NOIFUNC.
* elf/dl-conflict.c (_dl_resolve_conflicts): Adjust call to
elf_machine_rela.
* sysdeps/i386/dl-machine.h (elf_machine_rel): Add parameter
skip_ifunc, don't call ifunc function if non-zero.
(elf_machine_rela): Likewise.
(elf_machine_lazy_rel): Likewise.
(elf_machine_lazy_rela): Likewise.
* sysdeps/ia64/dl-machine.h (elf_machine_rela): Likewise.
(elf_machine_lazy_rel): Likewise.
* sysdeps/powerpc/powerpc32/dl-machine.h (elf_machine_rela):
Likewise.
(elf_machine_lazy_rel): Likewise.
* sysdeps/powerpc/powerpc64/dl-machine.h (elf_machine_rela):
Likewise.
(elf_machine_lazy_rel): Likewise.
* sysdeps/s390/s390-32/dl-machine.h (elf_machine_rela): Likewise.
(elf_machine_lazy_rel): Likewise.
* sysdeps/s390/s390-64/dl-machine.h (elf_machine_rela): Likewise.
(elf_machine_lazy_rel): Likewise.
* sysdeps/sh/dl-machine.h (elf_machine_rela): Likewise.
(elf_machine_lazy_rel): Likewise.
* sysdeps/sparc/sparc32/dl-machine.h (elf_machine_rela): Likewise.
(elf_machine_lazy_rel): Likewise.
* sysdeps/sparc/sparc64/dl-machine.h (elf_machine_rela): Likewise.
(elf_machine_lazy_rel): Likewise.
* sysdeps/x86_64/dl-machine.h (elf_machine_rela): Likewise.
(elf_machine_lazy_rel): Likewise.
Index: glibc-2.14/elf/dl-conflict.c
===================================================================
--- glibc-2.14.orig/elf/dl-conflict.c
+++ glibc-2.14/elf/dl-conflict.c
@@ -1,5 +1,5 @@
/* Resolve conflicts against already prelinked libraries.
- Copyright (C) 2001, 2002, 2003, 2004, 2005, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2001, 2002, 2003, 2004, 2005, 2008, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2001.
@@ -69,7 +69,8 @@ _dl_resolve_conflicts (struct link_map *
GL(dl_num_cache_relocations) += conflictend - conflict;
for (; conflict < conflictend; ++conflict)
- elf_machine_rela (l, conflict, NULL, NULL, (void *) conflict->r_offset);
+ elf_machine_rela (l, conflict, NULL, NULL, (void *) conflict->r_offset,
+ 0);
}
#endif
}
Index: glibc-2.14/elf/dl-reloc.c
===================================================================
--- glibc-2.14.orig/elf/dl-reloc.c
+++ glibc-2.14/elf/dl-reloc.c
@@ -162,6 +162,7 @@ _dl_relocate_object (struct link_map *l,
/* Initialize it to make the compiler happy. */
const char *errstring = NULL;
int lazy = reloc_mode & RTLD_LAZY;
+ int skip_ifunc = reloc_mode & __RTLD_NOIFUNC;
#ifdef SHARED
/* If we are auditing, install the same handlers we need for profiling. */
@@ -261,7 +262,7 @@ _dl_relocate_object (struct link_map *l,
#include "dynamic-link.h"
- ELF_DYNAMIC_RELOCATE (l, lazy, consider_profiling);
+ ELF_DYNAMIC_RELOCATE (l, lazy, consider_profiling, skip_ifunc);
#ifndef PROF
if (__builtin_expect (consider_profiling, 0))
Index: glibc-2.14/elf/do-rel.h
===================================================================
--- glibc-2.14.orig/elf/do-rel.h
+++ glibc-2.14/elf/do-rel.h
@@ -1,5 +1,5 @@
/* Do relocations for ELF dynamic linking.
- Copyright (C) 1995-2003, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1995-2003, 2004, 2011 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
@@ -52,7 +52,7 @@
auto inline void __attribute__ ((always_inline))
elf_dynamic_do_rel (struct link_map *map,
ElfW(Addr) reladdr, ElfW(Addr) relsize,
- int lazy)
+ int lazy, int skip_ifunc)
{
const ElfW(Rel) *r = (const void *) reladdr;
const ElfW(Rel) *end = (const void *) (reladdr + relsize);
@@ -66,7 +66,7 @@ elf_dynamic_do_rel (struct link_map *map
{
/* Doing lazy PLT relocations; they need very little info. */
for (; r < end; ++r)
- elf_machine_lazy_rel (map, l_addr, r);
+ elf_machine_lazy_rel (map, l_addr, r, skip_ifunc);
}
else
#endif
@@ -119,14 +119,14 @@ elf_dynamic_do_rel (struct link_map *map
ElfW(Half) ndx = version[ELFW(R_SYM) (r->r_info)] & 0x7fff;
elf_machine_rel (map, r, &symtab[ELFW(R_SYM) (r->r_info)],
&map->l_versions[ndx],
- (void *) (l_addr + r->r_offset));
+ (void *) (l_addr + r->r_offset), skip_ifunc);
}
}
#ifndef RTLD_BOOTSTRAP
else
for (; r < end; ++r)
elf_machine_rel (map, r, &symtab[ELFW(R_SYM) (r->r_info)], NULL,
- (void *) (l_addr + r->r_offset));
+ (void *) (l_addr + r->r_offset), skip_ifunc);
#endif
}
}
Index: glibc-2.14/elf/dynamic-link.h
===================================================================
--- glibc-2.14.orig/elf/dynamic-link.h
+++ glibc-2.14/elf/dynamic-link.h
@@ -60,7 +60,7 @@ int internal_function _dl_try_allocate_s
auto inline void __attribute__((always_inline))
elf_machine_rel (struct link_map *map, const ElfW(Rel) *reloc,
const ElfW(Sym) *sym, const struct r_found_version *version,
- void *const reloc_addr);
+ void *const reloc_addr, int skip_ifunc);
auto inline void __attribute__((always_inline))
elf_machine_rel_relative (ElfW(Addr) l_addr, const ElfW(Rel) *reloc,
void *const reloc_addr);
@@ -69,7 +69,7 @@ elf_machine_rel_relative (ElfW(Addr) l_a
auto inline void __attribute__((always_inline))
elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc,
const ElfW(Sym) *sym, const struct r_found_version *version,
- void *const reloc_addr);
+ void *const reloc_addr, int skip_ifunc);
auto inline void __attribute__((always_inline))
elf_machine_rela_relative (ElfW(Addr) l_addr, const ElfW(Rela) *reloc,
void *const reloc_addr);
@@ -77,11 +77,13 @@ elf_machine_rela_relative (ElfW(Addr) l_
# if ELF_MACHINE_NO_RELA || defined ELF_MACHINE_PLT_REL
auto inline void __attribute__((always_inline))
elf_machine_lazy_rel (struct link_map *map,
- ElfW(Addr) l_addr, const ElfW(Rel) *reloc);
+ ElfW(Addr) l_addr, const ElfW(Rel) *reloc,
+ int skip_ifunc);
# else
auto inline void __attribute__((always_inline))
elf_machine_lazy_rel (struct link_map *map,
- ElfW(Addr) l_addr, const ElfW(Rela) *reloc);
+ ElfW(Addr) l_addr, const ElfW(Rela) *reloc,
+ int skip_ifunc);
# endif
#endif
@@ -254,7 +256,7 @@ elf_get_dynamic_info (struct link_map *l
not happen we do something more optimal. */
# ifdef ELF_MACHINE_PLTREL_OVERLAP
-# define _ELF_DYNAMIC_DO_RELOC(RELOC, reloc, map, do_lazy, test_rel) \
+# define _ELF_DYNAMIC_DO_RELOC(RELOC, reloc, map, do_lazy, skip_ifunc, test_rel) \
do { \
struct { ElfW(Addr) start, size; int lazy; } ranges[3]; \
int ranges_index; \
@@ -284,10 +286,11 @@ elf_get_dynamic_info (struct link_map *l
elf_dynamic_do_##reloc ((map), \
ranges[ranges_index].start, \
ranges[ranges_index].size, \
- ranges[ranges_index].lazy); \
+ ranges[ranges_index].lazy, \
+ skip_ifunc); \
} while (0)
# else
-# define _ELF_DYNAMIC_DO_RELOC(RELOC, reloc, map, do_lazy, test_rel) \
+# define _ELF_DYNAMIC_DO_RELOC(RELOC, reloc, map, do_lazy, skip_ifunc, test_rel) \
do { \
struct { ElfW(Addr) start, size; int lazy; } ranges[2]; \
ranges[0].lazy = 0; \
@@ -324,7 +327,8 @@ elf_get_dynamic_info (struct link_map *l
} \
\
if (ELF_DURING_STARTUP) \
- elf_dynamic_do_##reloc ((map), ranges[0].start, ranges[0].size, 0); \
+ elf_dynamic_do_##reloc ((map), ranges[0].start, ranges[0].size, 0, \
+ skip_ifunc); \
else \
{ \
int ranges_index; \
@@ -332,7 +336,8 @@ elf_get_dynamic_info (struct link_map *l
elf_dynamic_do_##reloc ((map), \
ranges[ranges_index].start, \
ranges[ranges_index].size, \
- ranges[ranges_index].lazy); \
+ ranges[ranges_index].lazy, \
+ skip_ifunc); \
} \
} while (0)
# endif
@@ -345,29 +350,29 @@ elf_get_dynamic_info (struct link_map *l
# if ! ELF_MACHINE_NO_REL
# include "do-rel.h"
-# define ELF_DYNAMIC_DO_REL(map, lazy) \
- _ELF_DYNAMIC_DO_RELOC (REL, rel, map, lazy, _ELF_CHECK_REL)
+# define ELF_DYNAMIC_DO_REL(map, lazy, skip_ifunc) \
+ _ELF_DYNAMIC_DO_RELOC (REL, rel, map, lazy, skip_ifunc, _ELF_CHECK_REL)
# else
-# define ELF_DYNAMIC_DO_REL(map, lazy) /* Nothing to do. */
+# define ELF_DYNAMIC_DO_REL(map, lazy, skip_ifunc) /* Nothing to do. */
# endif
# if ! ELF_MACHINE_NO_RELA
# define DO_RELA
# include "do-rel.h"
-# define ELF_DYNAMIC_DO_RELA(map, lazy) \
- _ELF_DYNAMIC_DO_RELOC (RELA, rela, map, lazy, _ELF_CHECK_REL)
+# define ELF_DYNAMIC_DO_RELA(map, lazy, skip_ifunc) \
+ _ELF_DYNAMIC_DO_RELOC (RELA, rela, map, lazy, skip_ifunc, _ELF_CHECK_REL)
# else
-# define ELF_DYNAMIC_DO_RELA(map, lazy) /* Nothing to do. */
+# define ELF_DYNAMIC_DO_RELA(map, lazy, skip_ifunc) /* Nothing to do. */
# endif
/* This can't just be an inline function because GCC is too dumb
to inline functions containing inlines themselves. */
-# define ELF_DYNAMIC_RELOCATE(map, lazy, consider_profile) \
+# define ELF_DYNAMIC_RELOCATE(map, lazy, consider_profile, skip_ifunc) \
do { \
int edr_lazy = elf_machine_runtime_setup ((map), (lazy), \
(consider_profile)); \
- ELF_DYNAMIC_DO_REL ((map), edr_lazy); \
- ELF_DYNAMIC_DO_RELA ((map), edr_lazy); \
+ ELF_DYNAMIC_DO_REL ((map), edr_lazy, skip_ifunc); \
+ ELF_DYNAMIC_DO_RELA ((map), edr_lazy, skip_ifunc); \
} while (0)
#endif
Index: glibc-2.14/elf/rtld.c
===================================================================
--- glibc-2.14.orig/elf/rtld.c
+++ glibc-2.14/elf/rtld.c
@@ -543,7 +543,7 @@ _dl_start (void *arg)
/* Relocate ourselves so we can do normal function calls and
data access using the global offset table. */
- ELF_DYNAMIC_RELOCATE (&bootstrap_map, 0, 0);
+ ELF_DYNAMIC_RELOCATE (&bootstrap_map, 0, 0, 0);
}
bootstrap_map.l_relocated = 1;
@@ -1992,8 +1992,9 @@ ERROR: ld.so: object '%s' cannot be load
/* Relocate the main executable. */
struct relocate_args args = { .l = l,
- .reloc_mode = (GLRO(dl_lazy)
- ? RTLD_LAZY : 0) };
+ .reloc_mode = ((GLRO(dl_lazy)
+ ? RTLD_LAZY : 0)
+ | __RTLD_NOIFUNC) };
_dl_receive_error (print_unresolved, relocate_doit, &args);
/* This loop depends on the dependencies of the executable to
@@ -2070,7 +2071,8 @@ ERROR: ld.so: object '%s' cannot be load
struct relocate_args args;
struct link_map *l;
- args.reloc_mode = GLRO(dl_lazy) ? RTLD_LAZY : 0;
+ args.reloc_mode = ((GLRO(dl_lazy) ? RTLD_LAZY : 0)
+ | __RTLD_NOIFUNC);
l = main_map;
while (l->l_next != NULL)
@@ -2093,7 +2095,7 @@ ERROR: ld.so: object '%s' cannot be load
/* Mark the link map as not yet relocated again. */
GL(dl_rtld_map).l_relocated = 0;
_dl_relocate_object (&GL(dl_rtld_map),
- main_map->l_scope, 0, 0);
+ main_map->l_scope, __RTLD_NOIFUNC, 0);
}
}
#define VERNEEDTAG (DT_NUM + DT_THISPROCNUM + DT_VERSIONTAGIDX (DT_VERNEED))
Index: glibc-2.14/include/dlfcn.h
===================================================================
--- glibc-2.14.orig/include/dlfcn.h
+++ glibc-2.14/include/dlfcn.h
@@ -10,6 +10,7 @@
#define __RTLD_CALLMAP 0x10000000
#define __RTLD_AUDIT 0x08000000
#define __RTLD_SECURE 0x04000000 /* Apply additional security checks. */
+#define __RTLD_NOIFUNC 0x02000000 /* Suppress calling ifunc functions. */
#define __LM_ID_CALLER -2
Index: glibc-2.14/sysdeps/i386/dl-machine.h
===================================================================
--- glibc-2.14.orig/sysdeps/i386/dl-machine.h
+++ glibc-2.14/sysdeps/i386/dl-machine.h
@@ -311,7 +311,7 @@ auto inline void
__attribute ((always_inline))
elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
const Elf32_Sym *sym, const struct r_found_version *version,
- void *const reloc_addr_arg)
+ void *const reloc_addr_arg, int skip_ifunc)
{
Elf32_Addr *const reloc_addr = reloc_addr_arg;
const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
@@ -347,7 +347,8 @@ elf_machine_rel (struct link_map *map, c
if (sym != NULL
&& __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC,
0)
- && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1))
+ && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1)
+ && __builtin_expect (!skip_ifunc, 1))
value = ((Elf32_Addr (*) (void)) value) ();
switch (r_type)
@@ -490,7 +491,7 @@ auto inline void
__attribute__ ((always_inline))
elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
const Elf32_Sym *sym, const struct r_found_version *version,
- void *const reloc_addr_arg)
+ void *const reloc_addr_arg, int skip_ifunc)
{
Elf32_Addr *const reloc_addr = reloc_addr_arg;
const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
@@ -507,8 +508,8 @@ elf_machine_rela (struct link_map *map,
if (sym != NULL
&& __builtin_expect (sym->st_shndx != SHN_UNDEF, 1)
- && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC,
- 0))
+ && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0)
+ && __builtin_expect (!skip_ifunc, 1))
value = ((Elf32_Addr (*) (void)) value) ();
switch (ELF32_R_TYPE (reloc->r_info))
@@ -655,7 +656,8 @@ elf_machine_rela_relative (Elf32_Addr l_
auto inline void
__attribute__ ((always_inline))
elf_machine_lazy_rel (struct link_map *map,
- Elf32_Addr l_addr, const Elf32_Rel *reloc)
+ Elf32_Addr l_addr, const Elf32_Rel *reloc,
+ int skip_ifunc)
{
Elf32_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset);
const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
@@ -706,19 +708,20 @@ elf_machine_lazy_rel (struct link_map *m
ElfW(Half) ndx = version[ELFW(R_SYM) (r->r_info)] & 0x7fff;
elf_machine_rel (map, r, &symtab[ELFW(R_SYM) (r->r_info)],
&map->l_versions[ndx],
- (void *) (l_addr + r->r_offset));
+ (void *) (l_addr + r->r_offset), skip_ifunc);
}
# ifndef RTLD_BOOTSTRAP
else
elf_machine_rel (map, r, &symtab[ELFW(R_SYM) (r->r_info)], NULL,
- (void *) (l_addr + r->r_offset));
+ (void *) (l_addr + r->r_offset), skip_ifunc);
# endif
}
}
else if (__builtin_expect (r_type == R_386_IRELATIVE, 0))
{
Elf32_Addr value = map->l_addr + *reloc_addr;
- value = ((Elf32_Addr (*) (void)) value) ();
+ if (__builtin_expect (!skip_ifunc, 1))
+ value = ((Elf32_Addr (*) (void)) value) ();
*reloc_addr = value;
}
else
@@ -730,7 +733,8 @@ elf_machine_lazy_rel (struct link_map *m
auto inline void
__attribute__ ((always_inline))
elf_machine_lazy_rela (struct link_map *map,
- Elf32_Addr l_addr, const Elf32_Rela *reloc)
+ Elf32_Addr l_addr, const Elf32_Rela *reloc,
+ int skip_ifunc)
{
Elf32_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset);
const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
@@ -747,7 +751,8 @@ elf_machine_lazy_rela (struct link_map *
else if (__builtin_expect (r_type == R_386_IRELATIVE, 0))
{
Elf32_Addr value = map->l_addr + reloc->r_addend;
- value = ((Elf32_Addr (*) (void)) value) ();
+ if (__builtin_expect (!skip_ifunc, 1))
+ value = ((Elf32_Addr (*) (void)) value) ();
*reloc_addr = value;
}
else
Index: glibc-2.14/sysdeps/ia64/dl-machine.h
===================================================================
--- glibc-2.14.orig/sysdeps/ia64/dl-machine.h
+++ glibc-2.14/sysdeps/ia64/dl-machine.h
@@ -377,7 +377,8 @@ elf_machine_rela (struct link_map *map,
const Elf64_Rela *reloc,
const Elf64_Sym *sym,
const struct r_found_version *version,
- void *const reloc_addr_arg)
+ void *const reloc_addr_arg,
+ int skip_ifunc)
{
Elf64_Addr *const reloc_addr = reloc_addr_arg;
const unsigned long int r_type = ELF64_R_TYPE (reloc->r_info);
@@ -493,7 +494,8 @@ elf_machine_rela_relative (Elf64_Addr l_
auto inline void
__attribute ((always_inline))
elf_machine_lazy_rel (struct link_map *map,
- Elf64_Addr l_addr, const Elf64_Rela *reloc)
+ Elf64_Addr l_addr, const Elf64_Rela *reloc,
+ int skip_ifunc)
{
Elf64_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset);
const unsigned long int r_type = ELF64_R_TYPE (reloc->r_info);
Index: glibc-2.14/sysdeps/powerpc/powerpc32/dl-machine.h
===================================================================
--- glibc-2.14.orig/sysdeps/powerpc/powerpc32/dl-machine.h
+++ glibc-2.14/sysdeps/powerpc/powerpc32/dl-machine.h
@@ -280,7 +280,7 @@ extern void _dl_reloc_overflow (struct l
auto inline void __attribute__ ((always_inline))
elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
const Elf32_Sym *sym, const struct r_found_version *version,
- void *const reloc_addr_arg)
+ void *const reloc_addr_arg, int skip_ifunc)
{
Elf32_Addr *const reloc_addr = reloc_addr_arg;
const Elf32_Sym *const refsym = sym;
@@ -315,7 +315,8 @@ elf_machine_rela (struct link_map *map,
if (sym != NULL
&& __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0)
- && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1))
+ && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1)
+ && __builtin_expect (!skip_ifunc, 1))
value = ((Elf32_Addr (*) (void)) value) ();
/* A small amount of code is duplicated here for speed. In libc,
@@ -391,7 +392,8 @@ elf_machine_rela_relative (Elf32_Addr l_
auto inline void __attribute__ ((always_inline))
elf_machine_lazy_rel (struct link_map *map,
- Elf32_Addr l_addr, const Elf32_Rela *reloc)
+ Elf32_Addr l_addr, const Elf32_Rela *reloc,
+ int skip_ifunc)
{
/* elf_machine_runtime_setup handles this. */
}
Index: glibc-2.14/sysdeps/powerpc/powerpc64/dl-machine.h
===================================================================
--- glibc-2.14.orig/sysdeps/powerpc/powerpc64/dl-machine.h
+++ glibc-2.14/sysdeps/powerpc/powerpc64/dl-machine.h
@@ -558,7 +558,8 @@ elf_machine_rela (struct link_map *map,
const Elf64_Rela *reloc,
const Elf64_Sym *sym,
const struct r_found_version *version,
- void *const reloc_addr_arg)
+ void *const reloc_addr_arg,
+ int skip_ifunc)
{
Elf64_Addr *const reloc_addr = reloc_addr_arg;
const int r_type = ELF64_R_TYPE (reloc->r_info);
@@ -583,7 +584,8 @@ elf_machine_rela (struct link_map *map,
if (sym != NULL
&& __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0)
- && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1))
+ && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1)
+ && __builtin_expect (!skip_ifunc, 1))
value = resolve_ifunc (value, map, sym_map);
/* For relocs that don't edit code, return.
@@ -596,12 +598,14 @@ elf_machine_rela (struct link_map *map,
return;
case R_PPC64_IRELATIVE:
- value = resolve_ifunc (value, map, sym_map);
+ if (__builtin_expect (!skip_ifunc, 1))
+ value = resolve_ifunc (value, map, sym_map);
*reloc_addr = value;
return;
case R_PPC64_JMP_IREL:
- value = resolve_ifunc (value, map, sym_map);
+ if (__builtin_expect (!skip_ifunc, 1))
+ value = resolve_ifunc (value, map, sym_map);
/* Fall thru */
case R_PPC64_JMP_SLOT:
#ifdef RESOLVE_CONFLICT_FIND_MAP
@@ -852,7 +856,8 @@ elf_machine_rela (struct link_map *map,
auto inline void __attribute__ ((always_inline))
elf_machine_lazy_rel (struct link_map *map,
- Elf64_Addr l_addr, const Elf64_Rela *reloc)
+ Elf64_Addr l_addr, const Elf64_Rela *reloc,
+ int skip_ifunc)
{
/* elf_machine_runtime_setup handles this. */
}
Index: glibc-2.14/sysdeps/s390/s390-32/dl-machine.h
===================================================================
--- glibc-2.14.orig/sysdeps/s390/s390-32/dl-machine.h
+++ glibc-2.14/sysdeps/s390/s390-32/dl-machine.h
@@ -275,7 +275,7 @@ auto inline void
__attribute__ ((always_inline))
elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
const Elf32_Sym *sym, const struct r_found_version *version,
- void *const reloc_addr_arg)
+ void *const reloc_addr_arg, int skip_ifunc)
{
Elf32_Addr *const reloc_addr = reloc_addr_arg;
const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
@@ -434,7 +434,8 @@ elf_machine_rela_relative (Elf32_Addr l_
auto inline void
__attribute__ ((always_inline))
elf_machine_lazy_rel (struct link_map *map,
- Elf32_Addr l_addr, const Elf32_Rela *reloc)
+ Elf32_Addr l_addr, const Elf32_Rela *reloc,
+ int skip_ifunc)
{
Elf32_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset);
const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
Index: glibc-2.14/sysdeps/s390/s390-64/dl-machine.h
===================================================================
--- glibc-2.14.orig/sysdeps/s390/s390-64/dl-machine.h
+++ glibc-2.14/sysdeps/s390/s390-64/dl-machine.h
@@ -247,7 +247,7 @@ auto inline void
__attribute__ ((always_inline))
elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
const Elf64_Sym *sym, const struct r_found_version *version,
- void *const reloc_addr_arg)
+ void *const reloc_addr_arg, int skip_ifunc)
{
Elf64_Addr *const reloc_addr = reloc_addr_arg;
const unsigned int r_type = ELF64_R_TYPE (reloc->r_info);
@@ -413,7 +413,8 @@ elf_machine_rela_relative (Elf64_Addr l_
auto inline void
__attribute__ ((always_inline))
elf_machine_lazy_rel (struct link_map *map,
- Elf64_Addr l_addr, const Elf64_Rela *reloc)
+ Elf64_Addr l_addr, const Elf64_Rela *reloc,
+ int skip_ifunc)
{
Elf64_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset);
const unsigned int r_type = ELF64_R_TYPE (reloc->r_info);
Index: glibc-2.14/sysdeps/sh/dl-machine.h
===================================================================
--- glibc-2.14.orig/sysdeps/sh/dl-machine.h
+++ glibc-2.14/sysdeps/sh/dl-machine.h
@@ -268,7 +268,7 @@ auto inline void
__attribute ((always_inline))
elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
const Elf32_Sym *sym, const struct r_found_version *version,
- void *const reloc_addr_arg)
+ void *const reloc_addr_arg, int skip_ifunc)
{
Elf32_Addr *const reloc_addr = reloc_addr_arg;
const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
@@ -454,7 +454,8 @@ elf_machine_rela_relative (Elf32_Addr l_
auto inline void
__attribute__ ((always_inline))
elf_machine_lazy_rel (struct link_map *map,
- Elf32_Addr l_addr, const Elf32_Rela *reloc)
+ Elf32_Addr l_addr, const Elf32_Rela *reloc,
+ int skip_ifunc)
{
Elf32_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset);
/* Check for unexpected PLT reloc type. */
Index: glibc-2.14/sysdeps/sparc/sparc32/dl-machine.h
===================================================================
--- glibc-2.14.orig/sysdeps/sparc/sparc32/dl-machine.h
+++ glibc-2.14/sysdeps/sparc/sparc32/dl-machine.h
@@ -347,7 +347,7 @@ auto inline void
__attribute__ ((always_inline))
elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
const Elf32_Sym *sym, const struct r_found_version *version,
- void *const reloc_addr_arg)
+ void *const reloc_addr_arg, int skip_ifunc)
{
Elf32_Addr *const reloc_addr = reloc_addr_arg;
const Elf32_Sym *const refsym = sym;
@@ -397,7 +397,8 @@ elf_machine_rela (struct link_map *map,
if (sym != NULL
&& __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0)
- && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1))
+ && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1)
+ && __builtin_expect (!skip_ifunc, 1))
{
value = ((Elf32_Addr (*) (int)) value) (GLRO(dl_hwcap));
}
@@ -552,7 +553,8 @@ elf_machine_rela_relative (Elf32_Addr l_
auto inline void
__attribute__ ((always_inline))
elf_machine_lazy_rel (struct link_map *map,
- Elf32_Addr l_addr, const Elf32_Rela *reloc)
+ Elf32_Addr l_addr, const Elf32_Rela *reloc,
+ int skip_ifunc)
{
Elf32_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset);
const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
@@ -562,7 +564,8 @@ elf_machine_lazy_rel (struct link_map *m
else if (r_type == R_SPARC_JMP_IREL)
{
Elf32_Addr value = map->l_addr + reloc->r_addend;
- value = ((Elf32_Addr (*) (int)) value) (GLRO(dl_hwcap));
+ if (__builtin_expect (!skip_ifunc, 1))
+ value = ((Elf32_Addr (*) (int)) value) (GLRO(dl_hwcap));
sparc_fixup_plt (reloc, reloc_addr, value, 1, 1);
}
else if (r_type == R_SPARC_NONE)
Index: glibc-2.14/sysdeps/sparc/sparc64/dl-machine.h
===================================================================
--- glibc-2.14.orig/sysdeps/sparc/sparc64/dl-machine.h
+++ glibc-2.14/sysdeps/sparc/sparc64/dl-machine.h
@@ -375,7 +375,7 @@ auto inline void
__attribute__ ((always_inline))
elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
const Elf64_Sym *sym, const struct r_found_version *version,
- void *const reloc_addr_arg)
+ void *const reloc_addr_arg, int skip_ifunc)
{
Elf64_Addr *const reloc_addr = reloc_addr_arg;
#if !defined RTLD_BOOTSTRAP && !defined RESOLVE_CONFLICT_FIND_MAP
@@ -429,7 +429,8 @@ elf_machine_rela (struct link_map *map,
if (sym != NULL
&& __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0)
- && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1))
+ && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1)
+ && __builtin_expect (!skip_ifunc, 1))
value = ((Elf64_Addr (*) (int)) value) (GLRO(dl_hwcap));
switch (r_type)
@@ -647,7 +648,8 @@ elf_machine_rela_relative (Elf64_Addr l_
auto inline void
__attribute__ ((always_inline))
elf_machine_lazy_rel (struct link_map *map,
- Elf64_Addr l_addr, const Elf64_Rela *reloc)
+ Elf64_Addr l_addr, const Elf64_Rela *reloc,
+ int skip_ifunc)
{
Elf64_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset);
const unsigned int r_type = ELF64_R_TYPE (reloc->r_info);
@@ -658,7 +660,8 @@ elf_machine_lazy_rel (struct link_map *m
|| r_type == R_SPARC_IRELATIVE)
{
Elf64_Addr value = map->l_addr + reloc->r_addend;
- value = ((Elf64_Addr (*) (int)) value) (GLRO(dl_hwcap));
+ if (__builtin_expect (!skip_ifunc, 1))
+ value = ((Elf64_Addr (*) (int)) value) (GLRO(dl_hwcap));
if (r_type == R_SPARC_JMP_IREL)
{
/* 'high' is always zero, for large PLT entries the linker
Index: glibc-2.14/sysdeps/x86_64/dl-machine.h
===================================================================
--- glibc-2.14.orig/sysdeps/x86_64/dl-machine.h
+++ glibc-2.14/sysdeps/x86_64/dl-machine.h
@@ -261,7 +261,7 @@ auto inline void
__attribute__ ((always_inline))
elf_machine_rela (struct link_map *map, const Elf64_Rela *reloc,
const Elf64_Sym *sym, const struct r_found_version *version,
- void *const reloc_addr_arg)
+ void *const reloc_addr_arg, int skip_ifunc)
{
Elf64_Addr *const reloc_addr = reloc_addr_arg;
const unsigned long int r_type = ELF64_R_TYPE (reloc->r_info);
@@ -299,7 +299,8 @@ elf_machine_rela (struct link_map *map,
if (sym != NULL
&& __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC,
0)
- && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1))
+ && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1)
+ && __builtin_expect (!skip_ifunc, 1))
value = ((Elf64_Addr (*) (void)) value) ();
# if defined RTLD_BOOTSTRAP && !USE___THREAD
@@ -470,7 +471,8 @@ elf_machine_rela_relative (Elf64_Addr l_
auto inline void
__attribute ((always_inline))
elf_machine_lazy_rel (struct link_map *map,
- Elf64_Addr l_addr, const Elf64_Rela *reloc)
+ Elf64_Addr l_addr, const Elf64_Rela *reloc,
+ int skip_ifunc)
{
Elf64_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset);
const unsigned long int r_type = ELF64_R_TYPE (reloc->r_info);
@@ -497,7 +499,8 @@ elf_machine_lazy_rel (struct link_map *m
else if (__builtin_expect (r_type == R_X86_64_IRELATIVE, 0))
{
Elf64_Addr value = map->l_addr + reloc->r_addend;
- value = ((Elf64_Addr (*) (void)) value) ();
+ if (__builtin_expect (!skip_ifunc, 1))
+ value = ((Elf64_Addr (*) (void)) value) ();
*reloc_addr = value;
}
else

View File

@ -0,0 +1,24 @@
diff --git a/nss/nss_db/db-init.c b/nss/nss_db/db-init.c
index 8228d61..85ac48f 100644
--- a/nss/nss_db/db-init.c
+++ b/nss/nss_db/db-init.c
@@ -18,6 +18,7 @@
02111-1307 USA. */
#include <paths.h>
+#include <string.h>
#include <nscd/nscd.h>
diff --git a/nss/nss_db/db-initgroups.c b/nss/nss_db/db-initgroups.c
index aa8163b..1b806e5 100644
--- a/nss/nss_db/db-initgroups.c
+++ b/nss/nss_db/db-initgroups.c
@@ -22,6 +22,7 @@
#include <errno.h>
#include <grp.h>
#include <paths.h>
+#include <string.h>
#include "nss_db.h"

View File

@ -1,479 +0,0 @@
commit 91b392a4bab0c2dc90e7e3ff914dec20b97adca8
Author: Ulrich Drepper <drepper@gmail.com>
Date: Sun Aug 21 13:52:28 2011 -0400
Use ifuncs for time and gettimeofday on x86-64
2011-08-21 Ulrich Drepper <drepper@gmail.com>
* sysdeps/unix/sysv/linux/x86_64/gettimeofday.S: Removed.
* sysdeps/unix/sysv/linux/x86_64/time.S: Removed.
* sysdeps/unix/sysv/linux/x86_64/gettimeofday.c: New file.
* sysdeps/unix/sysv/linux/x86_64/time.c: New file.
* sysdeps/unix/sysv/linux/x86_64/bits/libc-vdso.h: Remove declaration
of __vdso_gettimeofday.
* sysdeps/unix/sysv/linux/x86_64/init-first.c: Remove definition of
__vdso_gettimeofday and __vdso_time. Define __vdso_getcpu with
attribute_hidden.
(_libc_vdso_platform_setup): Remove initialization of
__vdso_gettimeofday and __vdso_time.
diff --git a/sysdeps/unix/sysv/linux/x86_64/bits/libc-vdso.h b/sysdeps/unix/sysv/linux/x86_64/bits/libc-vdso.h
index d7123c9..f9bf84e 100644
--- a/sysdeps/unix/sysv/linux/x86_64/bits/libc-vdso.h
+++ b/sysdeps/unix/sysv/linux/x86_64/bits/libc-vdso.h
@@ -1,5 +1,5 @@
/* Resolve function pointers to VDSO functions.
- Copyright (C) 2005, 2007 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2007, 2011 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
@@ -25,9 +25,6 @@
#ifdef SHARED
-extern long int (*__vdso_gettimeofday) (struct timeval *, void *)
- attribute_hidden;
-
extern long int (*__vdso_clock_gettime) (clockid_t, struct timespec *);
#endif
diff --git a/sysdeps/unix/sysv/linux/x86_64/gettimeofday.S b/sysdeps/unix/sysv/linux/x86_64/gettimeofday.S
deleted file mode 100644
index f618e73..0000000
--- a/sysdeps/unix/sysv/linux/x86_64/gettimeofday.S
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Copyright (C) 2002, 2003, 2007 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
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#include <sysdep.h>
-#define _ERRNO_H 1
-#include <bits/errno.h>
-
-/* For the calculation see asm/vsyscall.h. */
-#define VSYSCALL_ADDR_vgettimeofday 0xffffffffff600000
-
-
-ENTRY (__gettimeofday)
- /* Align stack. */
- sub $0x8, %rsp
- cfi_adjust_cfa_offset(8)
-#ifdef SHARED
- movq __vdso_gettimeofday(%rip), %rax
- PTR_DEMANGLE (%rax)
-#else
- movq $VSYSCALL_ADDR_vgettimeofday, %rax
-#endif
- callq *%rax
- /* Check error return. */
- cmpl $-4095, %eax
- jae SYSCALL_ERROR_LABEL
-
-L(pseudo_end):
- add $0x8, %rsp
- cfi_adjust_cfa_offset(-8)
- ret
-PSEUDO_END(__gettimeofday)
-
-strong_alias (__gettimeofday, __gettimeofday_internal)
-weak_alias (__gettimeofday, gettimeofday)
diff --git a/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c b/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c
new file mode 100644
index 0000000..1a773d6
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c
@@ -0,0 +1,49 @@
+/* Copyright (C) 2002, 2003, 2007, 2011 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <dl-vdso.h>
+
+
+#define VSYSCALL_ADDR_vgettimeofday 0xffffffffff600000ul
+
+
+#ifdef SHARED
+void *gettimeofday_ifunc (void) __asm__ ("__gettimeofday");
+
+void *
+gettimeofday_ifunc (void)
+{
+ PREPARE_VERSION (linux26, "LINUX_2.6", 61765110);
+
+ /* If the vDSO is not available we fall back on the old vsyscall. */
+ return (_dl_vdso_vsym ("gettimeofday", &linux26)
+ ?: (void *) VSYSCALL_ADDR_vgettimeofday);
+}
+__asm (".type __gettimeofday, %gnu_indirect_function");
+#else
+# include <sys/time.h>
+
+int
+__gettimeofday (struct timeval *tv, struct timezone *tz)
+{
+ return ((int (*) (struct timeval *, struct timezone *)) VSYSCALL_ADDR_vgettimeofday) (tv, tz);
+}
+#endif
+
+weak_alias (__gettimeofday, gettimeofday)
+strong_alias (__gettimeofday, __gettimeofday_internal)
diff --git a/sysdeps/unix/sysv/linux/x86_64/init-first.c b/sysdeps/unix/sysv/linux/x86_64/init-first.c
index e676f62..25cf08b 100644
--- a/sysdeps/unix/sysv/linux/x86_64/init-first.c
+++ b/sysdeps/unix/sysv/linux/x86_64/init-first.c
@@ -20,15 +20,11 @@
# include <dl-vdso.h>
# include <bits/libc-vdso.h>
-long int (*__vdso_gettimeofday) (struct timeval *, void *) attribute_hidden;
-
long int (*__vdso_clock_gettime) (clockid_t, struct timespec *)
__attribute__ ((nocommon));
strong_alias (__vdso_clock_gettime, __GI___vdso_clock_gettime attribute_hidden)
-long int (*__vdso_getcpu) (unsigned *, unsigned *, void *);
-
-long int (*__vdso_time) (time_t *) attribute_hidden;
+long int (*__vdso_getcpu) (unsigned *, unsigned *, void *) attribute_hidden;
static inline void
@@ -36,15 +32,7 @@ _libc_vdso_platform_setup (void)
{
PREPARE_VERSION (linux26, "LINUX_2.6", 61765110);
- void *p = _dl_vdso_vsym ("gettimeofday", &linux26);
- /* If the vDSO is not available we fall back on the old vsyscall. */
-#define VSYSCALL_ADDR_vgettimeofday 0xffffffffff600000ul
- if (p == NULL)
- p = (void *) VSYSCALL_ADDR_vgettimeofday;
- PTR_MANGLE (p);
- __vdso_gettimeofday = p;
-
- p = _dl_vdso_vsym ("clock_gettime", &linux26);
+ void *p = _dl_vdso_vsym ("clock_gettime", &linux26);
PTR_MANGLE (p);
__GI___vdso_clock_gettime = p;
@@ -55,14 +43,6 @@ _libc_vdso_platform_setup (void)
p = (void *) VSYSCALL_ADDR_vgetcpu;
PTR_MANGLE (p);
__vdso_getcpu = p;
-
- p = _dl_vdso_vsym ("time", &linux26);
- /* If the vDSO is not available we fall back on the old vsyscall. */
-#define VSYSCALL_ADDR_vtime 0xffffffffff600400
- if (p == NULL)
- p = (void *) VSYSCALL_ADDR_vtime;
- PTR_MANGLE (p);
- __vdso_time = p;
}
# define VDSO_SETUP _libc_vdso_platform_setup
diff --git a/sysdeps/unix/sysv/linux/x86_64/time.S b/sysdeps/unix/sysv/linux/x86_64/time.S
deleted file mode 100644
index 66d7498..0000000
--- a/sysdeps/unix/sysv/linux/x86_64/time.S
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Copyright (C) 2001,02, 2003, 2011 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
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
-
-#include <sysdep.h>
-#define _ERRNO_H 1
-#include <bits/errno.h>
-
-/* For the calculation see asm/vsyscall.h. */
-#define VSYSCALL_ADDR_vtime 0xffffffffff600400
-
-
-/* Return the current time as a `time_t' and also put it in *T if T is
- not NULL. Time is represented as seconds from Jan 1 00:00:00 1970. */
-
-ENTRY (time)
- /* Align stack. */
- sub $0x8, %rsp
- cfi_adjust_cfa_offset(8)
-
-#ifdef SHARED
- movq __vdso_time(%rip), %rax
- PTR_DEMANGLE (%rax)
-#else
- movq $VSYSCALL_ADDR_vtime, %rax
-#endif
- callq *%rax
-
- add $0x8, %rsp
- cfi_adjust_cfa_offset(-8)
- ret
-PSEUDO_END_NOERRNO(time)
-libc_hidden_def (time)
diff --git a/sysdeps/unix/sysv/linux/x86_64/time.c b/sysdeps/unix/sysv/linux/x86_64/time.c
new file mode 100644
index 0000000..698d561
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/x86_64/time.c
@@ -0,0 +1,47 @@
+/* Copyright (C) 2001,02, 2003, 2011 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#include <dl-vdso.h>
+
+
+#define VSYSCALL_ADDR_vtime 0xffffffffff600400
+
+
+#ifdef SHARED
+void *time_ifunc (void) __asm__ ("time");
+
+void *
+time_ifunc (void)
+{
+ PREPARE_VERSION (linux26, "LINUX_2.6", 61765110);
+
+ /* If the vDSO is not available we fall back on the old vsyscall. */
+ return _dl_vdso_vsym ("time", &linux26) ?: (void *) VSYSCALL_ADDR_vtime;
+}
+__asm (".type time, %gnu_indirect_function");
+#else
+# include <time.h>
+
+time_t
+time (time_t *t)
+{
+ return ((time_t (*) (time_t *)) VSYSCALL_ADDR_vtime) (t);
+}
+#endif
+
+strong_alias (time, __GI_time)
commit 2bc174332ba6ddbd1b855dced33889bef56e8ba3
Author: Andreas Schwab <schwab@redhat.com>
Date: Tue Aug 30 15:37:54 2011 +0200
Relocate objects in dependency order
2011-08-30 Andreas Schwab <schwab@redhat.com>
* elf/rtld.c (dl_main): Relocate objects in dependency order.
diff --git a/elf/rtld.c b/elf/rtld.c
index 87bb5f0..4f6bbfd 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -2255,13 +2255,12 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
/* If we are profiling we also must do lazy reloaction. */
GLRO(dl_lazy) |= consider_profiling;
- struct link_map *l = main_map;
- while (l->l_next)
- l = l->l_next;
-
HP_TIMING_NOW (start);
- do
+ unsigned i = main_map->l_searchlist.r_nlist;
+ while (i-- > 0)
{
+ struct link_map *l = main_map->l_initfini[i];
+
/* While we are at it, help the memory handling a bit. We have to
mark some data structures as allocated with the fake malloc()
implementation in ld.so. */
@@ -2280,10 +2279,7 @@ ERROR: ld.so: object '%s' cannot be loaded as audit interface: %s; ignored.\n",
/* Add object to slot information data if necessasy. */
if (l->l_tls_blocksize != 0 && tls_init_tp_called)
_dl_add_to_slotinfo (l);
-
- l = l->l_prev;
}
- while (l);
HP_TIMING_NOW (stop);
HP_TIMING_DIFF (relocate_time, start, stop);
commit ef60624956e93df1da329a48570776ed963b1916
Author: Ulrich Drepper <drepper@gmail.com>
Date: Tue Sep 6 00:12:18 2011 -0400
Prefer real syscalls instead of vsyscalls on x86-64 outside libc.so
2011-09-06 Ulrich Drepper <drepper@gmail.com>
* sysdeps/unix/sysv/linux/kernel-features.h: Add entry for getcpu
syscall on x86-64.
* sysdeps/unix/sysv/linux/x86_64/gettimeofday.c [!SHARED]: Use real
syscall.
* sysdeps/unix/sysv/linux/x86_64/time.c: Likewise.
* sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S [!SHARED]: Use real
syscall if possible.
diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h
index d91f581..58f833e 100644
--- a/sysdeps/unix/sysv/linux/kernel-features.h
+++ b/sysdeps/unix/sysv/linux/kernel-features.h
@@ -546,3 +546,8 @@
#if __LINUX_KERNEL_VERSION >= 0x020627
# define __ASSUME_SENDMMSG 1
#endif
+
+/* getcpu is a syscall for x86-64 since 3.1. */
+#if defined __x86_64__ && __LINUX_KERNEL_VERSION >= 0x030100
+# define __ASSUME_GETCPU_SYSCALL 1
+#endif
diff --git a/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c b/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c
index 1a773d6..56171bc 100644
--- a/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c
+++ b/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c
@@ -37,11 +37,12 @@ gettimeofday_ifunc (void)
__asm (".type __gettimeofday, %gnu_indirect_function");
#else
# include <sys/time.h>
+# include <sysdep.h>
int
__gettimeofday (struct timeval *tv, struct timezone *tz)
{
- return ((int (*) (struct timeval *, struct timezone *)) VSYSCALL_ADDR_vgettimeofday) (tv, tz);
+ return INLINE_SYSCALL (gettimeofday, 2, tv, tz);
}
#endif
diff --git a/sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S b/sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S
index 8ec7d3f..246c955 100644
--- a/sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S
+++ b/sysdeps/unix/sysv/linux/x86_64/sched_getcpu.S
@@ -20,6 +20,7 @@
#include <tls.h>
#define _ERRNO_H 1
#include <bits/errno.h>
+#include <kernel-features.h>
/* For the calculation see asm/vsyscall.h. */
#define VSYSCALL_ADDR_vgetcpu 0xffffffffff600800
@@ -38,10 +39,26 @@ ENTRY (sched_getcpu)
#ifdef SHARED
movq __vdso_getcpu(%rip), %rax
PTR_DEMANGLE (%rax)
+ callq *%rax
#else
+# ifdef __NR_getcpu
+ movl $__NR_getcpu, %eax
+ syscall
+# ifndef __ASSUME_GETCPU_SYSCALL
+ cmpq $-ENOSYS, %rax
+ jne 1f
+# endif
+# endif
+# ifndef __ASSUME_GETCPU_SYSCALL
movq $VSYSCALL_ADDR_vgetcpu, %rax
-#endif
callq *%rax
+1:
+# else
+# ifndef __NR_getcpu
+# error "cannot happen"
+# endif
+# endif
+#endif
cmpq $-4095, %rax
jae SYSCALL_ERROR_LABEL
diff --git a/sysdeps/unix/sysv/linux/x86_64/time.c b/sysdeps/unix/sysv/linux/x86_64/time.c
index 698d561..c1c1a75 100644
--- a/sysdeps/unix/sysv/linux/x86_64/time.c
+++ b/sysdeps/unix/sysv/linux/x86_64/time.c
@@ -36,11 +36,13 @@ time_ifunc (void)
__asm (".type time, %gnu_indirect_function");
#else
# include <time.h>
+# include <sysdep.h>
time_t
time (time_t *t)
{
- return ((time_t (*) (time_t *)) VSYSCALL_ADDR_vtime) (t);
+ INTERNAL_SYSCALL_DECL (err);
+ return INTERNAL_SYSCALL (time, err, 1, t);
}
#endif
2011-09-06 Andreas Jaeger <aj@suse.de>
* sysdeps/unix/sysv/linux/x86_64/gettimeofday.c: Include <errno.h>
to fix build.
Index: glibc-2.14/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c
===================================================================
--- glibc-2.14.orig/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c
+++ glibc-2.14/sysdeps/unix/sysv/linux/x86_64/gettimeofday.c
@@ -36,6 +36,7 @@ gettimeofday_ifunc (void)
}
__asm (".type __gettimeofday, %gnu_indirect_function");
#else
+# include <errno.h>
# include <sys/time.h>
# include <sysdep.h>

View File

@ -1,37 +0,0 @@
This fixes ceil (x) for -1.0 < x < 0.
Index: sysdeps/x86_64/fpu/s_ceil.c
===================================================================
--- sysdeps/x86_64/fpu/s_ceil.c.orig
+++ sysdeps/x86_64/fpu/s_ceil.c
@@ -34,7 +34,11 @@ double __ceil(double x)
/* x is +zero or -zero; return the same zero */
return x;
else if (xneg) /* x < 0.0 */
- return 0.0;
+ {
+ /* Return zero with the sign of x */
+ PUT_BITS_DP64(SIGNBIT_DP64, x);
+ return x;
+ }
else
return 1.0;
}
Index: sysdeps/x86_64/fpu/s_ceilf.c
===================================================================
--- sysdeps/x86_64/fpu/s_ceilf.c.orig
+++ sysdeps/x86_64/fpu/s_ceilf.c
@@ -34,7 +34,11 @@ float __ceilf(float x)
/* x is +zero or -zero; return the same zero */
return x;
else if (xneg) /* x < 0.0 */
- return 0.0F;
+ {
+ /* Return zero with the sign of x */
+ PUT_BITS_SP32(SIGNBIT_SP32, x);
+ return x;
+ }
else
return 1.0F;
}

View File

@ -4,9 +4,11 @@
Index: nscd/nscd.h
===================================================================
--- nscd/nscd.h.orig
diff --git a/nscd/nscd.h b/nscd/nscd.h
index fdaf01b..23b6a94 100644
--- nscd/nscd.h
+++ nscd/nscd.h
@@ -105,10 +105,10 @@ struct database_dyn
@@ -113,11 +113,11 @@ struct database_dyn
/* Paths of the file for the persistent storage. */
@ -14,10 +16,12 @@ Index: nscd/nscd.h
-#define _PATH_NSCD_GROUP_DB "/var/db/nscd/group"
-#define _PATH_NSCD_HOSTS_DB "/var/db/nscd/hosts"
-#define _PATH_NSCD_SERVICES_DB "/var/db/nscd/services"
-#define _PATH_NSCD_NETGROUP_DB "/var/db/nscd/netgroup"
+#define _PATH_NSCD_PASSWD_DB "/var/run/nscd/passwd"
+#define _PATH_NSCD_GROUP_DB "/var/run/nscd/group"
+#define _PATH_NSCD_HOSTS_DB "/var/run/nscd/hosts"
+#define _PATH_NSCD_SERVICES_DB "/var/run/nscd/services"
+#define _PATH_NSCD_NETGROUP_DB "/var/run/nscd/netgroup"
/* Path used when not using persistent storage. */
#define _PATH_NSCD_XYZ_DB_TMP "/var/run/nscd/dbXXXXXX"

View File

@ -1,122 +0,0 @@
Send to libc-alpha on 2011-07-01, will be part of glibc 2.15.
commit id: 445b4a53ea9d6c457c5f4ac1538102d8be0a5d89
2011-07-01 Thorsten Kukuk <kukuk@suse.de>
* nscd/pwdcache.c (cache_addpw): Handle zero negtimeout.
* nscd/initgrcache.c (addinitgroupsX): Likewise.
* nscd/hstcache.c (cache_addhst): Likewise.
* nscd/grpcache.c (cache_addgr): Likewise.
* nscd/aicache.c (addhstaiX): Likewise.
Index: nscd/aicache.c
===================================================================
--- nscd/aicache.c.orig
+++ nscd/aicache.c
@@ -504,9 +504,15 @@ next_nip:
if (fd != -1)
TEMP_FAILURE_RETRY (send (fd, &notfound, total, MSG_NOSIGNAL));
- dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len, 1);
/* If we cannot permanently store the result, so be it. */
- if (dataset != NULL)
+ if (db->negtimeout == 0)
+ {
+ /* Mark the old entry as obsolete. */
+ if (dh != NULL)
+ dh->usable = false;
+ dataset = NULL;
+ }
+ else if ((dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len, 1)) != NULL)
{
dataset->head.allocsize = sizeof (struct dataset) + req->key_len;
dataset->head.recsize = total;
Index: nscd/grpcache.c
===================================================================
--- nscd/grpcache.c.orig
+++ nscd/grpcache.c
@@ -113,10 +113,14 @@ cache_addgr (struct database_dyn *db, in
written = TEMP_FAILURE_RETRY (send (fd, &notfound, total,
MSG_NOSIGNAL));
- dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len,
- 1);
/* If we cannot permanently store the result, so be it. */
- if (dataset != NULL)
+ if (db->negtimeout == 0)
+ {
+ /* Mark the old entry as obsolete. */
+ if (dh != NULL)
+ dh->usable = false;
+ }
+ else if ((dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len, 1)) != NULL)
{
dataset->head.allocsize = sizeof (struct dataset) + req->key_len;
dataset->head.recsize = total;
Index: nscd/hstcache.c
===================================================================
--- nscd/hstcache.c.orig
+++ nscd/hstcache.c
@@ -119,10 +119,14 @@ cache_addhst (struct database_dyn *db, i
MSG_NOSIGNAL)) != total)
all_written = false;
- dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len,
- 1);
/* If we cannot permanently store the result, so be it. */
- if (dataset != NULL)
+ if (db->negtimeout == 0)
+ {
+ /* Mark the old entry as obsolete. */
+ if (dh != NULL)
+ dh->usable = false;
+ }
+ else if ((dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len, 1)) != NULL)
{
dataset->head.allocsize = sizeof (struct dataset) + req->key_len;
dataset->head.recsize = total;
Index: nscd/initgrcache.c
===================================================================
--- nscd/initgrcache.c.orig
+++ nscd/initgrcache.c
@@ -197,10 +197,14 @@ addinitgroupsX (struct database_dyn *db,
written = TEMP_FAILURE_RETRY (send (fd, &notfound, total,
MSG_NOSIGNAL));
- dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len,
- 1);
/* If we cannot permanently store the result, so be it. */
- if (dataset != NULL)
+ if (db->negtimeout == 0)
+ {
+ /* Mark the old entry as obsolete. */
+ if (dh != NULL)
+ dh->usable = false;
+ }
+ else if ((dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len, 1)) != NULL)
{
dataset->head.allocsize = sizeof (struct dataset) + req->key_len;
dataset->head.recsize = total;
Index: nscd/pwdcache.c
===================================================================
--- nscd/pwdcache.c.orig
+++ nscd/pwdcache.c
@@ -120,10 +120,14 @@ cache_addpw (struct database_dyn *db, in
written = TEMP_FAILURE_RETRY (send (fd, &notfound, total,
MSG_NOSIGNAL));
- dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len,
- 1);
/* If we cannot permanently store the result, so be it. */
- if (dataset != NULL)
+ if (db->negtimeout == 0)
+ {
+ /* Mark the old entry as obsolete. */
+ if (dh != NULL)
+ dh->usable = false;
+ }
+ else if ((dataset = mempool_alloc (db, sizeof (struct dataset) + req->key_len, 1)) != NULL)
{
dataset->head.allocsize = sizeof (struct dataset) + req->key_len;
dataset->head.recsize = total;

View File

@ -1,95 +1,3 @@
Index: nscd/cache.c
===================================================================
--- nscd/cache.c.orig 2010-01-18 18:01:41.000000000 +0100
+++ nscd/cache.c 2010-02-14 14:58:08.000000000 +0100
@@ -267,27 +267,29 @@
if (table->inotify_descr < 0 && table->check_file && now != LONG_MAX)
{
struct stat64 st;
+ time_t mtime;
- if (stat64 (table->filename, &st) < 0)
+ mtime = stat64 (table->filename, &st) ? LONG_MAX : st.st_mtime;
+ if (mtime != table->file_mtime)
{
- char buf[128];
- /* We cannot stat() the file, disable file checking if the
- file does not exist. */
- dbg_log (_("cannot stat() file `%s': %s"),
- table->filename, strerror_r (errno, buf, sizeof (buf)));
- if (errno == ENOENT)
- table->check_file = 0;
+ /* The file changed. Invalidate all entries. */
+ now = LONG_MAX;
+ table->file_mtime = mtime;
}
- else
+ if (*table->filename2)
{
- if (st.st_mtime != table->file_mtime)
+ mtime = stat64 (table->filename2, &st) ? LONG_MAX : st.st_mtime;
+ if (mtime != table->file_mtime2)
{
/* The file changed. Invalidate all entries. */
now = LONG_MAX;
- table->file_mtime = st.st_mtime;
+ table->file_mtime2 = mtime;
}
}
}
+ /* now == 0 means just check for changed files */
+ if (now == (time_t)0)
+ return 0;
/* We run through the table and find values which are not valid anymore.
Index: nscd/connections.c
===================================================================
--- nscd/connections.c.orig 2010-01-18 18:01:41.000000000 +0100
+++ nscd/connections.c 2010-02-14 14:58:08.000000000 +0100
@@ -119,6 +119,7 @@ struct database_dyn dbs[lastdb] =
.suggested_module = DEFAULT_SUGGESTED_MODULE,
.reset_res = 0,
.filename = "/etc/passwd",
+ .filename2 = "",
.db_filename = _PATH_NSCD_PASSWD_DB,
.disabled_iov = &pwd_iov_disabled,
.postimeout = 3600,
@@ -140,6 +141,7 @@ struct database_dyn dbs[lastdb] =
.suggested_module = DEFAULT_SUGGESTED_MODULE,
.reset_res = 0,
.filename = "/etc/group",
+ .filename2 = "",
.db_filename = _PATH_NSCD_GROUP_DB,
.disabled_iov = &grp_iov_disabled,
.postimeout = 3600,
@@ -161,6 +163,7 @@ struct database_dyn dbs[lastdb] =
.suggested_module = DEFAULT_SUGGESTED_MODULE,
.reset_res = 1,
.filename = "/etc/hosts",
+ .filename2 = "/etc/resolv.conf",
.db_filename = _PATH_NSCD_HOSTS_DB,
.disabled_iov = &hst_iov_disabled,
.postimeout = 3600,
@@ -855,15 +858,9 @@ cannot set socket to close on exec: %s;
/* We need the modification date of the file. */
struct stat64 st;
- if (stat64 (dbs[cnt].filename, &st) < 0)
- {
- /* We cannot stat() the file, disable file checking. */
- dbg_log (_("cannot stat() file `%s': %s"),
- dbs[cnt].filename, strerror (errno));
- dbs[cnt].check_file = 0;
- }
- else
- dbs[cnt].file_mtime = st.st_mtime;
+ dbs[cnt].file_mtime = stat64 (dbs[cnt].filename, &st) ? LONG_MAX : st.st_mtime;
+ if (*dbs[cnt].filename2)
+ dbs[cnt].file_mtime2 = stat64 (dbs[cnt].filename2, &st) ? LONG_MAX : st.st_mtime;
}
}
Index: nscd/nscd.conf
===================================================================
--- nscd/nscd.conf.orig 2010-01-18 18:01:41.000000000 +0100
@ -109,21 +17,6 @@ Index: nscd/nscd.conf
shared hosts yes
max-db-size hosts 33554432
Index: nscd/nscd.h
===================================================================
--- nscd/nscd.h.orig 2010-01-18 18:01:41.000000000 +0100
+++ nscd/nscd.h 2010-02-14 14:59:07.000000000 +0100
@@ -80,8 +80,10 @@ struct database_dyn
int propagate;
int reset_res;
const char filename[16];
+ const char filename2[17];
const char *db_filename;
time_t file_mtime;
+ time_t file_mtime2;
size_t suggested_module;
size_t max_db_size;
Index: nscd/nscd_stat.c
===================================================================
--- nscd/nscd_stat.c.orig 2010-01-18 18:01:41.000000000 +0100
@ -143,12 +36,3 @@ Index: nscd/nscd_stat.c
/* Statistic data for one database. */
struct dbstat
@@ -302,7 +307,7 @@ receive_print_stats (void)
data.dbs[i].maxnsearched,
data.dbs[i].rdlockdelayed,
data.dbs[i].wrlockdelayed,
- data.dbs[i].addfailed, check_file, dbnames[i]);
+ data.dbs[i].addfailed, check_file, (strcmp(dbnames[i], "hosts") ? dbnames[i] : "{hosts,resolv.conf}"));
}
if (selinux_enabled)

View File

@ -1,23 +0,0 @@
--- ports/sysdeps/unix/sysv/linux/arm/clone.S
+++ ports/sysdeps/unix/sysv/linux/arm/clone.S
@@ -81,8 +81,11 @@
RETINSTR(, lr)
cfi_startproc
- cfi_undefined (lr)
+PSEUDO_END (__clone)
+
1:
+ .fnstart
+ .cantunwind
#ifdef RESET_PID
tst ip, #CLONE_THREAD
bne 3f
@@ -116,6 +119,6 @@
@ and we are done, passing the return value through r0
b PLTJMP(HIDDEN_JUMPTARGET(_exit))
-PSEUDO_END (__clone)
+ .fnend
weak_alias (__clone, clone)

View File

@ -21,9 +21,9 @@ Index: config.make.in
# Build tools.
Index: configure.in
===================================================================
--- configure.in.orig 2011-05-20 15:39:31.237690293 +0200
+++ configure.in 2011-05-20 15:43:55.595111363 +0200
@@ -16,6 +16,7 @@
--- configure.in.orig
+++ configure.in
@@ -16,6 +16,7 @@ if test $host != $build; then
AC_CHECK_PROGS(BUILD_CC, gcc cc)
fi
AC_SUBST(cross_compiling)
@ -33,9 +33,9 @@ Index: configure.in
AC_PROG_CXX
Index: configure
===================================================================
--- configure.orig 2011-05-20 15:46:40.675628746 +0200
+++ configure 2011-05-20 15:40:52.292884126 +0200
@@ -545,6 +545,7 @@
--- configure.orig
+++ configure
@@ -554,6 +554,7 @@ ac_clean_files=
ac_config_libobj_dir=.
LIBOBJS=
cross_compiling=no
@ -43,7 +43,7 @@ Index: configure
subdirs=
MFLAGS=
MAKEFLAGS=
@@ -697,6 +696,7 @@
@@ -706,6 +707,7 @@ CXXFLAGS
CXX
CPP
cross_compiling
@ -51,7 +51,7 @@ Index: configure
BUILD_CC
OBJEXT
ac_ct_CC
@@ -1244,6 +1242,13 @@
@@ -1250,6 +1252,13 @@ do
as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
done
@ -65,7 +65,7 @@ Index: configure
# There might be people who depend on the old broken behavior: `$host'
# used to hold the argument of --host etc.
# FIXME: To remove some day.
@@ -1266,6 +1257,7 @@
@@ -1265,6 +1274,7 @@ if test "x$host_alias" != x; then
If a cross compiler is detected then cross compile mode will be used" >&2
elif test "x$build_alias" != "x$host_alias"; then
cross_compiling=yes
@ -73,9 +73,9 @@ Index: configure
fi
fi
@@ -1454,6 +1444,9 @@
--enable-experimental-malloc
enable experimental malloc features
@@ -1450,6 +1460,9 @@ Optional Features:
--enable-multi-arch enable single DSO with optimizations for multiple
architectures
--enable-nss-crypt enable libcrypt to use nss
+ --enable-runbinaries the compiled binaries should run on the buildhost because
+ it happens to have a compatible cpu
@ -87,7 +87,7 @@ Index: posix/Makefile
===================================================================
--- posix/Makefile.orig
+++ posix/Makefile
@@ -302,7 +302,7 @@ $(inst_libexecdir)/getconf: $(inst_bindi
@@ -320,7 +320,7 @@ $(inst_libexecdir)/getconf: $(inst_bindi
done < $(objpfx)getconf.speclist
$(objpfx)getconf.speclist: $(objpfx)getconf
@ -100,7 +100,7 @@ Index: sunrpc/Makefile
===================================================================
--- sunrpc/Makefile.orig
+++ sunrpc/Makefile
@@ -98,7 +98,7 @@ otherlibs += $(nssobjdir)/libnss_files.a
@@ -108,7 +108,7 @@ otherlibs += $(nssobjdir)/libnss_files.a
$(resolvobjdir)/libresolv.a
endif

View File

@ -1,35 +0,0 @@
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
index f5d055c..8f3c68c 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S
@@ -210,7 +210,7 @@ pthread_rwlock_timedrdlock:
cfi_restore(%r12)
retq
-#ifdef __ASSUME_PRIVATE_FUTEX
+#ifdef __ASSUME_FUTEX_CLOCK_REALTIME
cfi_adjust_cfa_offset(16)
cfi_rel_offset(%r12, 8)
cfi_rel_offset(%r13, 0)
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
index 6ed8b49..9aaaeba 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S
@@ -192,7 +192,7 @@ pthread_rwlock_timedwrlock:
7: movq %rdx, %rax
-#ifndef __ASSUME_PRIVATE_FUTEX
+#ifndef __ASSUME_FUTEX_CLOCK_REALTIME
addq $16, %rsp
cfi_adjust_cfa_offset(-16)
popq %r14
@@ -207,7 +207,7 @@ pthread_rwlock_timedwrlock:
cfi_restore(%r12)
retq
-#ifdef __ASSUME_PRIVATE_FUTEX
+#ifdef __ASSUME_FUTEX_CLOCK_REALTIME
cfi_adjust_cfa_offset(16)
cfi_rel_offset(%r12, 8)
cfi_rel_offset(%r13, 0)

View File

@ -1,27 +0,0 @@
2011-06-21 Andreas Jaeger <aj@suse.de>
* sysdeps/s390/s390-64/Makefile ($(inst_gconvdir)/gconv-modules):
Copy rule from iconvdata/Makefile.
Index: glibc/sysdeps/s390/s390-64/Makefile
===================================================================
--- sysdeps/s390/s390-64/Makefile 2009-08-03 10:18:31.000000000 +0200
+++ sysdeps/s390/s390-64/Makefile 2010-04-07 10:01:35.000000000 +0200
@@ -74,5 +74,17 @@ $(objpfx)gconv-modules-s390: gconv-modul
$(inst_gconvdir)/gconv-modules: $(objpfx)gconv-modules-s390 $(+force)
$(do-install)
+ifeq (no,$(cross-compiling))
+# Update the $(prefix)/lib/gconv/gconv-modules.cache file. This is necessary
+# if this libc has more gconv modules than the previously installed one.
+ if test -f "$(inst_gconvdir)/gconv-modules.cache"; then \
+ LC_ALL=C LANGUAGE=C \
+ $(common-objpfx)elf/ld.so --library-path $(rpath-link) \
+ $(common-objpfx)iconv/iconvconfig \
+ $(addprefix --prefix=,$(install_root)); \
+ fi
+else
+ @echo '*@*@*@ You should recreate $(inst_gconvdir)/gconv-modules.cache'
+endif
endif

View File

@ -1,236 +0,0 @@
Allow M_ARENA_MAX / MALLOC_ARENA_MAX limit even with PER_THREAD disabled
With the new PER_THREAD compile-time option, the allocator also offers
a way to limit the total number of arenas using MALLOC_ARENA_MAX
environment variable or mallopt(M_ARENA_MAX).
In principle, this feature is not tied to the PER_THREAD option. This
patch makes it possible to use it even with the default compilation
settings.
One motivation to limit the number of arenas may be libhugetlbfs users
that rely on its __morecore hook providing hugetlbfs-backed memory for
the allocator - this can work only with a single arena and multi-threaded
programs wishing to use this feature need a way to limit the allocator
to a single arena. Another motivation is avoiding pathological behavior
in extremely thread-intensive applications.
2011-02-04 Petr Baudis <pasky@suse.cz>
* malloc/arena.c: Define and manage narenas even ifndef
PER_THREAD.
* malloc/arena.c (ptmalloc_init_minimal): Likewise.
* malloc/arena.c (_int_new_arena): Likewise.
* malloc/arena.c (ptmalloc_init): Implement MALLOC_ARENA_MAX
even ifndef PER_THREAD.
* malloc/arena.c (reused_arena): Split off get_narenas_limit(),
define even ifndef PER_THREAD.
* malloc/arena.c (arena_get2): Adjust for get_narenas_limit()
split, call reused_arena even ifndef PER_THREAD.
* malloc/hooks.c (public_gET_STATe): Set arena_max, narenas
even ifndef PER_THREAD.
* malloc/hooks.c (public_sET_STATe): Likewise.
* malloc/malloc.c (malloc_par): Define arena_max even ifndef
PER_THREAD.
* malloc/malloc.c (mALLOPt): Implement M_ARENA_MAX even ifndef
PER_THREAD.
* malloc/malloc.c: Remove redundant M_* defines.
Index: glibc-2.13/malloc/arena.c
===================================================================
--- glibc-2.13.orig/malloc/arena.c
+++ glibc-2.13/malloc/arena.c
@@ -78,8 +78,8 @@ extern int sanity_check_heap_info_alignm
static tsd_key_t arena_key;
static mutex_t list_lock;
-#ifdef PER_THREAD
static size_t narenas;
+#ifdef PER_THREAD
static mstate free_list;
#endif
@@ -416,8 +416,8 @@ ptmalloc_init_minimal (void)
#ifdef PER_THREAD
# define NARENAS_FROM_NCORES(n) ((n) * (sizeof(long) == 4 ? 2 : 8))
mp_.arena_test = NARENAS_FROM_NCORES (1);
- narenas = 1;
#endif
+ narenas = 1;
}
@@ -574,10 +574,8 @@ ptmalloc_init (void)
{
if (memcmp (envline, "MMAP_MAX_", 9) == 0)
mALLOPt(M_MMAP_MAX, atoi(&envline[10]));
-#ifdef PER_THREAD
else if (memcmp (envline, "ARENA_MAX", 9) == 0)
mALLOPt(M_ARENA_MAX, atoi(&envline[10]));
-#endif
}
break;
#ifdef PER_THREAD
@@ -946,9 +944,9 @@ _int_new_arena(size_t size)
atomic_write_barrier ();
main_arena.next = a;
-#ifdef PER_THREAD
++narenas;
+#ifdef PER_THREAD
(void)mutex_unlock(&list_lock);
#endif
@@ -982,13 +980,10 @@ get_free_list (void)
return result;
}
-
-static mstate
-reused_arena (void)
+static int get_narenas_limit (void) __attribute__((pure));
+static int
+get_narenas_limit (void)
{
- if (narenas <= mp_.arena_test)
- return NULL;
-
static int narenas_limit;
if (narenas_limit == 0)
{
@@ -1006,10 +1001,16 @@ reused_arena (void)
narenas_limit = NARENAS_FROM_NCORES (2);
}
}
+ return narenas_limit;
+}
+#endif
- if (narenas < narenas_limit)
- return NULL;
+/* Reuse and return one of the existing arenas; if all arenas are busy,
+ * pick one in a round-robin fashion and block until it becomes available. */
+static mstate
+reused_arena (void)
+{
mstate result;
static mstate next_to_use;
if (next_to_use == NULL)
@@ -1035,7 +1036,6 @@ reused_arena (void)
return result;
}
-#endif
static mstate
internal_function
@@ -1048,10 +1048,15 @@ arena_get2(a_tsd, size) mstate a_tsd; si
mstate a;
#ifdef PER_THREAD
- if ((a = get_free_list ()) == NULL
- && (a = reused_arena ()) == NULL)
- /* Nothing immediately available, so generate a new arena. */
- a = _int_new_arena(size);
+ if ((a = get_free_list ()) == NULL)
+ {
+ if (narenas > mp_.arena_test && narenas >= get_narenas_limit())
+ a = reused_arena ();
+ else
+ /* Nothing immediately available, but we can still generate more
+ * arenas, so get a new one. */
+ a = _int_new_arena(size);
+ }
#else
if(!a_tsd)
a = a_tsd = &main_arena;
@@ -1093,8 +1098,14 @@ arena_get2(a_tsd, size) mstate a_tsd; si
goto repeat;
}
- /* Nothing immediately available, so generate a new arena. */
- a = _int_new_arena(size);
+ if (__builtin_expect(mp_.arena_max > 0, 0) && narenas >= mp_.arena_max)
+ /* Try again, this time blocking in case we are still unable to find
+ * a free arena. */
+ a = reused_arena();
+ else
+ /* Nothing immediately available, so generate a new arena. */
+ a = _int_new_arena(size);
+
(void)mutex_unlock(&list_lock);
#endif
Index: glibc-2.13/malloc/hooks.c
===================================================================
--- glibc-2.13.orig/malloc/hooks.c
+++ glibc-2.13/malloc/hooks.c
@@ -579,9 +579,9 @@ public_gET_STATe(void)
ms->max_fast = get_max_fast();
#ifdef PER_THREAD
ms->arena_test = mp_.arena_test;
+#endif
ms->arena_max = mp_.arena_max;
ms->narenas = narenas;
-#endif
(void)mutex_unlock(&main_arena.mutex);
return (Void_t*)ms;
}
@@ -683,9 +683,9 @@ public_sET_STATe(Void_t* msptr)
if (ms->version >= 4) {
#ifdef PER_THREAD
mp_.arena_test = ms->arena_test;
+#endif
mp_.arena_max = ms->arena_max;
narenas = ms->narenas;
-#endif
}
check_malloc_state(&main_arena);
Index: glibc-2.13/malloc/malloc.c
===================================================================
--- glibc-2.13.orig/malloc/malloc.c
+++ glibc-2.13/malloc/malloc.c
@@ -2405,9 +2405,10 @@ struct malloc_par {
INTERNAL_SIZE_T top_pad;
INTERNAL_SIZE_T mmap_threshold;
#ifdef PER_THREAD
+ /* Lower bound for arena_max. */
INTERNAL_SIZE_T arena_test;
- INTERNAL_SIZE_T arena_max;
#endif
+ INTERNAL_SIZE_T arena_max;
/* Memory map support */
int n_mmaps;
@@ -2445,13 +2446,6 @@ static struct malloc_state main_arena;
static struct malloc_par mp_;
-#ifdef PER_THREAD
-/* Non public mallopt parameters. */
-#define M_ARENA_TEST -7
-#define M_ARENA_MAX -8
-#endif
-
-
/* Maximum size of memory handled in fastbins. */
static INTERNAL_SIZE_T global_max_fast;
@@ -6111,12 +6105,12 @@ int mALLOPt(param_number, value) int par
if (value > 0)
mp_.arena_test = value;
break;
+#endif
case M_ARENA_MAX:
if (value > 0)
mp_.arena_max = value;
break;
-#endif
}
(void)mutex_unlock(&av->mutex);
return res;

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1c830afb6d4aa166edaa09ec539580377ecbb16ba655d0aad6f5cb5a9a269aa9
size 630641

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:7b7f32252c98467893d3352a57955943e6fd0e7ea606ef4765fe4985df9d7d08
size 549483

View File

@ -1,95 +0,0 @@
commit 0507f293c9b67d8eec92e8178308d72f1ed88449
Author: Andreas Schwab <schwab@redhat.com>
Date: Wed Oct 5 11:51:41 2011 +0200
arm: don't call ifunc functions in trace mode
--- a/sysdeps/arm/dl-machine.h
+++ b/sysdeps/arm/dl-machine.h
@@ -335,7 +335,7 @@ auto inline void
__attribute__ ((always_inline))
elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
const Elf32_Sym *sym, const struct r_found_version *version,
- void *const reloc_addr_arg)
+ void *const reloc_addr_arg, int skip_ifunc)
{
Elf32_Addr *const reloc_addr = reloc_addr_arg;
const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
@@ -369,9 +369,9 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
Elf32_Addr value = sym_map == NULL ? 0 : sym_map->l_addr + sym->st_value;
if (sym != NULL
- && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC,
- 0)
- && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1))
+ && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0)
+ && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1)
+ && __builtin_expect (!skip_ifunc, 1))
value = ((Elf32_Addr (*) (void)) value) ();
switch (r_type)
@@ -430,7 +430,7 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
}
case R_ARM_TLS_DESC:
{
- struct tlsdesc volatile *td =
+ struct tlsdesc volatile *td =
(struct tlsdesc volatile *)reloc_addr;
# ifndef RTLD_BOOTSTRAP
@@ -454,10 +454,10 @@ elf_machine_rel (struct link_map *map, const Elf32_Rel *reloc,
else
# endif
# endif
- {
+ {
td->argument.value = value + sym_map->l_tls_offset;
td->entry = _dl_tlsdesc_return;
- }
+ }
}
}
break;
@@ -525,7 +525,7 @@ auto inline void
__attribute__ ((always_inline))
elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
const Elf32_Sym *sym, const struct r_found_version *version,
- void *const reloc_addr_arg)
+ void *const reloc_addr_arg, int skip_ifunc)
{
Elf32_Addr *const reloc_addr = reloc_addr_arg;
const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
@@ -543,9 +543,9 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
Elf32_Addr value = sym_map == NULL ? 0 : sym_map->l_addr + sym->st_value;
if (sym != NULL
- && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC,
- 0)
- && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1))
+ && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC, 0)
+ && __builtin_expect (sym->st_shndx != SHN_UNDEF, 1)
+ && __builtin_expect (!skip_ifunc, 1))
value = ((Elf32_Addr (*) (void)) value) ();
switch (r_type)
@@ -656,7 +656,8 @@ elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc,
auto inline void
__attribute__ ((always_inline))
elf_machine_lazy_rel (struct link_map *map,
- Elf32_Addr l_addr, const Elf32_Rel *reloc)
+ Elf32_Addr l_addr, const Elf32_Rel *reloc,
+ int skip_ifunc)
{
Elf32_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset);
const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
@@ -674,8 +675,8 @@ elf_machine_lazy_rel (struct link_map *map,
(struct tlsdesc volatile *)reloc_addr;
/* The linker must have given us the parameter we need in the
- first GOT entry, and left the second one empty. We fill the
- last with the resolver address */
+ first GOT entry, and left the second one empty. We fill the
+ last with the resolver address */
assert (td->entry == 0);
td->entry = (void*)(D_PTR (map, l_info[ADDRIDX (DT_TLSDESC_PLT)])
+ map->l_addr);

View File

@ -10,78 +10,3 @@ Index: elf/Makefile
endif
before-compile = $(objpfx)trusted-dirs.h
Index: inet/Makefile
===================================================================
--- inet/Makefile.orig
+++ inet/Makefile
@@ -57,6 +57,8 @@ tests := htontest test_ifindex tst-ntoa
include ../Rules
+CFLAGS-tst-inet6_rth.c = -fno-strict-aliasing
+
ifeq ($(have-thread-library),yes)
CFLAGS-gethstbyad_r.c = -DUSE_NSCD=1 -fexceptions
Index: nis/Makefile
===================================================================
--- nis/Makefile.orig
+++ nis/Makefile
@@ -69,6 +69,8 @@ libnss_nisplus-inhibit-o = $(filter-out
include ../Rules
+CFLAGS-nis_findserv.c = -fno-strict-aliasing
+CFLAGS-ypclnt.c = -fno-strict-aliasing
$(objpfx)libnss_compat.so: $(objpfx)libnsl.so$(libnsl.so-version)
$(objpfx)libnss_nis.so: $(objpfx)libnsl.so$(libnsl.so-version) \
Index: nss/Makefile
===================================================================
--- nss/Makefile.orig
+++ nss/Makefile
@@ -75,6 +75,7 @@ endif
include ../Rules
+CFLAGS-files-hosts.c = -fno-strict-aliasing
ifeq (yes,$(build-static-nss))
$(objpfx)getent: $(objpfx)libnss_files.a
Index: resolv/Makefile
===================================================================
--- resolv/Makefile.orig
+++ resolv/Makefile
@@ -77,6 +77,7 @@ CPPFLAGS += -Dgethostbyname=res_gethostb
-Dgetnetbyaddr=res_getnetbyaddr
CFLAGS-res_hconf.c = -fexceptions
+CFLAGS-res_send.c = -fno-strict-aliasing
# The BIND code elicits some harmless warnings.
+cflags += -Wno-strict-prototypes -Wno-write-strings
Index: sunrpc/Makefile
===================================================================
--- sunrpc/Makefile.orig
+++ sunrpc/Makefile
@@ -152,6 +152,10 @@ CFLAGS-openchild.c = -fexceptions
CPPFLAGS += -D_RPC_THREAD_SAFE_
+CFLAGS-clnt_tcp.c = -fno-strict-aliasing
+CFLAGS-clnt_udp.c = -fno-strict-aliasing
+CFLAGS-clnt_unix.c = -fno-strict-aliasing
+
$(objpfx)tst-getmyaddr: $(common-objpfx)linkobj/libc.so
$(objpfx)tst-xdrmem: $(common-objpfx)linkobj/libc.so
$(objpfx)tst-xdrmem2: $(common-objpfx)linkobj/libc.so
Index: sysdeps/powerpc/powerpc64/elf/Makefile
===================================================================
--- sysdeps/powerpc/powerpc64/elf/Makefile.orig
+++ sysdeps/powerpc/powerpc64/elf/Makefile
@@ -9,3 +9,5 @@ CFLAGS-rtld-mempcpy.os = $(no-special-re
CFLAGS-rtld-memmove.os = $(no-special-regs)
CFLAGS-rtld-memchr.os = $(no-special-regs)
CFLAGS-rtld-strnlen.os = $(no-special-regs)
+
+CFLAGS-gmon-start.c = -fno-strict-aliasing

View File

@ -1,35 +0,0 @@
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=6e502e19455c6110dd4487d91b7b7d6d8121f9ba
commit 6e502e19455c6110dd4487d91b7b7d6d8121f9ba
Author: Ulrich Drepper <drepper@gmail.com>
Date: Wed Jun 22 08:32:55 2011 -0400
Clean up after kernel sigcontext header mess
2011-06-21 Andreas Jaeger <aj@suse.de>
* sysdeps/unix/sysv/linux/bits/sigcontext.h: Fix definition of
NULL after inclusion of kernel headers.
diff --git a/sysdeps/unix/sysv/linux/bits/sigcontext.h b/sysdeps/unix/sysv/linux/bits/sigcontext.h
index 67dcf94..0f5b607 100644
--- a/sysdeps/unix/sysv/linux/bits/sigcontext.h
+++ b/sysdeps/unix/sysv/linux/bits/sigcontext.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1998, 2011 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
@@ -26,4 +26,8 @@
# define sigcontext_struct sigcontext
# include <asm/sigcontext.h>
+
+/* The Linux kernel headers redefine NULL wrongly, so cleanup afterwards. */
+# define __need_NULL
+# include <stddef.h>
#endif

View File

@ -1,3 +1,47 @@
-------------------------------------------------------------------
Tue Jan 3 19:42:17 UTC 2012 - aj@suse.de
- Compile unwind-dw2-fde-glibc.c with -fno-strict-aliasing
(patch glibc-strict-aliasing.diff)
- Build on i686 a separate library for usage under Xen.
-------------------------------------------------------------------
Tue Jan 3 15:36:12 UTC 2012 - aj@suse.de
- Only use -mno-tls-direct-seg-refs on 32-bit x86, it's not needed
on x86-64.
-------------------------------------------------------------------
Tue Jan 3 14:37:48 UTC 2012 - aj@suse.de
- Cleanup spec file:
- experimental malloc is not experimental anymore and only option
(drop patch glibc-malloc-arena-max.diff)
- remove obsolete configure flags
-------------------------------------------------------------------
Tue Jan 3 08:40:28 UTC 2012 - aj@suse.de
- Update to 2ba92745c36e:
- Update copyright years
- Fix miscompilation of posix/regex_internal.c with GCC 4.7.
-------------------------------------------------------------------
Tue Jan 3 08:23:44 UTC 2012 - aj@suse.de
- Revert pthread-cond-wait change for now since it causes hangs
(patch pthread-cond-wait-revert.patch).
-------------------------------------------------------------------
Mon Dec 26 12:53:55 UTC 2011 - aj@suse.de
- Update to c0da14cdda1f (glibc-ports: 8a70b2dcabbf):
- new locales
- many bugfixes
- glibc 2.15
- obsoletes tzfile-corruption-fix.patch,
glibc-2.14-32args-printf.patch
-------------------------------------------------------------------
Thu Dec 21 15:16:42 CET 2011 - meissner@suse.de
@ -9,6 +53,16 @@ Mon Dec 19 10:01:56 UTC 2011 - aj@suse.de
- Fix timezone loader overflow (bnc#735850,CVE-2009-5029) (patch
tzfile-corruption-fix.patch)
-------------------------------------------------------------------
Mon Dec 5 09:29:32 UTC 2011 - aj@suse.de
- Update to 52ad36a21973 (glibc-ports: 4a40b38f6355):
* fix many warnings
* bugfixes
* obsolete patches glibc-strict-aliasing.diff and
glibc-arm-clone-unwind-fix.diff
-------------------------------------------------------------------
Tue Nov 29 03:09:56 UTC 2011 - rcoe@wi.rr.com
@ -29,6 +83,21 @@ Thu Nov 17 10:27:31 UTC 2011 - aj@suse.de
- Remove duplicated locales from glibc-2.3.locales.diff.bz2
-------------------------------------------------------------------
Tue Nov 15 12:49:56 UTC 2011 - aj@suse.de
- nscd now monitors resolv.conf, so simplify glibc-2.4.90-nscd.diff
patch and re-enable it
- Adjust and re-enable glibc-2.3.3-nscd-db-path.diff
-------------------------------------------------------------------
Tue Nov 15 12:10:32 UTC 2011 - aj@suse.de
- Update to 09f93bd3d6b1:
- Clean up internal fopen uses to always use close-on-exec
- Optimized strcasecmp and strncasecmp for SSSE3 and SSE4.2 on x86-32
- bugfixes
-------------------------------------------------------------------
Mon Nov 14 12:02:06 CET 2011 - ro@suse.de
@ -57,6 +126,35 @@ Mon Nov 7 21:06:32 CET 2011 - dmueller@suse.de
* sysdeps/unix/sysv/linux/arm/eabi/internal_sendmmsg.S: New.
- Fix unwinding crash when using clone()
-------------------------------------------------------------------
Wed Nov 2 13:52:36 UTC 2011 - aj@suse.de
- Update to d35dce5213b3:
- caching of network information for getaddrinfo
- bugfixes
-------------------------------------------------------------------
Sat Oct 29 18:37:46 UTC 2011 - aj@suse.de
- Update to 21b64b153631:
- various bugfixes
-------------------------------------------------------------------
Thu Oct 27 08:44:14 UTC 2011 - aj@suse.de
- Update to 804791474dc1:
- more libm optimizations
- Remove AMD libm routines due to new upstream libm optimizations
and interfaces.
- Fix build on x86.
-------------------------------------------------------------------
Mon Oct 24 19:02:46 UTC 2011 - aj@suse.de
- Update to a201fbcf9cc3:
- More libm optimizations
- Optimize wcslen, strnlen
-------------------------------------------------------------------
Thu Oct 20 08:58:47 UTC 2011 - aj@suse.de
@ -68,6 +166,20 @@ Wed Oct 19 12:07:41 UTC 2011 - aj@suse.de
- Provide glibc-static from glibc-devel-static to make packaging
easier. glibc-static is the Fedora name.
-------------------------------------------------------------------
Tue Oct 18 07:42:40 UTC 2011 - aj@suse.de
- Update to glibc head 99ce7b04edf1:
- Optimize many libm functions
- Optimize access to isXYZ and toXYZ tables
- Optimized memcmp and wmemcmp for x86-64 and x86-32
- Add parameter annotation to modf
- Support optimized isXXX functions in C++ code
- Optimized memchr, memrchr, rawmemchr for x86-32
- Add nscd netgroupcache
- Disable libm-x86-64.diff.bz2 since it needs changes following the
libm optimzations.
-------------------------------------------------------------------
Mon Oct 17 07:47:54 UTC 2011 - aj@suse.de
@ -97,6 +209,18 @@ Fri Sep 30 17:14:04 CEST 2011 - dmueller@suse.de
- avoid build failure on %%arm
-------------------------------------------------------------------
Thu Sep 29 12:58:59 UTC 2011 - aj@suse.de
- Update to 68577918437e:
* Obsoleted patches: glibc-gconvcache-s390.diff,
glibc-2.3.5-nscd-zeronegtimeout.diff,
glibc-x86-bits-sigcontext.patch,
glibc-2.15-getsysstats-speedup.patch, glibc-2.13-warnings.fix,
glibc-2.13-localedef.patch,
glibc-fix-rwlock-stack-imbalance.patch, glibc-2.15-vsyscall.patch,
glibc-2.15-avoid-vsyscall.patch
-------------------------------------------------------------------
Thu Sep 29 07:40:25 UTC 2011 - adrian@suse.de

View File

@ -1,7 +1,7 @@
#
# spec file for package glibc
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -56,14 +56,6 @@ BuildRequires: libstdc++-devel
# 2.6.16 is the SLES 10 kernel, use this as oldest supported kernel
# since many SUSE build machines have it
%define enablekernel 2.6.16
%ifarch ppc ppc64
# On PowerPC we got a memory corruption during building, disabling
# exp_malloc fixed it. Disable it until we have found and fixed the
# root cause.
%define exp_malloc 0
%else
%define exp_malloc 1
%endif
# ngpt was used in 8.1 and SLES8
Obsoletes: ngpt < 2.2.2
Obsoletes: ngpt-devel < 2.2.2
@ -77,15 +69,16 @@ Obsoletes: glibc-64bit
%ifarch ppc
Obsoletes: glibc-32bit
%endif
Version: 2.14.1
Release: 0
%define git_id 4f2b767fef50
%define glibc_ports_ver %version
Version: 2.15
Release: 11
%define git_id 2ba92745c36e
%define glibc_ports_ver 2.15
%define ports_git_id 8a70b2dcabbf
Url: http://www.gnu.org/software/libc/libc.html
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source: glibc-%{version}-%{git_id}.tar.bz2
%define glibc_ports_dir glibc-ports-%{glibc_ports_ver}
Source2: http://ftp.gnu.org/gnu/glibc/glibc-ports-%{glibc_ports_ver}.tar.bz2
Source2: glibc-ports-%{glibc_ports_ver}-%{ports_git_id}.tar.bz2
Source3: noversion.tar.bz2
Source4: manpages.tar.bz2
Source8: nsswitch.conf
@ -130,23 +123,17 @@ Patch8: glibc-2.4.90-revert-only-euro.diff
# PATCH-MISSING-TAG -- See http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch12: glibc-2.3.2.no_archive.diff
# PATCH-MISSING-TAG -- See http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch13: libm-x86-64.diff.bz2
# PATCH-MISSING-TAG -- See http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch14: glibc-2.3.90-bindresvport.blacklist.diff
# PATCH-MISSING-TAG -- See http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch16: glibc-2.4.90-no_NO.diff
# PATCH-MISSING-TAG -- See http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch18: glibc-2.3.3-amd64-s_ceil.diff
# PATCH-MISSING-TAG -- See http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch20: glibc-2.4-china.diff
# PATCH-FIX-OPENSUSE Fix gb18030 code bnc#54080
Patch21: glibc-2.3.4-gb18030-big5hkscs.diff.bz2
# PATCH-FIX-OPENSUSE Handle
# PATCH-FIX-OPENSUSE Handle timestamp, adjust nscd.conf
Patch22: glibc-2.4.90-nscd.diff
# PATCH-MISSING-TAG -- See http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines
# PATCH-FIX-OPENSUSE Fix path for nscd databases
Patch23: glibc-2.3.3-nscd-db-path.diff
# PATCH-FIX-UPSTREAM - handle zero negative timeout, committed for glibc 2.15
Patch24: glibc-2.3.5-nscd-zeronegtimeout.diff
# PATCH-FIX-OPENSUSE prefer -lang rpm packages
Patch25: glibc-2.3.90-langpackdir.diff
# PATCH-FIX-OPENSUSE Fix hangs in UDP RPC calls bso#5379 bnc#257745 aj@suse.de
@ -161,8 +148,6 @@ Patch33: glibc-compiled-binaries.diff
Patch36: glibc-no-unwind-tables.diff
# PATCH-FEATURE-SLE increase cpusetsize to 4096, needs to be kept for compatibility kukuk@suse.de
Patch38: glibc-cpusetsize.diff
# PATCH-MISSING-TAG -- See http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch40: libm-x86-64-exceptions.diff
# PATCH-FIX-OPENSUSE - Allow compilation with -altivec aj@suse.de
Patch41: glibc-uio-cell.diff
# PATCH-MISSING-TAG -- See http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines
@ -172,25 +157,11 @@ Patch46: glibc-resolv-mdnshint.diff
# PATCH-MISSING-TAG -- See http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch47: glibc-nscd-hconf.diff
# PATCH-MISSING-TAG -- See http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch48: glibc-malloc-arena-max.diff
# PATCH-MISSING-TAG -- See http://en.opensuse.org/openSUSE:Packaging_Patches_guidelines
Patch49: glibc-fini-unwind.diff
# PATCH-FIX-UPSTREAM install gconv-modules aj@suse.de
Patch50: glibc-gconvcache-s390.diff
# PATCH-FIX-OPENSUSE bnc#657627
Patch52: glibc-elf-localscope.diff
# FIX-OPENSUSE compile some files with -fno-strict-aliasing
Patch58: glibc-strict-aliasing.diff
# PATCH-FIX-UPSTREAM fix x86 <bits/sigcontext.h> aj@suse.de
Patch60: glibc-x86-bits-sigcontext.patch
# PATCH-FEATURE-UPSTREAM Speedup getsysstats call aj@suse.de
Patch61: glibc-2.15-getsysstats-speedup.patch
# PATCH-FIX-UPSTREAM Fix gcc 4.6 warnings aj@suse.de
Patch62: glibc-2.13-warnings.fix
# PATCH-FIX-OPENSUSE Fix localedef locale-archive creation bso#10855 aj@suse.de
Patch63: glibc-2.13-localedef.patch
# PATCH-FIX-UPSTREAM Fix futex bug bso#12403 aj@suse.de
Patch64: glibc-fix-rwlock-stack-imbalance.patch
# PATCH-FIX-OPENSUSE disable rewriting ::1 to 127.0.0.1 for /etc/hosts bnc#684534, bnc#706719
Patch65: glibc-fix-double-loopback.diff
# PATCH-FEATURE-OPENSUSE Revert sunrpc removal aj@suse.de
@ -199,36 +170,26 @@ Patch66: glibc2.14-revert-sunrpc-removal.patch
Patch67: glibc-revert-fseek-on-fclose.diff
# PATCH-FIX-OPENSUSE Fix crash (access-after-free) in dl_lookup_x bnc#703140 matz@suse.de
Patch68: glibc-fix-lookup-crash.patch
# PATCH-FIX-UPSTREAM Add vdso support to support Linux 3.1, fix order of relocations aj@suse.de
Patch70: glibc-2.15-vsyscall.patch
# PATCH-FIX-OPENSUSE Do not trigger an abort when an i586 Intel CPU is running the i686 library, as valgrind does. bnc#681398 aj@suse.de
Patch71: x86-cpuid-level2.patch
# PATCH-FIX-UPSTREAM Avoid use of vsyscall aj@suse.de
Patch72: glibc-2.15-avoid-vsyscall.patch
# PATCH-FIX-UPSTREAM Fix assertion error in res_query.c (bso#13013)
Patch73: glibc-resolv-assert.diff
# PATCH-FIX-OPENSUSE Run ctors (bnc#717671) aj@suse.de
Patch74: glibc-2.14-fix-ctors.patch
# PATCH-FIX-UPSTREAM Fix trace and ifuncs aj@suse.de
Patch75: glibc-2.15-ifunc-trace.patch
# PATCH-FIX-UPSTREAM Fix trace and ifuncs (talk to aj@suse.de)
Patch76: glibc-ports-2.15-ifunc-trace.patch
# PATCH-FIX-OPENSUSE Fix missing declarations
Patch75: glibc-2.15-nss_db-declarations.patch
# PATCH-FEATURE-OPENSUSE -- add sha support to crypt_blowfish lnussel@suse.de
Patch80: crypt_blowfish-1.2-sha.diff
# PATCH-FEATURE-OPENSUSE -- use separate symbol version for Owl extensions - lnussel@suse.de
Patch81: crypt_blowfish-1.2-versioning.diff
# PATCH-FIX-OPENSUSE Avoid build failure on noexecstack marker on ARM dmueller@suse.de
Patch82: crypt_blowfish-1.2-hack_around_arm.diff
# PATCH-FIX-UPSTREAM fix unwinding when using clone()
Patch83: glibc-arm-clone-unwind-fix.diff
# PATCH-FIX-OPENSUSE avoid false positive warning that triggers brp postcheck fail
Patch84: nscd-avoid-gcc-warning.diff
# PATCH-FIX-OPENSUSE fix printf with > 32 args and printf specifiers bnc#733140, bso#13446
Patch85: glibc-2.14-32args-printf.patch
# PATCH-FIX-UPSTREAM fix tzfile heap overrun bnc#735850 - aj@suse.de
Patch86: tzfile-corruption-fix.patch
# PATCH-FIX-OPENSUSE fixed build-compare by omitting one more date - meissner@suse.de
Patch87: glibc-nodate.patch
# PATCH-FIX-OPENSUSE revert pthread-cond-wait change since it causes hangs
Patch88: pthread-cond-wait-revert.patch
%description
The GNU C Library provides the most important standard libraries used
@ -387,17 +348,7 @@ versions of your software.
%endif
%prep
%ifarch %arm
# add glibc-ports for arm
%setup -n glibc-%{version} -q -a 2 -a 3 -a 4
pushd %glibc_ports_dir
%patch76 -p1
%patch83 -p1
popd
%else
# any other leave out ports
%setup -n glibc-%{version} -q -a 3 -a 4
%endif
# Owl crypt_blowfish
tar -xzf %SOURCE50
pushd crypt_blowfish-%{crypt_bf_version}
@ -418,12 +369,8 @@ mv crypt_blowfish-%crypt_bf_version/*.[chS] crypt/
%patch7
%patch8
%patch12
%patch13 -E
# We have s_sincos.c in patch13, remove duplicate
rm sysdeps/x86_64/fpu/s_sincos.S
%patch14
%patch16
%patch18
%patch20
# XXX Did not patch for 2.14:
#%patch21
@ -432,7 +379,6 @@ rm sysdeps/x86_64/fpu/s_sincos.S
touch -r nscd/nscd_stat.c nscd/s-stamp
%patch22
%patch23
%patch24
touch -r nscd/s-stamp nscd/nscd_stat.c
rm nscd/s-stamp
%patch25
@ -442,37 +388,24 @@ rm nscd/s-stamp
%patch33
%patch36
%patch38
%patch40
%patch41 -p1
%patch45
%patch46 -p1
%patch47 -p1
%if !%{exp_malloc}
%patch48 -p1
%endif
%patch49
%patch50
%patch52
%patch58
%patch60 -p1
%patch61 -p1
%patch62 -p1
%patch63 -p1
%patch64 -p1
%patch65 -p1
%patch66 -p1
%patch67 -p1
%patch68 -p1
%patch70 -p1
%patch71 -p1
%patch72 -p1
%patch73 -p1
%patch74 -p1
%patch75 -p1
%patch84
%patch85
%patch86 -p1
%patch87 -p0
%patch88 -p1 -R
#
# Inconsistency detected by ld.so: dl-close.c: 719: _dl_close: Assertion `map->l_init_called' failed!
@ -552,7 +485,9 @@ PARALLEL="%{?_smp_mflags}"
%ifarch hppa
BuildFlags="$BuildFlags -mpa-risc-1-1 -fstrict-aliasing"
%endif
%ifarch %ix86 x86_64
%ifarch i386 i486 i586
# Add this to avoid performance penalty on Xen for 32-bit x86
# Note on i686 we build a special library
BuildFlags="$BuildFlags -mno-tls-direct-seg-refs"
%endif
# Add flags for all plattforms except AXP
@ -579,7 +514,7 @@ configure_and_build_glibc() {
cd "cc-$dirname"
%ifarch %arm
# remove asynchronous-unwind-tables during configure as it causes
# some checks to fail spuriously on %arm
# some checks to fail spuriously on arm
conf_cflags="${cflags/-fasynchronous-unwind-tables/}"
conf_cflags="${conf_cflags/-funwind-tables/}"
%else
@ -588,7 +523,7 @@ configure_and_build_glibc() {
CFLAGS="$conf_cflags" CC="$BuildCC" CXX="$BuildCCplus" ../configure \
--prefix=%{_prefix} \
--libexecdir=%{_libdir} --infodir=%{_infodir} \
--enable-add-ons=nptl$addons --without-cvs --enable-profile \
--enable-add-ons=nptl$addons --enable-profile \
"$@" \
%if %{enable_stackguard_randomization}
--enable-stackguard-randomization \
@ -600,10 +535,7 @@ configure_and_build_glibc() {
%ifarch mipsel
--without-fp \
%endif
%if %{exp_malloc}
--enable-experimental-malloc \
%endif
--with-tls --with-__thread --enable-kernel=%{enablekernel} \
--enable-kernel=%{enablekernel} \
--enable-bind-now
# Should we enable --enable-nss-crypt to build use freebl3 hash functions?
# explicitly set CFLAGS to use the full CFLAGS (not the reduced one for configure)
@ -616,6 +548,9 @@ configure_and_build_glibc() {
# Build base glibc
#
configure_and_build_glibc base "$BuildFlags" "$add_ons"
%ifarch i686
configure_and_build_glibc nosegneg "$BuildFlags -mno-tls-direct-seg-refs" "$add_ons"
%endif
%else
#
# Build POWER-optimized glibc
@ -729,45 +664,64 @@ touch %{buildroot}%{_libdir}/gconv/gconv-modules.cache
# Do not install in parallel, timezone Makefile will fail
make install_root=%{buildroot} install -C cc-base
install_optimized_variant() {
local dirname="$1"; shift
local subdir="$1"; shift
local subdir_up="$1"; shift
cd "cc-$dirname"
destdir=$RPM_BUILD_ROOT/%{_lib}/$subdir
mkdir -p $destdir
# Don't run a complete make install, we know which libraries
# we want
for lib in libc math/libm nptl/libpthread rt/librt nptl_db/libthread_db
do
libbase=${lib#*/}
libbaseso=$(basename $RPM_BUILD_ROOT/%{_lib}/${libbase}-*.so)
# Only install if different from base lib
if cmp -s ${lib}.so ../cc-base/${lib}.so; then
ln -sf $subdir_up/$libbaseso $destdir/$libbaseso
else
cp -a ${lib}.so $destdir/$libbaseso
fi
# Emulate ldconfig
ln -sf $libbaseso $destdir/$(basename $RPM_BUILD_ROOT/%{_lib}/${libbase}.so.*)
done
cd ..
}
# Install i686 glibc for Xen
%ifarch i686
install_optimized_variant nosegneg i686/nosegneg "../.."
%endif
# Install power-optimized glibc
%if %{optimize_power}
# run ldconfig to create the library symlinks
# do not use the new ldconfig from the build directory because
# it may contain instructions not suitable for the cpu on the builhost
my_ldconfig=/sbin/ldconfig
for pcpu in \
%if %{powerpc_optimize_cpu_power4}
power4 \
install_optimized_variant power4 power4 ".."
%endif
%if %{powerpc_optimize_cpu_power6}
power6 \
install_optimized_variant power6 power6 ".."
%endif
%if %{powerpc_optimize_cpu_power7}
power7 \
install_optimized_variant power7 power7 ".."
%endif
%if %{powerpc_optimize_cpu_cell}
ppc-cell-be \
install_optimized_variant ppc-cell-be ppc-cell-be ".."
%endif
; do
make install_root=%{buildroot}/$pcpu install -C cc-$pcpu
mkdir -p %{buildroot}/%{_lib}/$pcpu
for i in libc-%{version} libm-%{version} libpthread-%{version} libthread_db-1.0 librt-%{version}; do
mv %{buildroot}/$pcpu/%{_lib}/$i.so %{buildroot}/%{_lib}/$pcpu
done
$my_ldconfig -n %{buildroot}/%{_lib}/$pcpu/
rm -rf %{buildroot}/$pcpu
done
%if %{powerpc_optimize_cpu_power6}
# power6 is compatible with power6x
# doing a symlink doesnt work, ldconfig follows them and accepts only the first real dir
if test -d %{buildroot}/%{_lib}/power6; then
mkdir -p %{buildroot}/%{_lib}/power6x
for i in %{buildroot}/%{_lib}/power6/*.so; do
b=`basename $i`
ln -vs ../power6/$b %{buildroot}/%{_lib}/power6x/$b
done
$my_ldconfig -n %{buildroot}/%{_lib}/power6x/
fi
# power6 is compatible with power6x
# doing a directory symlink doesnt work, ldconfig follows them and accepts only the first real dir
if test -d %{buildroot}/%{_lib}/power6; then
mkdir -p %{buildroot}/%{_lib}/power6x
for i in %{buildroot}/%{_lib}/power6/*.so; do
b=`basename $i`
ln -vs ../power6/$b %{buildroot}/%{_lib}/power6x/$b
libbase=${b%.so}
libbaseso=$(basename $RPM_BUILD_ROOT/%{_lib}/${libbase}-*.so)
# Emulate ldconfig
ln -sf $libbaseso %{buildroot}/%{_lib}/power6x/$(basename $RPM_BUILD_ROOT/%{_lib}/${libbase}.so.*)
done
fi
%endif
%endif # optimize_power
@ -988,6 +942,8 @@ exit 0
/%{_lib}/libnsl.so.1
/%{_lib}/libnss_compat-%{version}.so
/%{_lib}/libnss_compat.so.2
/%{_lib}/libnss_db-%{version}.so
/%{_lib}/libnss_db.so.2
/%{_lib}/libnss_dns-%{version}.so
/%{_lib}/libnss_dns.so.2
/%{_lib}/libnss_files-%{version}.so
@ -1008,19 +964,24 @@ exit 0
/%{_lib}/libthread_db.so.1
/%{_lib}/libutil-%{version}.so
/%{_lib}/libutil.so.1
%define optimized_libs() \
%dir %attr(0755,root,root) /%{_lib}/%1\
/%{_lib}/%1/libc-%{version}.so\
/%{_lib}/%1/libc.so.6*\
/%{_lib}/%1/libm-%{version}.so\
/%{_lib}/%1/libm.so.6*\
/%{_lib}/%1/libpthread-%{version}.so\
/%{_lib}/%1/libpthread.so.0\
/%{_lib}/%1/librt-%{version}.so\
/%{_lib}/%1/librt.so.1\
/%{_lib}/%1/libthread_db-1.0.so\
/%{_lib}/%1/libthread_db.so.1
%ifarch i686
%dir %attr(0755,root,root) /%{_lib}/i686
%{optimized_libs i686/nosegneg}
%endif
%if %{optimize_power}
%define optimized_libs() \
%dir %attr(0755,root,root) /%{_lib}/%1\
/%{_lib}/%1/libc-%{version}.so\
/%{_lib}/%1/libc.so.6*\
/%{_lib}/%1/libm-%{version}.so\
/%{_lib}/%1/libm.so.6*\
/%{_lib}/%1/libpthread-%{version}.so\
/%{_lib}/%1/libpthread.so.0\
/%{_lib}/%1/librt-%{version}.so\
/%{_lib}/%1/librt.so.1\
/%{_lib}/%1/libthread_db-1.0.so\
/%{_lib}/%1/libthread_db.so.1
%if %{powerpc_optimize_cpu_power4}
%{optimized_libs power4}
%endif
@ -1047,11 +1008,14 @@ exit 0
%endif
%{_bindir}/locale
%{_bindir}/localedef
%{_bindir}/makedb
%verify(not mode caps) %attr(4755,root,root) %{_libdir}/pt_chown
%dir %attr(0755,root,root) %{_libdir}/getconf
%{_libdir}/getconf/*
%{_sbindir}/glibc_post_upgrade
%{_sbindir}/iconvconfig
%dir /var/db
/var/db/Makefile
%ifarch %ix86
@ -1073,7 +1037,7 @@ exit 0
%files devel
%defattr(-,root,root)
%doc COPYING COPYING.LIB FAQ INSTALL NEWS NOTES README BUGS CONFORMANCE
%doc COPYING COPYING.LIB FAQ NEWS NOTES README BUGS CONFORMANCE
%doc %{_mandir}/man1/catchsegv.1.gz
%doc %{_mandir}/man1/rpcgen.1.gz
%doc %{_mandir}/man1/sprof.1.gz
@ -1170,5 +1134,6 @@ exit 0
%{_bindir}/pcprofiledump
%{_bindir}/sotruss
%{_bindir}/xtrace
%{_bindir}/pldd
%changelog

View File

@ -1,569 +0,0 @@
Index: sysdeps/x86_64/fpu/libm_inlines_amd.h
===================================================================
--- sysdeps/x86_64/fpu/libm_inlines_amd.h.orig
+++ sysdeps/x86_64/fpu/libm_inlines_amd.h
@@ -1,8 +1,8 @@
/*
-(C) 2002 Advanced Micro Devices, Inc.
+(C) 2002, 2009 Advanced Micro Devices, Inc.
** YOUR USE OF THIS LIBRARY IS SUBJECT TO THE TERMS
AND CONDITIONS OF THE GNU LESSER GENERAL PUBLIC
- LICENSE FOUND IN THE "README" FILE THAT IS INCLUDED WITH
+ LICENSE FOUND IN THE "LICENSE" FILE THAT IS INCLUDED WITH
THIS LIBRARY**
*/
@@ -254,6 +254,33 @@ static inline void clear_fpsw_flags(int
#if defined(USE_RAISE_FPSW_FLAGS)
+static inline void raise_fp_exc(int flags)
+{
+ if((flags & AMD_F_UNDERFLOW) == AMD_F_UNDERFLOW)
+ {
+ double a = 0x1.0p-1022;
+ __asm __volatile ("mulsd %1, %0" : "+x" (a));
+ }
+
+ if((flags & AMD_F_OVERFLOW) == AMD_F_OVERFLOW)
+ {
+ double a = 0x1.fffffffffffffp1023;
+ __asm __volatile ("mulsd %1, %0" : "+x" (a));
+ }
+
+ if((flags & AMD_F_DIVBYZERO) == AMD_F_DIVBYZERO)
+ {
+ double a = 1.0, b = 0.0;
+ __asm __volatile ("divsd %1, %0" : "+x" (a) : "x" (b));
+ }
+
+ if((flags & AMD_F_INVALID) == AMD_F_INVALID)
+ {
+ double a = 0.0;
+ __asm __volatile ("divsd %1, %0" : "+x" (a));
+ }
+}
+
/* Raises floating-point status flags. The argument should be
the bitwise or of the flags to be raised, from the
list above, e.g.
@@ -269,11 +296,7 @@ static inline void raise_fpsw_flags(int
/* Put the floating-point environment back */
__asm fldenv fenv;
#elif defined(linux)
- unsigned int cw;
- /* Get the current floating-point control/status word */
- asm volatile ("STMXCSR %0" : "=m" (cw));
- cw |= flags;
- asm volatile ("LDMXCSR %0" : : "m" (cw));
+ raise_fp_exc(flags);
#else
#error Unknown machine
#endif
Index: sysdeps/x86_64/fpu/s_atan2.c
===================================================================
--- sysdeps/x86_64/fpu/s_atan2.c.orig
+++ sysdeps/x86_64/fpu/s_atan2.c
@@ -1,8 +1,8 @@
/*
-(C) 2002 Advanced Micro Devices, Inc.
+(C) 2002, 2009 Advanced Micro Devices, Inc.
** YOUR USE OF THIS LIBRARY IS SUBJECT TO THE TERMS
AND CONDITIONS OF THE GNU LESSER GENERAL PUBLIC
- LICENSE FOUND IN THE "README" FILE THAT IS INCLUDED WITH
+ LICENSE FOUND IN THE "LICENSE" FILE THAT IS INCLUDED WITH
THIS LIBRARY**
*/
@@ -595,6 +595,14 @@ double __atan2(double y, double x)
if (yneg) return val_with_flags(-piby2,AMD_F_INEXACT);
else val_with_flags(piby2,AMD_F_INEXACT);
}
+ else if((!xneg) && xinf && (!yinf) && (!yzero))
+ {
+ if(yneg)
+ return -0.0;
+ else
+ return 0.0;
+ }
+
/* Scale up both x and y if they are both below 1/4.
This avoids any possible later denormalised arithmetic. */
Index: sysdeps/x86_64/fpu/s_atan2f.c
===================================================================
--- sysdeps/x86_64/fpu/s_atan2f.c.orig
+++ sysdeps/x86_64/fpu/s_atan2f.c
@@ -1,8 +1,8 @@
/*
-(C) 2002 Advanced Micro Devices, Inc.
+(C) 2002, 2009 Advanced Micro Devices, Inc.
** YOUR USE OF THIS LIBRARY IS SUBJECT TO THE TERMS
AND CONDITIONS OF THE GNU LESSER GENERAL PUBLIC
- LICENSE FOUND IN THE "README" FILE THAT IS INCLUDED WITH
+ LICENSE FOUND IN THE "LICENSE" FILE THAT IS INCLUDED WITH
THIS LIBRARY**
*/
@@ -349,6 +349,14 @@ float __atan2f(float fy, float fx)
if (yneg) return val_with_flags(-piby2,AMD_F_INEXACT);
else val_with_flags(piby2,AMD_F_INEXACT);
}
+ else if((!xneg) && xinf && (!yinf) && (!yzero))
+ {
+ if(yneg)
+ return -0.0;
+ else
+ return 0.0;
+ }
+
if (diffexp > 26)
{ /* abs(y)/abs(x) > 2^26 => arctan(x/y)
Index: sysdeps/x86_64/fpu/s_atan.c
===================================================================
--- sysdeps/x86_64/fpu/s_atan.c.orig
+++ sysdeps/x86_64/fpu/s_atan.c
@@ -1,8 +1,8 @@
/*
-(C) 2002 Advanced Micro Devices, Inc.
+(C) 2002, 2009 Advanced Micro Devices, Inc.
** YOUR USE OF THIS LIBRARY IS SUBJECT TO THE TERMS
AND CONDITIONS OF THE GNU LESSER GENERAL PUBLIC
- LICENSE FOUND IN THE "README" FILE THAT IS INCLUDED WITH
+ LICENSE FOUND IN THE "LICENSE" FILE THAT IS INCLUDED WITH
THIS LIBRARY**
*/
@@ -67,7 +67,7 @@ double __atan (double x)
if (aux == 0) /* if x=0, then result is precise */
return x;
else
- return val_with_flags(x, AMD_F_INEXACT);
+ return val_with_flags(x, AMD_F_INEXACT | AMD_F_UNDERFLOW);
}
/* Argument reduction to range [-7/16,7/16] */
Index: sysdeps/x86_64/fpu/s_atanf.c
===================================================================
--- sysdeps/x86_64/fpu/s_atanf.c.orig
+++ sysdeps/x86_64/fpu/s_atanf.c
@@ -1,8 +1,8 @@
/*
-(C) 2002 Advanced Micro Devices, Inc.
+(C) 2002, 2009 Advanced Micro Devices, Inc.
** YOUR USE OF THIS LIBRARY IS SUBJECT TO THE TERMS
AND CONDITIONS OF THE GNU LESSER GENERAL PUBLIC
- LICENSE FOUND IN THE "README" FILE THAT IS INCLUDED WITH
+ LICENSE FOUND IN THE "LICENSE" FILE THAT IS INCLUDED WITH
THIS LIBRARY**
*/
@@ -68,7 +68,7 @@ float __atanf (float fx)
if (aux == 0) /* if x=0, then result is precise */
return fx;
else
- return valf_with_flags(fx, AMD_F_INEXACT);
+ return valf_with_flags(fx, AMD_F_INEXACT | AMD_F_UNDERFLOW);
}
v = x;
Index: sysdeps/x86_64/fpu/s_sincos.c
===================================================================
--- sysdeps/x86_64/fpu/s_sincos.c.orig
+++ sysdeps/x86_64/fpu/s_sincos.c
@@ -1,8 +1,8 @@
/*
-(C) 2002 Advanced Micro Devices, Inc.
-** YOUR USE OF THIS LIBRARY IS SUBJECT TO THE TERMS
- AND CONDITIONS OF THE GNU LESSER GENERAL PUBLIC
- LICENSE FOUND IN THE "README" FILE THAT IS INCLUDED WITH
+(C) 2002, 2009 Advanced Micro Devices, Inc.
+** YOUR USE OF THIS LIBRARY IS SUBJECT TO THE TERMS
+ AND CONDITIONS OF THE GNU LESSER GENERAL PUBLIC
+ LICENSE FOUND IN THE "LICENSE" FILE THAT IS INCLUDED WITH
THIS LIBRARY**
*/
@@ -97,7 +97,7 @@ void __sincos(double x, double *s, doubl
}
else
{
- *s = x;
+ *s = val_with_flags(x, AMD_F_INEXACT);
*c = val_with_flags(1.0, AMD_F_INEXACT);
}
}
Index: sysdeps/x86_64/fpu/s_sincosf.c
===================================================================
--- sysdeps/x86_64/fpu/s_sincosf.c.orig
+++ sysdeps/x86_64/fpu/s_sincosf.c
@@ -1,8 +1,8 @@
/*
-(C) 2002 Advanced Micro Devices, Inc.
-** YOUR USE OF THIS LIBRARY IS SUBJECT TO THE TERMS
- AND CONDITIONS OF THE GNU LESSER GENERAL PUBLIC
- LICENSE FOUND IN THE "README" FILE THAT IS INCLUDED WITH
+(C) 2002 Advanced Micro Devices, Inc.
+** YOUR USE OF THIS LIBRARY IS SUBJECT TO THE TERMS
+ AND CONDITIONS OF THE GNU LESSER GENERAL PUBLIC
+ LICENSE FOUND IN THE "README" FILE THAT IS INCLUDED WITH
THIS LIBRARY**
*/
Index: sysdeps/x86_64/fpu/s_tanf.c
===================================================================
--- sysdeps/x86_64/fpu/s_tanf.c.orig
+++ sysdeps/x86_64/fpu/s_tanf.c
@@ -1,8 +1,8 @@
/*
-(C) 2002 Advanced Micro Devices, Inc.
-** YOUR USE OF THIS LIBRARY IS SUBJECT TO THE TERMS
- AND CONDITIONS OF THE GNU LESSER GENERAL PUBLIC
- LICENSE FOUND IN THE "README" FILE THAT IS INCLUDED WITH
+(C) 2002 Advanced Micro Devices, Inc.
+** YOUR USE OF THIS LIBRARY IS SUBJECT TO THE TERMS
+ AND CONDITIONS OF THE GNU LESSER GENERAL PUBLIC
+ LICENSE FOUND IN THE "README" FILE THAT IS INCLUDED WITH
THIS LIBRARY**
*/
@@ -18,7 +18,7 @@
#undef USE_NAN_WITH_FLAGS
#undef USE_REMAINDER_PIBY2F_INLINE
-/* tan(x) approximation valid on the interval [-pi/4,pi/4].
+/* tan(x) approximation valid on the interval [-pi/4,pi/4].
If recip is true return -1/tan(x) instead. */
static inline double tanf_piby4(double x, int recip)
{
Index: sysdeps/x86_64/fpu/w_asin.c
===================================================================
--- sysdeps/x86_64/fpu/w_asin.c.orig
+++ sysdeps/x86_64/fpu/w_asin.c
@@ -1,8 +1,8 @@
/*
-(C) 2002 Advanced Micro Devices, Inc.
+(C) 2002, 2009 Advanced Micro Devices, Inc.
** YOUR USE OF THIS LIBRARY IS SUBJECT TO THE TERMS
AND CONDITIONS OF THE GNU LESSER GENERAL PUBLIC
- LICENSE FOUND IN THE "README" FILE THAT IS INCLUDED WITH
+ LICENSE FOUND IN THE "LICENSE" FILE THAT IS INCLUDED WITH
THIS LIBRARY**
*/
@@ -76,7 +76,8 @@ double __asin(double x)
if (xexp < -28)
{ /* y small enough that arcsin(x) = x */
- return val_with_flags(x, AMD_F_INEXACT);
+ if(aux == 0) return x;
+ return val_with_flags(x, AMD_F_INEXACT | AMD_F_UNDERFLOW);
}
else if (xnan) return x + x;
else if (xexp >= 0)
Index: sysdeps/x86_64/fpu/w_asinf.c
===================================================================
--- sysdeps/x86_64/fpu/w_asinf.c.orig
+++ sysdeps/x86_64/fpu/w_asinf.c
@@ -1,8 +1,8 @@
/*
-(C) 2002 Advanced Micro Devices, Inc.
+(C) 2002, 2009 Advanced Micro Devices, Inc.
** YOUR USE OF THIS LIBRARY IS SUBJECT TO THE TERMS
AND CONDITIONS OF THE GNU LESSER GENERAL PUBLIC
- LICENSE FOUND IN THE "README" FILE THAT IS INCLUDED WITH
+ LICENSE FOUND IN THE "LICENSE" FILE THAT IS INCLUDED WITH
THIS LIBRARY**
*/
@@ -75,8 +75,11 @@ float __asinf(float x)
/* Special cases */
if (xexp < -14)
+ {
/* y small enough that arcsin(x) = x */
- return valf_with_flags(x, AMD_F_INEXACT);
+ if(aux == 0 ) return x;
+ return valf_with_flags(x, AMD_F_INEXACT | AMD_F_UNDERFLOW);
+ }
else if (xnan) return x + x;
else if (xexp >= 0)
{
Index: sysdeps/x86_64/fpu/w_hypotf.c
===================================================================
--- sysdeps/x86_64/fpu/w_hypotf.c.orig
+++ sysdeps/x86_64/fpu/w_hypotf.c
@@ -1,8 +1,8 @@
/*
-(C) 2002 Advanced Micro Devices, Inc.
+(C) 2002, 2009 Advanced Micro Devices, Inc.
** YOUR USE OF THIS LIBRARY IS SUBJECT TO THE TERMS
AND CONDITIONS OF THE GNU LESSER GENERAL PUBLIC
- LICENSE FOUND IN THE "README" FILE THAT IS INCLUDED WITH
+ LICENSE FOUND IN THE "LICENSE" FILE THAT IS INCLUDED WITH
THIS LIBRARY**
*/
@@ -79,6 +79,20 @@ float __hypotf(float x, float y)
return retval;
}
+ /* Set x = abs(x) and y = abs(y) */
+ if (ux == 0)
+ {
+ /* x is zero */
+ PUT_BITS_DP64(avy, dy);
+ return dy;
+ }
+ if (uy == 0)
+ {
+ /* y is zero */
+ PUT_BITS_DP64(avx, dx);
+ return dx;
+ }
+
dr = (dx*dx + dy*dy);
#if USE_SOFTWARE_SQRT
Index: sysdeps/x86_64/fpu/w_pow.c
===================================================================
--- sysdeps/x86_64/fpu/w_pow.c.orig
+++ sysdeps/x86_64/fpu/w_pow.c
@@ -1,8 +1,8 @@
/*
-(C) 2002 Advanced Micro Devices, Inc.
+(C) 2002, 2009 Advanced Micro Devices, Inc.
** YOUR USE OF THIS LIBRARY IS SUBJECT TO THE TERMS
AND CONDITIONS OF THE GNU LESSER GENERAL PUBLIC
- LICENSE FOUND IN THE "README" FILE THAT IS INCLUDED WITH
+ LICENSE FOUND IN THE "LICENSE" FILE THAT IS INCLUDED WITH
THIS LIBRARY**
*/
@@ -364,8 +364,20 @@ double __pow(double x, double y)
{
/* y is -ve */
if (ax == 0)
- /* abs(x) = 0.0. Return +infinity. */
- return retval_errno_edom(argx, argy, 1);
+ {
+ if(yinf)
+ {
+ /* Return +infinity with no flags */
+ double sz;
+ PUT_BITS_DP64(PINFBITPATT_DP64, sz);
+ return sz;
+ }
+ else
+ {
+ /* abs(x) = 0.0. Return +infinity. */
+ return retval_errno_edom(argx, argy, 1);
+ }
+ }
else if (ax < 0x3ff0000000000000)
{
/* abs(x) < 1.0; return +infinity. */
Index: sysdeps/x86_64/fpu/w_powf.c
===================================================================
--- sysdeps/x86_64/fpu/w_powf.c.orig
+++ sysdeps/x86_64/fpu/w_powf.c
@@ -1,8 +1,8 @@
/*
-(C) 2002 Advanced Micro Devices, Inc.
+(C) 2002, 2009 Advanced Micro Devices, Inc.
** YOUR USE OF THIS LIBRARY IS SUBJECT TO THE TERMS
AND CONDITIONS OF THE GNU LESSER GENERAL PUBLIC
- LICENSE FOUND IN THE "README" FILE THAT IS INCLUDED WITH
+ LICENSE FOUND IN THE "LICENSE" FILE THAT IS INCLUDED WITH
THIS LIBRARY**
*/
@@ -175,8 +175,20 @@ float __powf(float x, float y)
{
/* y is -ve */
if (ax == 0)
- /* abs(x) = 0.0. Return +infinity. */
- return retval_errno_edom(x, y, 1);
+ {
+ if(yinf)
+ {
+ /* Return +infinity with no flags */
+ float sz;
+ PUT_BITS_SP32(PINFBITPATT_SP32, sz);
+ return sz;
+ }
+ else
+ {
+ /* abs(x) = 0.0. Return +infinity. */
+ return retval_errno_edom(x, y, 1);
+ }
+ }
else if (ax < 0x3f800000)
{
/* abs(x) < 1.0; return +infinity. */
Index: sysdeps/x86_64/fpu/w_remainder.c
===================================================================
--- sysdeps/x86_64/fpu/w_remainder.c.orig
+++ sysdeps/x86_64/fpu/w_remainder.c
@@ -1,8 +1,8 @@
/*
-(C) 2002 Advanced Micro Devices, Inc.
+(C) 2002, 2009 Advanced Micro Devices, Inc.
** YOUR USE OF THIS LIBRARY IS SUBJECT TO THE TERMS
AND CONDITIONS OF THE GNU LESSER GENERAL PUBLIC
- LICENSE FOUND IN THE "README" FILE THAT IS INCLUDED WITH
+ LICENSE FOUND IN THE "LICENSE" FILE THAT IS INCLUDED WITH
THIS LIBRARY**
*/
@@ -69,11 +69,31 @@ double __remainder(double x, double y)
{
/* x is NaN or infinity */
if (ux & MANTBITS_DP64)
- /* x is NaN */
- return dx + dx; /* Raise invalid if it is a signalling NaN */
+ {
+ if( (yexp > BIASEDEMAX_DP64) && (uy & MANTBITS_DP64) )
+ {
+ /* y is also NaN */
+ return dx + dy;
+ }
+ else
+ {
+ /* x is NaN */
+ return dx + dx; /* Raise invalid if it is a signalling NaN */
+ }
+ }
else
- /* x is infinity; result is NaN */
- return nan_with_flags(AMD_F_INVALID);
+ {
+ if((yexp > BIASEDEMAX_DP64) && (uy & MANTBITS_DP64))
+ {
+ /* y is NaN */
+ return dy+dy;
+ }
+ else
+ {
+ /* x is infinity; result is NaN */
+ return nan_with_flags(AMD_F_INVALID);
+ }
+ }
}
else if (yexp > BIASEDEMAX_DP64)
{
Index: sysdeps/x86_64/fpu/w_remainderf.c
===================================================================
--- sysdeps/x86_64/fpu/w_remainderf.c.orig
+++ sysdeps/x86_64/fpu/w_remainderf.c
@@ -1,8 +1,8 @@
/*
-(C) 2002 Advanced Micro Devices, Inc.
+(C) 2002, 2009 Advanced Micro Devices, Inc.
** YOUR USE OF THIS LIBRARY IS SUBJECT TO THE TERMS
AND CONDITIONS OF THE GNU LESSER GENERAL PUBLIC
- LICENSE FOUND IN THE "README" FILE THAT IS INCLUDED WITH
+ LICENSE FOUND IN THE "LICENSE" FILE THAT IS INCLUDED WITH
THIS LIBRARY**
*/
@@ -50,11 +50,31 @@ float __remainderf(float x, float y)
{
/* x is NaN or infinity */
if (ux & MANTBITS_DP64)
- /* x is NaN */
- return dx + dx; /* Raise invalid if it is a signalling NaN */
+ {
+ if((yexp > BIASEDEMAX_DP64) && (uy & MANTBITS_DP64))
+ {
+ /* y is also NaN */
+ return dx + dy;
+ }
+ else
+ {
+ /* x is NaN */
+ return dx + dx; /* Raise invalid if it is a signalling NaN */
+ }
+ }
else
- /* x is infinity; result is NaN */
- return nan_with_flags(AMD_F_INVALID);
+ {
+ if((yexp > BIASEDEMAX_DP64) && (uy & MANTBITS_DP64))
+ {
+ /* y is NaN */
+ return dy+dy;
+ }
+ else
+ {
+ /* x is infinity; result is NaN */
+ return nan_with_flags(AMD_F_INVALID);
+ }
+ }
}
else if (yexp > BIASEDEMAX_DP64)
{
Index: sysdeps/x86_64/fpu/w_sinh.c
===================================================================
--- sysdeps/x86_64/fpu/w_sinh.c.orig
+++ sysdeps/x86_64/fpu/w_sinh.c
@@ -1,8 +1,8 @@
/*
-(C) 2002 Advanced Micro Devices, Inc.
+(C) 2002, 2009 Advanced Micro Devices, Inc.
** YOUR USE OF THIS LIBRARY IS SUBJECT TO THE TERMS
AND CONDITIONS OF THE GNU LESSER GENERAL PUBLIC
- LICENSE FOUND IN THE "README" FILE THAT IS INCLUDED WITH
+ LICENSE FOUND IN THE "LICENSE" FILE THAT IS INCLUDED WITH
THIS LIBRARY**
*/
@@ -249,7 +249,7 @@ double __sinh(double x)
/* with no inexact */
return x;
else
- return val_with_flags(x, AMD_F_INEXACT);
+ return val_with_flags(x, AMD_F_INEXACT | AMD_F_UNDERFLOW);
}
else if (aux >= 0x7ff0000000000000) /* |x| is NaN or Inf */
return x + x;
Index: sysdeps/x86_64/fpu/w_sinhf.c
===================================================================
--- sysdeps/x86_64/fpu/w_sinhf.c.orig
+++ sysdeps/x86_64/fpu/w_sinhf.c
@@ -1,8 +1,8 @@
/*
-(C) 2002 Advanced Micro Devices, Inc.
+(C) 2002, 2009 Advanced Micro Devices, Inc.
** YOUR USE OF THIS LIBRARY IS SUBJECT TO THE TERMS
AND CONDITIONS OF THE GNU LESSER GENERAL PUBLIC
- LICENSE FOUND IN THE "README" FILE THAT IS INCLUDED WITH
+ LICENSE FOUND IN THE "LICENSE" FILE THAT IS INCLUDED WITH
THIS LIBRARY**
*/
@@ -13,11 +13,13 @@
#define USE_SCALEDOUBLE_1
#define USE_SCALEDOUBLE_2
#define USE_INFINITY_WITH_FLAGS
+#define USE_VAL_WITH_FLAGS
#include "libm_inlines_amd.h"
#undef USE_SPLITEXP
#undef USE_SCALEDOUBLE_1
#undef USE_SCALEDOUBLE_2
#undef USE_INFINITY_WITH_FLAGS
+#undef USE_VAL_WITH_FLAGS
/* Deal with errno for out-of-range result */
#include "libm_errno_amd.h"
@@ -166,7 +168,8 @@ float __sinhf(float fx)
if (aux < 0x3f10000000000000) /* |x| small enough that sinh(x) = x */
{
if (aux == 0) return x; /* with no inexact */
- if (LAMBDA_DP64 + x > 1.0) return x; /* with inexact */
+ else
+ return val_with_flags(x, AMD_F_INEXACT | AMD_F_UNDERFLOW); /* with inexact */
}
else if (aux >= 0x7ff0000000000000) /* |x| is NaN or Inf */
return x + x;

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:65537d54c9f89d1d54123b450e39975177decba4131fb99f3392981b10887bcb
size 75446

View File

@ -0,0 +1,252 @@
http://sourceware.org/ml/libc-alpha/2012-01/msg00002.html
The following patch:
Has been reported as causing numerous problems in Fedora & Debian. I
don't think anyone has done any serious analysis of the issue, but the
patch has been pulled from both distributions because of the
instability it's introduced.
https://bugzilla.redhat.com/show_bug.cgi?id=769421
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=651899
commit c5a0802a682dba23f92d47f0f99775aebfbe2539
Author: Andreas Schwab <schwab@redhat.com>
Date: Mon Nov 28 13:38:19 2011 +0100
Handle EAGAIN from FUTEX_WAIT_REQUEUE_PI
2011-11-28 Andreas Schwab <schwab@redhat.com>
* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Handle
EAGAIN from FUTEX_WAIT_REQUEUE_PI.
* sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S: Likewise.
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
index 53970d7..54590b7 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S
@@ -134,6 +134,7 @@ __pthread_cond_wait:
cmpl $PI_BIT, %eax
jne 18f
+90:
movl $(FUTEX_WAIT_REQUEUE_PI|FUTEX_PRIVATE_FLAG), %ecx
movl %ebp, %edx
xorl %esi, %esi
@@ -147,6 +148,9 @@ __pthread_cond_wait:
sete 16(%esp)
je 19f
+ cmpl $-EAGAIN, %eax
+ je 91f
+
/* Normal and PI futexes dont mix. Use normal futex functions only
if the kernel does not support the PI futex functions. */
cmpl $-ENOSYS, %eax
@@ -391,6 +395,78 @@ __pthread_cond_wait:
#endif
call __lll_unlock_wake
jmp 11b
+
+91:
+.LcleanupSTART2:
+ /* FUTEX_WAIT_REQUEUE_PI returned EAGAIN. We need to
+ call it again. */
+
+ /* Get internal lock. */
+ movl $1, %edx
+ xorl %eax, %eax
+ LOCK
+#if cond_lock == 0
+ cmpxchgl %edx, (%ebx)
+#else
+ cmpxchgl %edx, cond_lock(%ebx)
+#endif
+ jz 92f
+
+#if cond_lock == 0
+ movl %ebx, %edx
+#else
+ leal cond_lock(%ebx), %edx
+#endif
+#if (LLL_SHARED-LLL_PRIVATE) > 255
+ xorl %ecx, %ecx
+#endif
+ cmpl $-1, dep_mutex(%ebx)
+ setne %cl
+ subl $1, %ecx
+ andl $(LLL_SHARED-LLL_PRIVATE), %ecx
+#if LLL_PRIVATE != 0
+ addl $LLL_PRIVATE, %ecx
+#endif
+ call __lll_lock_wait
+
+92:
+ /* Increment the cond_futex value again, so it can be used as a new
+ expected value. */
+ addl $1, cond_futex(%ebx)
+ movl cond_futex(%ebx), %ebp
+
+ /* Unlock. */
+ LOCK
+#if cond_lock == 0
+ subl $1, (%ebx)
+#else
+ subl $1, cond_lock(%ebx)
+#endif
+ je 93f
+#if cond_lock == 0
+ movl %ebx, %eax
+#else
+ leal cond_lock(%ebx), %eax
+#endif
+#if (LLL_SHARED-LLL_PRIVATE) > 255
+ xorl %ecx, %ecx
+#endif
+ cmpl $-1, dep_mutex(%ebx)
+ setne %cl
+ subl $1, %ecx
+ andl $(LLL_SHARED-LLL_PRIVATE), %ecx
+#if LLL_PRIVATE != 0
+ addl $LLL_PRIVATE, %ecx
+#endif
+ call __lll_unlock_wake
+
+93:
+ /* Set the rest of SYS_futex args for FUTEX_WAIT_REQUEUE_PI. */
+ xorl %ecx, %ecx
+ movl dep_mutex(%ebx), %edi
+ jmp 90b
+.LcleanupEND2:
+
.size __pthread_cond_wait, .-__pthread_cond_wait
versioned_symbol (libpthread, __pthread_cond_wait, pthread_cond_wait,
GLIBC_2_3_2)
@@ -563,6 +639,10 @@ __condvar_w_cleanup:
.long .LcleanupEND-.Lsub_cond_futex
.long __condvar_w_cleanup-.LSTARTCODE
.uleb128 0
+ .long .LcleanupSTART2-.LSTARTCODE
+ .long .LcleanupEND2-.LcleanupSTART2
+ .long __condvar_w_cleanup-.LSTARTCODE
+ .uleb128 0
.long .LcallUR-.LSTARTCODE
.long .LENDCODE-.LcallUR
.long 0
diff --git a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
index 7535baa..d837d15 100644
--- a/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
+++ b/nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
@@ -23,6 +23,7 @@
#include <lowlevelcond.h>
#include <tcb-offsets.h>
#include <pthread-pi-defines.h>
+#include <pthread-errnos.h>
#include <kernel-features.h>
@@ -133,11 +134,14 @@ __pthread_cond_wait:
cmpl $PI_BIT, %eax
jne 61f
+90:
movl $(FUTEX_WAIT_REQUEUE_PI|FUTEX_PRIVATE_FLAG), %esi
movl $SYS_futex, %eax
syscall
movl $1, %r8d
+ cmpq $-EAGAIN, %rax
+ je 91f
#ifdef __ASSUME_REQUEUE_PI
jmp 62f
#else
@@ -324,6 +328,70 @@ __pthread_cond_wait:
13: movq %r10, %rax
jmp 14b
+
+91:
+.LcleanupSTART2:
+ /* FUTEX_WAIT_REQUEUE_PI returned EAGAIN. We need to
+ call it again. */
+ movq 8(%rsp), %rdi
+
+ /* Get internal lock. */
+ movl $1, %esi
+ xorl %eax, %eax
+ LOCK
+#if cond_lock == 0
+ cmpxchgl %esi, (%rdi)
+#else
+ cmpxchgl %esi, cond_lock(%rdi)
+#endif
+ jz 92f
+
+#if cond_lock != 0
+ addq $cond_lock, %rdi
+#endif
+ cmpq $-1, dep_mutex-cond_lock(%rdi)
+ movl $LLL_PRIVATE, %eax
+ movl $LLL_SHARED, %esi
+ cmovne %eax, %esi
+ callq __lll_lock_wait
+#if cond_lock != 0
+ subq $cond_lock, %rdi
+#endif
+92:
+ /* Increment the cond_futex value again, so it can be used as a new
+ expected value. */
+ incl cond_futex(%rdi)
+ movl cond_futex(%rdi), %edx
+
+ /* Release internal lock. */
+ LOCK
+#if cond_lock == 0
+ decl (%rdi)
+#else
+ decl cond_lock(%rdi)
+#endif
+ jz 93f
+
+#if cond_lock != 0
+ addq $cond_lock, %rdi
+#endif
+ cmpq $-1, dep_mutex-cond_lock(%rdi)
+ movl $LLL_PRIVATE, %eax
+ movl $LLL_SHARED, %esi
+ cmovne %eax, %esi
+ /* The call preserves %rdx. */
+ callq __lll_unlock_wake
+#if cond_lock != 0
+ subq $cond_lock, %rdi
+#endif
+93:
+ /* Set the rest of SYS_futex args for FUTEX_WAIT_REQUEUE_PI. */
+ xorq %r10, %r10
+ movq dep_mutex(%rdi), %r8
+ leaq cond_futex(%rdi), %rdi
+ jmp 90b
+.LcleanupEND2:
+
.size __pthread_cond_wait, .-__pthread_cond_wait
versioned_symbol (libpthread, __pthread_cond_wait, pthread_cond_wait,
GLIBC_2_3_2)
@@ -476,11 +544,15 @@ __condvar_cleanup1:
.uleb128 .LcleanupSTART-.LSTARTCODE
.uleb128 .LcleanupEND-.LcleanupSTART
.uleb128 __condvar_cleanup1-.LSTARTCODE
- .uleb128 0
+ .uleb128 0
+ .uleb128 .LcleanupSTART2-.LSTARTCODE
+ .uleb128 .LcleanupEND2-.LcleanupSTART2
+ .uleb128 __condvar_cleanup1-.LSTARTCODE
+ .uleb128 0
.uleb128 .LcallUR-.LSTARTCODE
.uleb128 .LENDCODE-.LcallUR
.uleb128 0
- .uleb128 0
+ .uleb128 0
.Lcstend:

View File

@ -1,100 +0,0 @@
2011-12-17 Ulrich Drepper <drepper@gmail.com>
[BZ #13506]
* time/tzfile.c (__tzfile_read): Check values from file header.
diff --git a/time/tzfile.c b/time/tzfile.c
index 144e20b..402389c 100644
--- a/time/tzfile.c
+++ b/time/tzfile.c
@@ -234,23 +234,58 @@ __tzfile_read (const char *file, size_t extra, char **extrap)
goto read_again;
}
+ if (__builtin_expect (num_transitions
+ > ((SIZE_MAX - (__alignof__ (struct ttinfo) - 1))
+ / (sizeof (time_t) + 1)), 0))
+ goto lose;
total_size = num_transitions * (sizeof (time_t) + 1);
total_size = ((total_size + __alignof__ (struct ttinfo) - 1)
& ~(__alignof__ (struct ttinfo) - 1));
types_idx = total_size;
- total_size += num_types * sizeof (struct ttinfo) + chars;
+ if (__builtin_expect (num_types
+ > (SIZE_MAX - total_size) / sizeof (struct ttinfo), 0))
+ goto lose;
+ total_size += num_types * sizeof (struct ttinfo);
+ if (__builtin_expect (chars > SIZE_MAX - total_size, 0))
+ goto lose;
+ total_size += chars;
+ if (__builtin_expect (__alignof__ (struct leap) - 1
+ > SIZE_MAX - total_size, 0))
+ goto lose;
total_size = ((total_size + __alignof__ (struct leap) - 1)
& ~(__alignof__ (struct leap) - 1));
leaps_idx = total_size;
+ if (__builtin_expect (num_leaps
+ > (SIZE_MAX - total_size) / sizeof (struct leap), 0))
+ goto lose;
total_size += num_leaps * sizeof (struct leap);
- tzspec_len = (sizeof (time_t) == 8 && trans_width == 8
- ? st.st_size - (ftello (f)
- + num_transitions * (8 + 1)
- + num_types * 6
- + chars
- + num_leaps * 12
- + num_isstd
- + num_isgmt) - 1 : 0);
+ tzspec_len = 0;
+ if (sizeof (time_t) == 8 && trans_width == 8)
+ {
+ off_t rem = st.st_size - ftello (f);
+ if (__builtin_expect (rem < 0
+ || (size_t) rem < (num_transitions * (8 + 1)
+ + num_types * 6
+ + chars), 0))
+ goto lose;
+ tzspec_len = (size_t) rem - (num_transitions * (8 + 1)
+ + num_types * 6
+ + chars);
+ if (__builtin_expect (num_leaps > SIZE_MAX / 12
+ || tzspec_len < num_leaps * 12, 0))
+ goto lose;
+ tzspec_len -= num_leaps * 12;
+ if (__builtin_expect (tzspec_len < num_isstd, 0))
+ goto lose;
+ tzspec_len -= num_isstd;
+ if (__builtin_expect (tzspec == 0 || tzspec_len - 1 < num_isgmt, 0))
+ goto lose;
+ tzspec_len -= num_isgmt + 1;
+ if (__builtin_expect (SIZE_MAX - total_size < tzspec_len, 0))
+ goto lose;
+ }
+ if (__builtin_expect (SIZE_MAX - total_size - tzspec_len < extra, 0))
+ goto lose;
/* Allocate enough memory including the extra block requested by the
caller. */
And fix the previous patch ...
--- a/time/tzfile.c.orig 2011-12-19 10:58:26.000000000 +0100
+++ b/time/tzfile.c 2011-12-19 10:59:35.000000000 +0100
@@ -19,6 +19,7 @@
#include <assert.h>
#include <limits.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdio_ext.h>
#include <stdlib.h>
@@ -278,7 +279,7 @@
if (__builtin_expect (tzspec_len < num_isstd, 0))
goto lose;
tzspec_len -= num_isstd;
- if (__builtin_expect (tzspec == 0 || tzspec_len - 1 < num_isgmt, 0))
+ if (__builtin_expect (tzspec_len == 0 || tzspec_len - 1 < num_isgmt, 0))
goto lose;
tzspec_len -= num_isgmt + 1;
if (__builtin_expect (SIZE_MAX - total_size < tzspec_len, 0))