[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commits] r17998 - in /fsf/trunk/libc: ./ bits/ elf/ sysdeps/generic/ sysdeps/x86_64/bits/
- To: commits@xxxxxxxxxx
- Subject: [Commits] r17998 - in /fsf/trunk/libc: ./ bits/ elf/ sysdeps/generic/ sysdeps/x86_64/bits/
- From: eglibc@xxxxxxxxxx
- Date: Wed, 11 Apr 2012 00:03:10 -0000
Author: eglibc
Date: Wed Apr 11 00:03:07 2012
New Revision: 17998
Log:
Import glibc-mainline for 2012-04-11
Modified:
fsf/trunk/libc/ChangeLog
fsf/trunk/libc/bits/byteswap.h
fsf/trunk/libc/elf/Makefile
fsf/trunk/libc/elf/dl-load.c
fsf/trunk/libc/elf/dl-support.c
fsf/trunk/libc/elf/rtld.c
fsf/trunk/libc/sysdeps/generic/ldsodefs.h
fsf/trunk/libc/sysdeps/x86_64/bits/byteswap.h
Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Wed Apr 11 00:03:07 2012
@@ -1,3 +1,19 @@
+2012-04-10 H.J. Lu <hongjiu.lu@xxxxxxxxx>
+
+ * sysdeps/x86_64/bits/byteswap.h: Include <features.h>.
+ (__bswap_32): Use __builtin_bswap32 for GCC >= 4.2.
+ (__bswap_64): Use __builtin_bswap64 for GCC >= 4.2.
+
+2012-04-10 Siddhesh Poyarekar <siddhesh@xxxxxxxxxx>
+
+ * elf/dl-support.c (_dl_inhibit_cache): New variable.
+ * elf/rtld.c (_rtld_global_ro): New member _dl_inhibit_cache.
+ (dl_main): Handle --inhibit-cache.
+ * sysdeps/generic/ldsodefs.h (struct rtld_global_ro): New member
+ _dl_inhibit_cache.
+ * elf/dl-load.c (_dl_map_object): Use it.
+ * elf/Makefile: Define SYSCONFDIR when building rtld.c.
+
2012-04-09 Joseph Myers <joseph@xxxxxxxxxxxxxxxx>
[BZ #13872]
@@ -117,6 +133,12 @@
* elf/dynamic-link.h (_ELF_DYNAMIC_DO_RELOC): Simplify
conditions and remove no longer applicable assertion.
+
+2012-04-06 H.J. Lu <hongjiu.lu@xxxxxxxxx>
+
+ * bits/byteswap.h: Include <features.h>.
+ (__bswap_32): Use __builtin_bswap32 for GCC >= 4.2.
+ (__bswap_64): Use __builtin_bswap64 for GCC >= 4.2.
2012-04-06 H.J. Lu <hongjiu.lu@xxxxxxxxx>
Modified: fsf/trunk/libc/bits/byteswap.h
==============================================================================
--- fsf/trunk/libc/bits/byteswap.h (original)
+++ fsf/trunk/libc/bits/byteswap.h Wed Apr 11 00:03:07 2012
@@ -23,6 +23,8 @@
#ifndef _BITS_BYTESWAP_H
#define _BITS_BYTESWAP_H 1
+#include <features.h>
+
/* Swap bytes in 16 bit value. */
#define __bswap_constant_16(x) \
((((x) >> 8) & 0xffu) | (((x) & 0xffu) << 8))
@@ -36,9 +38,17 @@
(((x) & 0x0000ff00u) << 8) | (((x) & 0x000000ffu) << 24))
#ifdef __GNUC__
-# define __bswap_32(x) \
+# if __GNUC_PREREQ (4, 2)
+static __inline unsigned int
+__bswap_32 (unsigned int __bsx)
+{
+ return __builtin_bswap32 (__bsx);
+}
+# else
+# define __bswap_32(x) \
(__extension__ \
({ register unsigned int __bsx = (x); __bswap_constant_32 (__bsx); }))
+# endif
#else
static __inline unsigned int
__bswap_32 (unsigned int __bsx)
@@ -47,8 +57,8 @@
}
#endif
-#if defined __GNUC__ && __GNUC__ >= 2
/* Swap bytes in 64 bit value. */
+#if __GNUC_PREREQ (2, 0)
# define __bswap_constant_64(x) \
(__extension__ ((((x) & 0xff00000000000000ull) >> 56) \
| (((x) & 0x00ff000000000000ull) >> 40) \
@@ -59,7 +69,14 @@
| (((x) & 0x000000000000ff00ull) << 40) \
| (((x) & 0x00000000000000ffull) << 56)))
-# define __bswap_64(x) \
+# if __GNUC_PREREQ (4, 2)
+static __inline unsigned long long int
+__bswap_64 (unsigned long long int __bsx)
+{
+ return __builtin_bswap64 (__bsx);
+}
+# else
+# define __bswap_64(x) \
(__extension__ \
({ union { __extension__ unsigned long long int __ll; \
unsigned int __l[2]; } __w, __r; \
@@ -72,6 +89,7 @@
__r.__l[1] = __bswap_32 (__w.__l[0]); \
} \
__r.__ll; }))
+# endif
#elif __GLIBC_HAVE_LONG_LONG
# define __bswap_constant_64(x) \
((((x) & 0xff00000000000000ull) >> 56) \
Modified: fsf/trunk/libc/elf/Makefile
==============================================================================
--- fsf/trunk/libc/elf/Makefile (original)
+++ fsf/trunk/libc/elf/Makefile Wed Apr 11 00:03:07 2012
@@ -1,4 +1,4 @@
-# Copyright (C) 1995-2011, 2012 Free Software Foundation, Inc.
+# Copyright (C) 1995-2012 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
@@ -419,6 +419,7 @@
-D'SLIBDIR="$(slibdir)"' -DIS_IN_ldconfig=1
CFLAGS-dl-cache.c = $(SYSCONF-FLAGS)
CFLAGS-cache.c = $(SYSCONF-FLAGS)
+CFLAGS-rtld.c = $(SYSCONF-FLAGS)
CPPFLAGS-.os += $(if $(filter $(@F),$(patsubst %,%.os,$(all-rtld-routines))),-DNOT_IN_libc=1 -DIS_IN_rtld=1)
Modified: fsf/trunk/libc/elf/dl-load.c
==============================================================================
--- fsf/trunk/libc/elf/dl-load.c (original)
+++ fsf/trunk/libc/elf/dl-load.c Wed Apr 11 00:03:07 2012
@@ -1,5 +1,5 @@
/* Map in a shared object's segments from the file.
- Copyright (C) 1995-2007, 2009, 2010, 2011 Free Software Foundation, Inc.
+ Copyright (C) 1995-2012 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
@@ -2194,7 +2194,8 @@
if (fd == -1
&& (__builtin_expect (! (mode & __RTLD_SECURE), 1)
- || ! INTUSE(__libc_enable_secure)))
+ || ! INTUSE(__libc_enable_secure))
+ && __builtin_expect (GLRO(dl_inhibit_cache) == 0, 1))
{
/* Check the list of libraries in the file /etc/ld.so.cache,
for compatibility with Linux's ldconfig program. */
Modified: fsf/trunk/libc/elf/dl-support.c
==============================================================================
--- fsf/trunk/libc/elf/dl-support.c (original)
+++ fsf/trunk/libc/elf/dl-support.c Wed Apr 11 00:03:07 2012
@@ -1,5 +1,5 @@
/* Support for dynamic linking code in static libc.
- Copyright (C) 1996-2008,2009,2010,2011 Free Software Foundation, Inc.
+ Copyright (C) 1996-2012 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
@@ -107,6 +107,8 @@
size_t _dl_pagesize = EXEC_PAGESIZE;
+int _dl_inhibit_cache;
+
unsigned int _dl_osversion;
/* All known directories in sorted order. */
Modified: fsf/trunk/libc/elf/rtld.c
==============================================================================
--- fsf/trunk/libc/elf/rtld.c (original)
+++ fsf/trunk/libc/elf/rtld.c Wed Apr 11 00:03:07 2012
@@ -161,6 +161,7 @@
._dl_fpu_control = _FPU_DEFAULT,
._dl_pointer_guard = 1,
._dl_pagesize = EXEC_PAGESIZE,
+ ._dl_inhibit_cache = 0,
/* Function pointers. */
._dl_debug_printf = _dl_debug_printf,
@@ -973,6 +974,13 @@
--_dl_argc;
++INTUSE(_dl_argv);
}
+ else if (! strcmp (INTUSE(_dl_argv)[1], "--inhibit-cache"))
+ {
+ GLRO(dl_inhibit_cache) = 1;
+ ++_dl_skip_args;
+ --_dl_argc;
+ ++INTUSE(_dl_argv);
+ }
else if (! strcmp (INTUSE(_dl_argv)[1], "--library-path")
&& _dl_argc > 2)
{
@@ -1022,6 +1030,7 @@
--list list all dependencies and how they are resolved\n\
--verify verify that given object really is a dynamically linked\n\
object we can handle\n\
+ --inhibit-cache Do not use " LD_SO_CACHE "\n\
--library-path PATH use given PATH instead of content of the environment\n\
variable LD_LIBRARY_PATH\n\
--inhibit-rpath LIST ignore RUNPATH and RPATH information in object names\n\
Modified: fsf/trunk/libc/sysdeps/generic/ldsodefs.h
==============================================================================
--- fsf/trunk/libc/sysdeps/generic/ldsodefs.h (original)
+++ fsf/trunk/libc/sysdeps/generic/ldsodefs.h Wed Apr 11 00:03:07 2012
@@ -1,5 +1,5 @@
/* Run-time dynamic linker data structures for loaded ELF shared objects.
- Copyright (C) 1995-2009, 2010, 2011, 2012 Free Software Foundation, Inc.
+ Copyright (C) 1995-2012 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
@@ -560,6 +560,9 @@
/* Cached value of `getpagesize ()'. */
EXTERN size_t _dl_pagesize;
+ /* Do we read from ld.so.cache? */
+ EXTERN int _dl_inhibit_cache;
+
/* Copy of the content of `_dl_main_searchlist' at startup time. */
EXTERN struct r_scope_elem _dl_initial_searchlist;
Modified: fsf/trunk/libc/sysdeps/x86_64/bits/byteswap.h
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/bits/byteswap.h (original)
+++ fsf/trunk/libc/sysdeps/x86_64/bits/byteswap.h Wed Apr 11 00:03:07 2012
@@ -23,6 +23,7 @@
#ifndef _BITS_BYTESWAP_H
#define _BITS_BYTESWAP_H 1
+#include <features.h>
#include <bits/wordsize.h>
/* Swap bytes in 16 bit value. */
@@ -37,46 +38,60 @@
((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \
(((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))
-#if defined __GNUC__ && __GNUC__ >= 2
-# if __WORDSIZE == 64 || (defined __i486__ || defined __pentium__ \
- || defined __pentiumpro__ || defined __pentium4__ \
- || defined __k8__ || defined __athlon__ \
- || defined __k6__ || defined __nocona__ \
- || defined __core2__ || defined __geode__ \
- || defined __amdfam10__)
+#ifdef __GNUC__
+# if __GNUC_PREREQ (4, 2)
+static __inline unsigned int
+__bswap_32 (unsigned int __bsx)
+{
+ return __builtin_bswap32 (__bsx);
+}
+# elif __GNUC__ >= 2
+# if __WORDSIZE == 64 || (defined __i486__ || defined __pentium__ \
+ || defined __pentiumpro__ || defined __pentium4__ \
+ || defined __k8__ || defined __athlon__ \
+ || defined __k6__ || defined __nocona__ \
+ || defined __core2__ || defined __geode__ \
+ || defined __amdfam10__)
/* To swap the bytes in a word the i486 processors and up provide the
`bswap' opcode. On i386 we have to use three instructions. */
+# define __bswap_32(x) \
+ (__extension__ \
+ ({ register unsigned int __v, __x = (x); \
+ if (__builtin_constant_p (__x)) \
+ __v = __bswap_constant_32 (__x); \
+ else \
+ __asm__ ("bswap %0" : "=r" (__v) : "0" (__x)); \
+ __v; }))
+# else
+# define __bswap_32(x) \
+ (__extension__ \
+ ({ register unsigned int __v, __x = (x); \
+ if (__builtin_constant_p (__x)) \
+ __v = __bswap_constant_32 (__x); \
+ else \
+ __asm__ ("rorw $8, %w0;" \
+ "rorl $16, %0;" \
+ "rorw $8, %w0" \
+ : "=r" (__v) \
+ : "0" (__x) \
+ : "cc"); \
+ __v; }))
+# endif
+# else
# define __bswap_32(x) \
(__extension__ \
- ({ register unsigned int __v, __x = (x); \
- if (__builtin_constant_p (__x)) \
- __v = __bswap_constant_32 (__x); \
- else \
- __asm__ ("bswap %0" : "=r" (__v) : "0" (__x)); \
- __v; }))
-# else
-# define __bswap_32(x) \
- (__extension__ \
- ({ register unsigned int __v, __x = (x); \
- if (__builtin_constant_p (__x)) \
- __v = __bswap_constant_32 (__x); \
- else \
- __asm__ ("rorw $8, %w0;" \
- "rorl $16, %0;" \
- "rorw $8, %w0" \
- : "=r" (__v) \
- : "0" (__x) \
- : "cc"); \
- __v; }))
+ ({ register unsigned int __x = (x); __bswap_constant_32 (__x); }))
# endif
#else
-# define __bswap_32(x) \
- (__extension__ \
- ({ register unsigned int __x = (x); __bswap_constant_32 (__x); }))
+static __inline unsigned int
+__bswap_32 (unsigned int __bsx)
+{
+ return __bswap_constant_32 (__bsx);
+}
#endif
-#if defined __GNUC__ && __GNUC__ >= 2
+#if __GNUC_PREREQ (2, 0)
/* Swap bytes in 64 bit value. */
# define __bswap_constant_64(x) \
(__extension__ ((((x) & 0xff00000000000000ull) >> 56) \
@@ -88,7 +103,13 @@
| (((x) & 0x000000000000ff00ull) << 40) \
| (((x) & 0x00000000000000ffull) << 56)))
-# if __WORDSIZE == 64
+# if __GNUC_PREREQ (4, 2)
+static __inline unsigned long long int
+__bswap_64 (unsigned long long int __bsx)
+{
+ return __builtin_bswap64 (__bsx);
+}
+# elif __WORDSIZE == 64
# define __bswap_64(x) \
(__extension__ \
({ register unsigned long __v, __x = (x); \
_______________________________________________
Commits mailing list
Commits@xxxxxxxxxx
http://eglibc.org/cgi-bin/mailman/listinfo/commits