Skip to content

Commit

Permalink
Merge branch 'master' of ssh://sourceware.org/git/glibc
Browse files Browse the repository at this point in the history
Conflicts:
	ChangeLog
  • Loading branch information
Ulrich Drepper committed Sep 5, 2011
2 parents 2f0ad8f + 5f4318d commit 3b142ce
Show file tree
Hide file tree
Showing 19 changed files with 340 additions and 175 deletions.
55 changes: 55 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,61 @@
* sysdeps/unix/sysv/linux/x86_64/bits/sem.h (semdid_ds): Fix to match
kernel in 64-bit binaries.

2011-09-01 David S. Miller <davem@davemloft.net>

* elf/elf.h (HWCAP_SPARC_*): Move to..
* sysdeps/sparc/sysdep.h: this new file and add new values.
* sysdeps/unix/sparc/sysdep.h: Include sysdeps/sparc/sysdep.h
* sysdeps/sparc/dl-procinfo.h: Include sysdep.h and increase
_DL_HWCAP_COUNT to 24.
* sysdeps/sparc/dl-procinfo.c (_dl_sparc_cap_flags): Add new
entries.
* sysdeps/sparc/sparc32/bits/atomic.h: Don't use magic local
__ATOMIC_HWCAP_SPARC_V9 define, use sysdep.h one instead.
* sysdeps/sparc/sparc32/dl-machine.h: Include sysdep.h
* sysdeps/sparc/sparc64/multiarch/memcpy.S: Use HWCAP_SPARC_*
instead of magic constants.
* sysdeps/sparc/sparc64/multiarch/memset.S: Likewise.

2011-08-31 David S. Miller <davem@davemloft.net>

* sysdeps/unix/sparc/sysdep.h (SETUP_PIC_REG): Define.
* sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h (PSEUDO):
Reimplement to do errno handling inline.
(SYSCALL_ERROR_HANDLER): New macro.
(__SYSCALL_STRING): Do not do errno handling in asm.
(__CLONE_SYSCALL_STRING): Delete.
(__INTERNAL_SYSCALL_STRING): Delete.
* sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h: Include
sysdeps/unix/sparc/sysdep.h instead of sysdeps/unix/sysdep.h
(PSEUDO): Reimplement to do errno handling inline.
(ret, ret_NOERRNO, ret_ERRVAL, r0, r1, MOVE): Don't redefine.
(SYSCALL_ERROR_HANDLER): New macro.
(__SYSCALL_STRING): Do not do errno handling in asm.
(__CLONE_SYSCALL_STRING): Delete.
(__INTERNAL_SYSCALL_STRING): Delete.
* sysdeps/unix/sysv/linux/sparc/sysdep.h (INLINE_SYSCALL):
Implement in terms of INTERNAL_SYSCALL and __set_errno, just like
i386.
(INTERNAL_SYSCALL_DECL): Declare %g1 var for err state.
(inline_syscall*): Add 'err' argument.
(INTERNAL_SYSCALL, INTERNAL_SYSCALL_NCS,
INTERNAL_SYSCALL_ERROR_P): Likewise and pass it down.
(INLINE_CLONE_SYSCALL): Reimplement in terms of __SYSCALL_STRING,
INTERNAL_SYSCALL_ERRNO, and INTERNAL_SYSCALL_ERROR_P.

* scripts/data/localplt-sparc-linux-gnu.data: Remove 'ffs'.
* scripts/data/localplt-sparc64-linux-gnu.data: Likewise.

2011-08-30 Andreas Schwab <schwab@redhat.com>

* elf/rtld.c (dl_main): Relocate objects in dependency order.

2011-08-29 Jiri Olsa <jolsa@redhat.com>

* sysdeps/i386/dl-trampoline.S (_dl_runtime_profile): Fix cfi
directive.

2011-08-24 David S. Miller <davem@davemloft.net>

* sysdeps/sparc/sparc64/strcmp.S: Rewrite.
Expand Down
11 changes: 0 additions & 11 deletions elf/elf.h
Original file line number Diff line number Diff line change
Expand Up @@ -1339,17 +1339,6 @@ typedef struct
#define DT_SPARC_REGISTER 0x70000001
#define DT_SPARC_NUM 2

/* Bits present in AT_HWCAP on SPARC. */

#define HWCAP_SPARC_FLUSH 1 /* The CPU supports flush insn. */
#define HWCAP_SPARC_STBAR 2
#define HWCAP_SPARC_SWAP 4
#define HWCAP_SPARC_MULDIV 8
#define HWCAP_SPARC_V9 16 /* The CPU is v9, so v8plus is ok. */
#define HWCAP_SPARC_ULTRA3 32
#define HWCAP_SPARC_BLKINIT 64 /* Sun4v with block-init/load-twin. */
#define HWCAP_SPARC_N2 128

/* MIPS R3000 specific definitions. */

/* Legal values for e_flags field of Elf32_Ehdr. */
Expand Down
12 changes: 4 additions & 8 deletions elf/rtld.c
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand All @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions nptl/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2011-08-31 Andreas Schwab <schwab@redhat.com>

* allocatestack.c (setxid_mark_thread): Ensure that the exiting
thread is woken up.

2011-08-20 David S. Miller <davem@davemloft.net>

* Makefile (tst-cleanup0.out): Fix typo in output redirection.
Expand Down
11 changes: 10 additions & 1 deletion nptl/allocatestack.c
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,16 @@ setxid_mark_thread (struct xid_command *cmdp, struct pthread *t)

/* If the thread is exiting right now, ignore it. */
if ((ch & EXITING_BITMASK) != 0)
return;
{
/* Release the futex if there is no other setxid in
progress. */
if ((ch & SETXID_BITMASK) == 0)
{
t->setxid_futex = 1;
lll_futex_wake (&t->setxid_futex, 1, LLL_PRIVATE);
}
return;
}
}
while (atomic_compare_and_exchange_bool_acq (&t->cancelhandling,
ch | SETXID_BITMASK, ch));
Expand Down
1 change: 0 additions & 1 deletion scripts/data/localplt-sparc-linux-gnu.data
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ libc.so: _Q_mul
libc.so: _Q_sub
libc.so: _Unwind_Find_FDE
libc.so: calloc
libc.so: ffs
libc.so: free
libc.so: malloc
libc.so: memalign
Expand Down
1 change: 0 additions & 1 deletion scripts/data/localplt-sparc64-linux-gnu.data
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ libc.so: _Qp_sub
libc.so: _Qp_xtoq
libc.so: _Unwind_Find_FDE
libc.so: calloc
libc.so: ffs
libc.so: free
libc.so: malloc
libc.so: memalign
Expand Down
4 changes: 2 additions & 2 deletions sysdeps/i386/dl-trampoline.S
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* PLT trampolines. i386 version.
Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
Copyright (C) 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
Expand Down Expand Up @@ -99,7 +99,7 @@ _dl_runtime_profile:
+4 %edx
%esp free
*/
cfi_adjust_cfa_offset (12)
cfi_adjust_cfa_offset (8)
1: movl %ebx, (%esp)
cfi_rel_offset (ebx, 0)
movl %edx, %ebx # This is the frame buffer size
Expand Down
9 changes: 6 additions & 3 deletions sysdeps/sparc/dl-procinfo.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Data for Linux/sparc version of processor capability information.
Copyright (C) 2002,2003,2006 Free Software Foundation, Inc.
Copyright (C) 2002,2003,2006,2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2002.
Expand Down Expand Up @@ -47,10 +47,13 @@
#if !defined PROCINFO_DECL && defined SHARED
._dl_sparc_cap_flags
#else
PROCINFO_CLASS const char _dl_sparc_cap_flags[8][7]
PROCINFO_CLASS const char _dl_sparc_cap_flags[24][11]
#endif
#ifndef PROCINFO_DECL
= { "flush", "stbar", "swap", "muldiv", "v9", "ultra3", "v9v", "v9v2" }
= { "flush", "stbar", "swap", "muldiv", "v9", "ultra3", "v9v", "v9v2",
"mul32", "div32", "fsmuld", "v8plus", "popc", "vis", "vis2",
"ASIBlkInit", "fmaf", "vis3", "hpc", "random", "trans", "fjfmau",
"ima", "cspare" }
#endif
#if !defined SHARED || defined PROCINFO_DECL
;
Expand Down
5 changes: 3 additions & 2 deletions sysdeps/sparc/dl-procinfo.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Linux/sparc version of processor capability information handling macros.
Copyright (C) 1999,2000,2001,2002,2003,2004,2006
Copyright (C) 1999,2000,2001,2002,2003,2004,2006,2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jj@ultra.linux.cz>, 1999.
Expand All @@ -23,8 +23,9 @@
#define _DL_PROCINFO_H 1

#include <ldsodefs.h>
#include <sysdep.h>

#define _DL_HWCAP_COUNT 8
#define _DL_HWCAP_COUNT 24

static inline int
__attribute__ ((unused))
Expand Down
8 changes: 3 additions & 5 deletions sysdeps/sparc/sparc32/bits/atomic.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Atomic operations. sparc32 version.
Copyright (C) 2003, 2004, 2006 Free Software Foundation, Inc.
Copyright (C) 2003, 2004, 2006, 2011 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Jakub Jelinek <jakub@redhat.com>, 2003.
Expand All @@ -22,6 +22,7 @@
#define _BITS_ATOMIC_H 1

#include <stdint.h>
#include <sysdep.h>

typedef int8_t atomic8_t;
typedef uint8_t uatomic8_t;
Expand Down Expand Up @@ -238,13 +239,10 @@ volatile unsigned char __sparc32_atomic_locks[64]
apps on v9 CPUs e.g. with process shared primitives, use cas insn
on v9 CPUs and ldstub on pre-v9. */

/* Avoid <ldsodefs.h> include here. */
extern uint64_t _dl_hwcap __attribute__((weak));
# define __ATOMIC_HWCAP_SPARC_V9 16
# define __atomic_is_v9 \
(__builtin_expect (&_dl_hwcap != 0, 1) \
&& __builtin_expect (_dl_hwcap & __ATOMIC_HWCAP_SPARC_V9, \
__ATOMIC_HWCAP_SPARC_V9))
&& __builtin_expect (_dl_hwcap & HWCAP_SPARC_V9, HWCAP_SPARC_V9))

# define atomic_compare_and_exchange_val_acq(mem, newval, oldval) \
({ \
Expand Down
3 changes: 2 additions & 1 deletion sysdeps/sparc/sparc32/dl-machine.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Machine-dependent ELF dynamic relocation inline functions. SPARC version.
Copyright (C) 1996-2003, 2004, 2005, 2006, 2007, 2010
Copyright (C) 1996-2003, 2004, 2005, 2006, 2007, 2010, 2011
Free Software Foundation, Inc.
This file is part of the GNU C Library.
Expand All @@ -26,6 +26,7 @@
#include <string.h>
#include <sys/param.h>
#include <ldsodefs.h>
#include <sysdep.h>
#include <tls.h>
#include <dl-plt.h>

Expand Down
8 changes: 4 additions & 4 deletions sysdeps/sparc/sparc64/multiarch/memcpy.S
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Multiple versions of memcpy
Copyright (C) 2010 Free Software Foundation, Inc.
Copyright (C) 2010, 2011 Free Software Foundation, Inc.
Contributed by David S. Miller (davem@davemloft.net)
This file is part of the GNU C Library.
Expand Down Expand Up @@ -33,9 +33,9 @@ ENTRY(memcpy)
1: add %o7, %o3, %o3
mov %o5, %o7
# endif
andcc %o0, 0x80, %g0 ! HWCAP_SPARC_N2
andcc %o0, HWCAP_SPARC_N2, %g0
be 1f
andcc %o0, 0x40, %g0 ! HWCAP_SPARC_BLKINIT
andcc %o0, HWCAP_SPARC_BLKINIT, %g0
# ifdef SHARED
sethi %gdop_hix22(__memcpy_niagara2), %o1
xor %o1, %gdop_lox10(__memcpy_niagara2), %o1
Expand All @@ -45,7 +45,7 @@ ENTRY(memcpy)
ba 10f
nop
1: be 1f
andcc %o0, 0x20, %g0 ! HWCAP_SPARC_ULTRA3
andcc %o0, HWCAP_SPARC_ULTRA3, %g0
# ifdef SHARED
sethi %gdop_hix22(__memcpy_niagara1), %o1
xor %o1, %gdop_lox10(__memcpy_niagara1), %o1
Expand Down
6 changes: 3 additions & 3 deletions sysdeps/sparc/sparc64/multiarch/memset.S
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Multiple versions of memset and bzero
Copyright (C) 2010 Free Software Foundation, Inc.
Copyright (C) 2010, 2011 Free Software Foundation, Inc.
Contributed by David S. Miller (davem@davemloft.net)
This file is part of the GNU C Library.
Expand Down Expand Up @@ -33,7 +33,7 @@ ENTRY(memset)
1: add %o7, %o3, %o3
mov %o5, %o7
# endif
andcc %o0, 0x40, %g0 ! HWCAP_SPARC_BLKINIT
andcc %o0, HWCAP_SPARC_BLKINIT, %g0
be 9f
nop
# ifdef SHARED
Expand Down Expand Up @@ -69,7 +69,7 @@ ENTRY(__bzero)
1: add %o7, %o3, %o3
mov %o5, %o7
# endif
andcc %o0, 0x40, %g0 ! HWCAP_SPARC_BLKINIT
andcc %o0, HWCAP_SPARC_BLKINIT, %g0
be 9f
nop
# ifdef SHARED
Expand Down
45 changes: 45 additions & 0 deletions sysdeps/sparc/sysdep.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/* Copyright (C) 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. */

/* Bits present in AT_HWCAP on SPARC. */

#define HWCAP_SPARC_FLUSH 0x00000001
#define HWCAP_SPARC_STBAR 0x00000002
#define HWCAP_SPARC_SWAP 0x00000004
#define HWCAP_SPARC_MULDIV 0x00000008
#define HWCAP_SPARC_V9 0x00000010
#define HWCAP_SPARC_ULTRA3 0x00000020
#define HWCAP_SPARC_BLKINIT 0x00000040
#define HWCAP_SPARC_N2 0x00000080
#define HWCAP_SPARC_MUL32 0x00000100
#define HWCAP_SPARC_DIV32 0x00000200
#define HWCAP_SPARC_FSMULD 0x00000400
#define HWCAP_SPARC_V8PLUS 0x00000800
#define HWCAP_SPARC_POPC 0x00001000
#define HWCAP_SPARC_VIS 0x00002000
#define HWCAP_SPARC_VIS2 0x00004000
#define HWCAP_SPARC_ASI_BLK_INIT 0x00008000
#define HWCAP_SPARC_FMAF 0x00010000
#define HWCAP_SPARC_VIS3 0x00020000
#define HWCAP_SPARC_HPC 0x00040000
#define HWCAP_SPARC_RANDOM 0x00080000
#define HWCAP_SPARC_TRANS 0x00100000
#define HWCAP_SPARC_FJFMAU 0x00200000
#define HWCAP_SPARC_IMA 0x00400000
#define HWCAP_SPARC_ASI_CACHE_SPARING \
0x00800000
24 changes: 23 additions & 1 deletion sysdeps/unix/sparc/sysdep.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* Copyright (C) 1993, 1994, 1995, 1997, 2003 Free Software Foundation, Inc.
/* Copyright (C) 1993, 1994, 1995, 1997, 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
Expand All @@ -17,6 +18,7 @@
02111-1307 USA. */

#include <sysdeps/unix/sysdep.h>
#include <sysdeps/sparc/sysdep.h>

#ifdef __ASSEMBLER__

Expand All @@ -27,6 +29,26 @@
#define syscall_error C_SYMBOL_NAME(__syscall_error)
#endif

#ifdef PIC
#define SETUP_PIC_REG(reg, tmp) \
.ifndef __sparc_get_pc_thunk.reg; \
.section .text.__sparc_get_pc_thunk.reg,"axG",@progbits,__sparc_get_pc_thunk.reg,comdat; \
.align 32; \
.weak __sparc_get_pc_thunk.reg; \
.hidden __sparc_get_pc_thunk.reg; \
.type __sparc_get_pc_thunk.reg, #function; \
__sparc_get_pc_thunk.reg: \
jmp %o7 + 8; \
add %o7, %reg, %##reg; \
.previous; \
.endif; \
sethi %hi(_GLOBAL_OFFSET_TABLE_-4), %##reg; \
mov %o7, %##tmp; \
call __sparc_get_pc_thunk.reg; \
or %##reg, %lo(_GLOBAL_OFFSET_TABLE_+4), %##reg; \
mov %##tmp, %o7;
#endif

#ifdef HAVE_ELF
#define ENTRY(name) \
.global C_SYMBOL_NAME(name); \
Expand Down
Loading

0 comments on commit 3b142ce

Please sign in to comment.