This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix build with compiler defining __i686 (bug 411)


This patch fixes bug 411, the decade-old problem that glibc can't be
built for x86 with a compiler configured with --with-arch=i686 (which
is the default for recent GCC versions built natively on an i686
system).

This is another case of controversy over whose responsibility
reserved-namespace symbols are, in this case regarding __i686.  __i686
clearly fits the pattern of other symbols predefined by the compiler
and it's unfortunate things became entrenched in an insistence that
glibc should not change.  (Until the change in GCC 4.7 that I refer to
below, any patch for this issue would have been small and simple, and
there were plenty of bug reports and patch proposals over the years.)

Recall that the issue is PIC thunks called __i686.get_pc_thunk.<reg>,
where <reg> is most often bx but sometimes cx.  These names are not
fixed as part of the ABI except to the extent that glibc is trying to
use the same names as GCC (for the functions and linkonce sections) so
that the linkonce machinery can most efficiently reduce them to a
single copy.

In GCC 4.7 the thunks now use an __x86 prefix (to avoid the problem
seen in initfini.c / pt-initfini.c, where GCC's output gets
preprocessed again).  So ideally glibc should use that prefix with
newer compilers - but with older ones should still use __i686 for
optimal results in both cases.  This patch wraps the thunk names in
macros to keep the difference between the two cases local to one file,
and uses the approach Jakub proposed in
<http://sourceware.org/ml/libc-alpha/2002-10/msg00157.html> of
undefining __i686 and redefining it to itself, which seems the safest
of the proposed approaches, to avoid problems with the macro expansion
when __i686 is used.  Because of the report in
<http://sourceware.org/ml/libc-alpha/2006-04/msg00100.html> that
including <sysdep.h> in the crt*.S generated files breaks other
targets, x86 versions of initfini.c and pt-initfini.c are created with
the #define/#undef sequences put in the output files, so other targets
are unaffected.  (Of course, if as recently suggested we move to
normal .S files for crt*.S, that particular complication will go
away.)

I used __GNUC_PREREQ to condition the choice of thunk names.  Although
a configure test could be used, I suspect a version number test is
more likely to be reliable in practice in the face of changes to
compiler output.

I suspect more macros like SETUP_PIC_REG could eliminate most of the
duplicate copies of these thunks in the various .S files, but I think
that's a separate cleanup.

Tested with both 4.6 and 4.7.

Presume that the final commit would also update the list in NEWS of
fixed bug numbers.

Comments?

2012-02-02  Joseph Myers  <joseph@codesourcery.com>

	[BZ #411]
	* sysdeps/i386/sysdep.h: Include <features.h>.
	(__i686): Undefine and redefine.
	(GET_PC_THUNK, GET_PC_THUNK_STR): Define.
	(SETUP_PIC_REG): Use GET_PC_THUNK.
	* sysdeps/i386/initfini.c: New.
	* sysdeps/i386/i686/memcmp.S: Use GET_PC_THUNK macro.
	* sysdeps/i386/i686/multiarch/bcopy.S: Likewise.
	* sysdeps/i386/i686/multiarch/bzero.S: Likewise.
	* sysdeps/i386/i686/multiarch/memchr.S: Likewise.
	* sysdeps/i386/i686/multiarch/memcmp-sse4.S: Likewise.
	* sysdeps/i386/i686/multiarch/memcmp.S: Likewise.
	* sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S: Likewise.
	* sysdeps/i386/i686/multiarch/memcpy-ssse3.S: Likewise.
	* sysdeps/i386/i686/multiarch/memcpy.S: Likewise.
	* sysdeps/i386/i686/multiarch/memcpy_chk.S: Likewise.
	* sysdeps/i386/i686/multiarch/memmove.S: Likewise.
	* sysdeps/i386/i686/multiarch/memmove_chk.S: Likewise.
	* sysdeps/i386/i686/multiarch/mempcpy.S: Likewise.
	* sysdeps/i386/i686/multiarch/mempcpy_chk.S: Likewise.
	* sysdeps/i386/i686/multiarch/memrchr.S: Likewise.
	* sysdeps/i386/i686/multiarch/memset-sse2-rep.S: Likewise.
	* sysdeps/i386/i686/multiarch/memset-sse2.S: Likewise.
	* sysdeps/i386/i686/multiarch/memset.S: Likewise.
	* sysdeps/i386/i686/multiarch/memset_chk.S: Likewise.
	* sysdeps/i386/i686/multiarch/rawmemchr.S: Likewise.
	* sysdeps/i386/i686/multiarch/strcasecmp.S: Likewise.
	* sysdeps/i386/i686/multiarch/strcat-sse2.S: Likewise.
	* sysdeps/i386/i686/multiarch/strcat.S: Likewise.
	* sysdeps/i386/i686/multiarch/strchr.S: Likewise.
	* sysdeps/i386/i686/multiarch/strcmp-sse4.S: Likewise.
	* sysdeps/i386/i686/multiarch/strcmp-ssse3.S: Likewise.
	* sysdeps/i386/i686/multiarch/strcmp.S: Likewise.
	* sysdeps/i386/i686/multiarch/strcpy-sse2.S: Likewise.
	* sysdeps/i386/i686/multiarch/strcpy.S: Likewise.
	* sysdeps/i386/i686/multiarch/strcspn.S: Likewise.
	* sysdeps/i386/i686/multiarch/strlen.S: Likewise.
	* sysdeps/i386/i686/multiarch/strncase.S: Likewise.
	* sysdeps/i386/i686/multiarch/strnlen.S: Likewise.
	* sysdeps/i386/i686/multiarch/strrchr.S: Likewise.
	* sysdeps/i386/i686/multiarch/strspn.S: Likewise.
	* sysdeps/i386/i686/multiarch/wcschr.S: Likewise.
	* sysdeps/i386/i686/multiarch/wcscmp.S: Likewise.
	* sysdeps/i386/i686/multiarch/wcscpy.S: Likewise.
	* sysdeps/i386/i686/multiarch/wcslen.S: Likewise.
	* sysdeps/i386/i686/multiarch/wcsrchr.S: Likewise.
	* sysdeps/i386/i686/multiarch/wmemcmp.S: Likewise.
	* sysdeps/unix/sysv/linux/i386/sysdep.h: Use GET_PC_THUNK_STR
	macro.

nptl:
2012-02-02  Joseph Myers  <joseph@codesourcery.com>

	[BZ #411]
	* sysdeps/unix/sysv/linux/i386/pt-initfini.c: New.
	* sysdeps/unix/sysv/linux/i386/i486/pthread_cond_wait.S: Use
	GET_PC_THUNK macro.
	* sysdeps/unix/sysv/linux/i386/i486/sem_post.S: Likewise.
	* sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S: Likewise.
	* sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S: Likewise.
	* sysdeps/unix/sysv/linux/i386/i486/sem_wait.S: Likewise.
	* sysdeps/unix/sysv/linux/i386/pthread_once.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 54590b7..b2a0349 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
@@ -1,4 +1,5 @@
-/* Copyright (C) 2002-2004,2006-2007,2009,2010 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2004,2006-2007,2009,2010,2012
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -650,14 +651,14 @@ __condvar_w_cleanup:
 .Lcstend:
 
 #ifdef PIC
-	.section .gnu.linkonce.t.__i686.get_pc_thunk.cx,"ax",@progbits
-	.globl	__i686.get_pc_thunk.cx
-	.hidden	__i686.get_pc_thunk.cx
-	.type	__i686.get_pc_thunk.cx,@function
-__i686.get_pc_thunk.cx:
+	.section .gnu.linkonce.t.GET_PC_THUNK(cx),"ax",@progbits
+	.globl	GET_PC_THUNK(cx)
+	.hidden	GET_PC_THUNK(cx)
+	.type	GET_PC_THUNK(cx),@function
+GET_PC_THUNK(cx):
 	movl (%esp), %ecx;
 	ret
-	.size	__i686.get_pc_thunk.cx,.-__i686.get_pc_thunk.cx
+	.size	GET_PC_THUNK(cx),.-GET_PC_THUNK(cx)
 #endif
 
 #ifdef SHARED
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_post.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_post.S
index 9f3e635..491838b 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_post.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_post.S
@@ -1,4 +1,5 @@
-/* Copyright (C) 2002,2003,2005,2007,2008,2011 Free Software Foundation, Inc.
+/* Copyright (C) 2002,2003,2005,2007,2008,2011-2012
+   Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -75,7 +76,7 @@ __new_sem_post:
 	cfi_offset(%ebx, -8)
 1:
 #ifdef PIC
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 #else
 	movl	$4f, %ebx
 4:
@@ -96,7 +97,7 @@ __new_sem_post:
 
 3:
 #ifdef PIC
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 #else
 	movl	$5f, %ebx
 5:
@@ -152,12 +153,12 @@ __old_sem_post:
 
 
 #ifdef PIC
-	.section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
-	.globl	__i686.get_pc_thunk.bx
-	.hidden	__i686.get_pc_thunk.bx
-	.type	__i686.get_pc_thunk.bx,@function
-__i686.get_pc_thunk.bx:
+	.section .gnu.linkonce.t.GET_PC_THUNK(bx),"ax",@progbits
+	.globl	GET_PC_THUNK(bx)
+	.hidden	GET_PC_THUNK(bx)
+	.type	GET_PC_THUNK(bx),@function
+GET_PC_THUNK(bx):
 	movl (%esp), %ebx;
 	ret
-	.size	__i686.get_pc_thunk.bx,.-__i686.get_pc_thunk.bx
+	.size	GET_PC_THUNK(bx),.-GET_PC_THUNK(bx)
 #endif
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S
index ee46ab9..680f59a 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_timedwait.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002-2005, 2007, 2009, 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2005, 2007, 2009, 2011-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -148,7 +148,7 @@ sem_timedwait:
 3:	negl	%esi
 6:
 #ifdef PIC
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 #else
 	movl	$4f, %ebx
 4:
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S
index 18adb9a..4b68817 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_trywait.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2005, 2007, 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2003, 2005, 2007, 2011-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -43,7 +43,7 @@ __new_sem_trywait:
 
 1:
 #ifdef PIC
-	call	__i686.get_pc_thunk.cx
+	call	GET_PC_THUNK(cx)
 #else
 	movl	$3f, %ecx
 3:
@@ -69,12 +69,12 @@ __old_sem_trywait = __new_sem_trywait
 
 
 #ifdef PIC
-	.section .gnu.linkonce.t.__i686.get_pc_thunk.cx,"ax",@progbits
-	.globl	__i686.get_pc_thunk.cx
-	.hidden	__i686.get_pc_thunk.cx
-	.type	__i686.get_pc_thunk.cx,@function
-__i686.get_pc_thunk.cx:
+	.section .gnu.linkonce.t.GET_PC_THUNK(cx),"ax",@progbits
+	.globl	GET_PC_THUNK(cx)
+	.hidden	GET_PC_THUNK(cx)
+	.type	GET_PC_THUNK(cx),@function
+GET_PC_THUNK(cx):
 	movl (%esp), %ecx;
 	ret
-	.size	__i686.get_pc_thunk.cx,.-__i686.get_pc_thunk.cx
+	.size	GET_PC_THUNK(cx),.-GET_PC_THUNK(cx)
 #endif
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_wait.S b/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_wait.S
index fb8a398..480d413 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_wait.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/i486/sem_wait.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2005, 2007, 2011 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2003, 2005, 2007, 2011-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -108,7 +108,7 @@ __new_sem_wait:
 
 	negl	%esi
 #ifdef PIC
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 #else
 	movl	$8f, %ebx
 8:
@@ -322,7 +322,7 @@ __old_sem_wait:
 	je	3b
 	negl	%esi
 #ifdef PIC
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 #else
 	movl	$4f, %ebx
 4:
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/pt-initfini.c b/nptl/sysdeps/unix/sysv/linux/i386/pt-initfini.c
new file mode 100644
index 0000000..b9e17c5
--- /dev/null
+++ b/nptl/sysdeps/unix/sysv/linux/i386/pt-initfini.c
@@ -0,0 +1,131 @@
+/* Special .init and .fini section support.  NPTL Linux/i386 version.
+   Copyright (C) 1995-1997,2000-2002,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 modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2 of the License, or (at your option) any later version.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file with other
+   programs, and to distribute those programs without any restriction
+   coming from the use of this file.  (The Library General Public
+   License restrictions do apply in other respects; for example, they
+   cover modification of the file, and distribution when not linked
+   into another program.)
+
+   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; see the file COPYING.LIB.  If not,
+   write to the Free Software Foundation, 59 Temple Place - Suite 330,
+   Boston, MA 02111-1307, USA.  */
+
+/* This file is compiled into assembly code which is then munged by a sed
+   script into two files: crti.s and crtn.s.
+
+   * crti.s puts a function prologue at the beginning of the
+   .init and .fini sections and defines global symbols for
+   those addresses, so they can be called as functions.
+
+   * crtn.s puts the corresponding function epilogues
+   in the .init and .fini sections. */
+
+#include <stdlib.h>
+
+/* We use embedded asm for .section unconditionally, as this makes it
+   easier to insert the necessary directives into crtn.S. */
+#define SECTION(x) asm (".section " x )
+
+/* Embed an #include to pull in the alignment and .end directives. */
+asm ("\n#include \"defs.h\"");
+
+/* See sysdeps/i386/sysdep.h.  */
+asm ("\n#ifdef __i686\n\
+#undef __i686\n\
+#define __i686 __i686\n\
+#endif");
+
+/* The initial common code ends here. */
+asm ("\n/*@HEADER_ENDS*/");
+
+/* To determine whether we need .end and .align: */
+asm ("\n/*@TESTS_BEGIN*/");
+extern void dummy (void (*foo) (void));
+void
+dummy (void (*foo) (void))
+{
+  if (foo)
+    (*foo) ();
+}
+asm ("\n/*@TESTS_END*/");
+
+/* The beginning of _init:  */
+asm ("\n/*@_init_PROLOG_BEGINS*/");
+
+static void
+call_initialize_minimal (void)
+{
+  extern void __pthread_initialize_minimal_internal (void)
+    __attribute ((visibility ("hidden")));
+
+  __pthread_initialize_minimal_internal ();
+}
+
+SECTION (".init");
+extern void __attribute__ ((section (".init"))) _init (void);
+void
+_init (void)
+{
+  /* The very first thing we must do is to set up the registers.  */
+  call_initialize_minimal ();
+
+  asm ("ALIGN");
+  asm("END_INIT");
+  /* Now the epilog. */
+  asm ("\n/*@_init_PROLOG_ENDS*/");
+  asm ("\n/*@_init_EPILOG_BEGINS*/");
+  SECTION(".init");
+}
+asm ("END_INIT");
+
+/* End of the _init epilog, beginning of the _fini prolog. */
+asm ("\n/*@_init_EPILOG_ENDS*/");
+asm ("\n/*@_fini_PROLOG_BEGINS*/");
+
+SECTION (".fini");
+extern void __attribute__ ((section (".fini"))) _fini (void);
+void
+_fini (void)
+{
+
+  /* End of the _fini prolog. */
+  asm ("ALIGN");
+  asm ("END_FINI");
+  asm ("\n/*@_fini_PROLOG_ENDS*/");
+
+  {
+    /* Let GCC know that _fini is not a leaf function by having a dummy
+       function call here.  We arrange for this call to be omitted from
+       either crt file.  */
+    extern void i_am_not_a_leaf (void);
+    i_am_not_a_leaf ();
+  }
+
+  /* Beginning of the _fini epilog. */
+  asm ("\n/*@_fini_EPILOG_BEGINS*/");
+  SECTION (".fini");
+}
+asm ("END_FINI");
+
+/* End of the _fini epilog.  Any further generated assembly (e.g. .ident)
+   is shared between both crt files. */
+asm ("\n/*@_fini_EPILOG_ENDS*/");
+asm ("\n/*@TRAILER_BEGINS*/");
+
+/* End of file. */
diff --git a/nptl/sysdeps/unix/sysv/linux/i386/pthread_once.S b/nptl/sysdeps/unix/sysv/linux/i386/pthread_once.S
index f31d968..94a1d3b 100644
--- a/nptl/sysdeps/unix/sysv/linux/i386/pthread_once.S
+++ b/nptl/sysdeps/unix/sysv/linux/i386/pthread_once.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2007 Free Software Foundation, Inc.
+/* Copyright (C) 2002, 2003, 2007, 2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -52,7 +52,7 @@ __pthread_once:
 	   Get the fork generation counter now.  */
 6:	movl	(%ebx), %eax
 #ifdef PIC
-	call	__i686.get_pc_thunk.cx
+	call	GET_PC_THUNK(cx)
 	addl	$_GLOBAL_OFFSET_TABLE_, %ecx
 #endif
 
@@ -184,12 +184,12 @@ pthread_once = __pthread_once
 
 
 #ifdef PIC
-	.section .gnu.linkonce.t.__i686.get_pc_thunk.cx,"ax",@progbits
-	.globl	__i686.get_pc_thunk.cx
-	.hidden	__i686.get_pc_thunk.cx
-	.type	__i686.get_pc_thunk.cx,@function
-__i686.get_pc_thunk.cx:
+	.section .gnu.linkonce.t.GET_PC_THUNK(cx),"ax",@progbits
+	.globl	GET_PC_THUNK(cx)
+	.hidden	GET_PC_THUNK(cx)
+	.type	GET_PC_THUNK(cx),@function
+GET_PC_THUNK(cx):
 	movl (%esp), %ecx;
 	ret
-	.size	__i686.get_pc_thunk.cx,.-__i686.get_pc_thunk.cx
+	.size	GET_PC_THUNK(cx),.-GET_PC_THUNK(cx)
 #endif
diff --git a/sysdeps/i386/i686/memcmp.S b/sysdeps/i386/i686/memcmp.S
index 24f6804..e802a73 100644
--- a/sysdeps/i386/i686/memcmp.S
+++ b/sysdeps/i386/i686/memcmp.S
@@ -1,5 +1,5 @@
 /* Compare two memory blocks for differences in the first COUNT bytes.
-   Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005, 2006, 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
@@ -36,19 +36,19 @@
    into the jump table.  */
 #define LOAD_JUMP_TABLE_ENTRY(TABLE, INDEX) \
   /* We first load PC into EBX.  */					      \
-  call	__i686.get_pc_thunk.bx;						      \
+  call	GET_PC_THUNK(bx);						      \
   /* Get the address of the jump table.  */				      \
   addl	$(TABLE - .), %ebx;						      \
   /* Get the entry and convert the relative offset to the		      \
      absolute address.  */						      \
   addl	(%ebx,INDEX,4), %ebx
 
-	.section	.gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
-	.globl	__i686.get_pc_thunk.bx
-	.hidden	__i686.get_pc_thunk.bx
+	.section	.gnu.linkonce.t.GET_PC_THUNK(bx),"ax",@progbits
+	.globl	GET_PC_THUNK(bx)
+	.hidden	GET_PC_THUNK(bx)
 	ALIGN (4)
-	.type	__i686.get_pc_thunk.bx,@function
-__i686.get_pc_thunk.bx:
+	.type	GET_PC_THUNK(bx),@function
+GET_PC_THUNK(bx):
 	movl	(%esp), %ebx
 	ret
 
diff --git a/sysdeps/i386/i686/multiarch/bcopy.S b/sysdeps/i386/i686/multiarch/bcopy.S
index 8671bf6..3d006c7 100644
--- a/sysdeps/i386/i686/multiarch/bcopy.S
+++ b/sysdeps/i386/i686/multiarch/bcopy.S
@@ -1,5 +1,5 @@
 /* Multiple versions of bcopy
-   Copyright (C) 2010 Free Software Foundation, Inc.
+   Copyright (C) 2010, 2012 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    This file is part of the GNU C Library.
 
@@ -24,12 +24,12 @@
 /* Define multiple versions only for the definition in lib.  */
 #ifndef NOT_IN_libc
 # ifdef SHARED
-	.section	.gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
-	.globl	__i686.get_pc_thunk.bx
-	.hidden	__i686.get_pc_thunk.bx
+	.section	.gnu.linkonce.t.GET_PC_THUNK(bx),"ax",@progbits
+	.globl	GET_PC_THUNK(bx)
+	.hidden	GET_PC_THUNK(bx)
 	.p2align 4
-	.type	__i686.get_pc_thunk.bx,@function
-__i686.get_pc_thunk.bx:
+	.type	GET_PC_THUNK(bx),@function
+GET_PC_THUNK(bx):
 	movl	(%esp), %ebx
 	ret
 
@@ -39,7 +39,7 @@ ENTRY(bcopy)
 	pushl	%ebx
 	cfi_adjust_cfa_offset (4)
 	cfi_rel_offset (ebx, 0)
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
 	cmpl	$0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
 	jne	1f
diff --git a/sysdeps/i386/i686/multiarch/bzero.S b/sysdeps/i386/i686/multiarch/bzero.S
index 8c740a4..af4dd50 100644
--- a/sysdeps/i386/i686/multiarch/bzero.S
+++ b/sysdeps/i386/i686/multiarch/bzero.S
@@ -1,5 +1,5 @@
 /* Multiple versions of bzero
-   Copyright (C) 2010 Free Software Foundation, Inc.
+   Copyright (C) 2010, 2012 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    This file is part of the GNU C Library.
 
@@ -24,12 +24,12 @@
 /* Define multiple versions only for the definition in lib.  */
 #ifndef NOT_IN_libc
 # ifdef SHARED
-	.section	.gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
-	.globl	__i686.get_pc_thunk.bx
-	.hidden	__i686.get_pc_thunk.bx
+	.section	.gnu.linkonce.t.GET_PC_THUNK(bx),"ax",@progbits
+	.globl	GET_PC_THUNK(bx)
+	.hidden	GET_PC_THUNK(bx)
 	.p2align 4
-	.type	__i686.get_pc_thunk.bx,@function
-__i686.get_pc_thunk.bx:
+	.type	GET_PC_THUNK(bx),@function
+GET_PC_THUNK(bx):
 	movl	(%esp), %ebx
 	ret
 
@@ -39,7 +39,7 @@ ENTRY(__bzero)
 	pushl	%ebx
 	cfi_adjust_cfa_offset (4)
 	cfi_rel_offset (ebx, 0)
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
 	cmpl	$0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
 	jne	1f
diff --git a/sysdeps/i386/i686/multiarch/memchr.S b/sysdeps/i386/i686/multiarch/memchr.S
index 163a83e..06fe736 100644
--- a/sysdeps/i386/i686/multiarch/memchr.S
+++ b/sysdeps/i386/i686/multiarch/memchr.S
@@ -1,5 +1,5 @@
 /* Multiple versions of memchr
-   Copyright (C) 2011 Free Software Foundation, Inc.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    This file is part of the GNU C Library.
 
@@ -22,12 +22,12 @@
 #include <init-arch.h>
 
 #ifndef  NOT_IN_libc
-	.section	.gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
-	.globl	__i686.get_pc_thunk.bx
-	.hidden	__i686.get_pc_thunk.bx
+	.section	.gnu.linkonce.t.GET_PC_THUNK(bx),"ax",@progbits
+	.globl	GET_PC_THUNK(bx)
+	.hidden	GET_PC_THUNK(bx)
 	.p2align 4
-	.type	__i686.get_pc_thunk.bx,@function
-__i686.get_pc_thunk.bx:
+	.type	GET_PC_THUNK(bx),@function
+GET_PC_THUNK(bx):
 	movl	(%esp), %ebx
 	ret
 
@@ -44,7 +44,7 @@ ENTRY(__memchr)
 	.type	__memchr, @gnu_indirect_function
 	pushl	%ebx
 	CFI_PUSH (%ebx)
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
 	cmpl	$0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
 	jne	1f
diff --git a/sysdeps/i386/i686/multiarch/memcmp-sse4.S b/sysdeps/i386/i686/multiarch/memcmp-sse4.S
index 1f5dbc1..5439245 100644
--- a/sysdeps/i386/i686/multiarch/memcmp-sse4.S
+++ b/sysdeps/i386/i686/multiarch/memcmp-sse4.S
@@ -1,5 +1,5 @@
 /* memcmp with SSE4.2, wmemcmp with SSE4.2
-   Copyright (C) 2010, 2011 Free Software Foundation, Inc.
+   Copyright (C) 2010-2012 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    This file is part of the GNU C Library.
 
@@ -53,7 +53,7 @@
 
 #  define BRANCH_TO_JMPTBL_ENTRY(TABLE, INDEX, SCALE)	\
 /* We first load PC into EBX.  */	\
-	call	__i686.get_pc_thunk.bx;	\
+	call	GET_PC_THUNK(bx);	\
 /* Get the address of the jump table.  */	\
 	addl	$(TABLE - .), %ebx;	\
 /* Get the entry and convert the relative offset to the	\
diff --git a/sysdeps/i386/i686/multiarch/memcmp.S b/sysdeps/i386/i686/multiarch/memcmp.S
index cf606a5..2d2b6f1 100644
--- a/sysdeps/i386/i686/multiarch/memcmp.S
+++ b/sysdeps/i386/i686/multiarch/memcmp.S
@@ -1,5 +1,5 @@
 /* Multiple versions of memcmp
-   Copyright (C) 2010 Free Software Foundation, Inc.
+   Copyright (C) 2010, 2012 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    This file is part of the GNU C Library.
 
@@ -30,7 +30,7 @@ ENTRY(memcmp)
 	pushl	%ebx
 	cfi_adjust_cfa_offset (4)
 	cfi_rel_offset (ebx, 0)
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
 	cmpl	$0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
 	jne	1f
diff --git a/sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S b/sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S
index 8e81183..7d74607 100644
--- a/sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S
+++ b/sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S
@@ -1,5 +1,5 @@
 /* memcpy with SSSE3 and REP string.
-   Copyright (C) 2010 Free Software Foundation, Inc.
+   Copyright (C) 2010, 2012 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    This file is part of the GNU C Library.
 
@@ -65,7 +65,7 @@
    index into the jump table.   SCALE is the scale of INDEX. */
 # define BRANCH_TO_JMPTBL_ENTRY(TABLE, INDEX, SCALE)		\
     /* We first load PC into EBX.  */				\
-    call	__i686.get_pc_thunk.bx;				\
+    call	GET_PC_THUNK(bx);				\
     /* Get the address of the jump table.  */			\
     addl	$(TABLE - .), %ebx;				\
     /* Get the entry and convert the relative offset to the	\
@@ -82,12 +82,12 @@
     /* We loaded the jump table.  Go.  */			\
     jmp		*%ebx
 
-	.section	.gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
-	.globl	__i686.get_pc_thunk.bx
-	.hidden	__i686.get_pc_thunk.bx
+	.section	.gnu.linkonce.t.GET_PC_THUNK(bx),"ax",@progbits
+	.globl	GET_PC_THUNK(bx)
+	.hidden	GET_PC_THUNK(bx)
 	ALIGN (4)
-	.type	__i686.get_pc_thunk.bx,@function
-__i686.get_pc_thunk.bx:
+	.type	GET_PC_THUNK(bx),@function
+GET_PC_THUNK(bx):
 	movl	(%esp), %ebx
 	ret
 #else
@@ -171,7 +171,7 @@ L(48bytesormore):
 	cmp	$SHARED_CACHE_SIZE_HALF, %ecx
 #else
 # ifdef SHARED
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	add	$_GLOBAL_OFFSET_TABLE_, %ebx
 	cmp	__x86_shared_cache_size_half@GOTOFF(%ebx), %ecx
 # else
@@ -241,7 +241,7 @@ L(shl_0_gobble):
 	cmp	$DATA_CACHE_SIZE_HALF, %ecx
 #else
 # ifdef SHARED
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	add	$_GLOBAL_OFFSET_TABLE_, %ebx
 	mov	__x86_data_cache_size_half@GOTOFF(%ebx), %edi
 # else
diff --git a/sysdeps/i386/i686/multiarch/memcpy-ssse3.S b/sysdeps/i386/i686/multiarch/memcpy-ssse3.S
index 26471fc..25e90d5 100644
--- a/sysdeps/i386/i686/multiarch/memcpy-ssse3.S
+++ b/sysdeps/i386/i686/multiarch/memcpy-ssse3.S
@@ -1,5 +1,5 @@
 /* memcpy with SSSE3
-   Copyright (C) 2010, 2011 Free Software Foundation, Inc.
+   Copyright (C) 2010-2012 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    This file is part of the GNU C Library.
 
@@ -65,7 +65,7 @@
    index into the jump table.   SCALE is the scale of INDEX. */
 # define BRANCH_TO_JMPTBL_ENTRY(TABLE, INDEX, SCALE)		\
     /* We first load PC into EBX.  */				\
-    call	__i686.get_pc_thunk.bx;				\
+    call	GET_PC_THUNK(bx);				\
     /* Get the address of the jump table.  */			\
     addl	$(TABLE - .), %ebx;				\
     /* Get the entry and convert the relative offset to the	\
@@ -82,12 +82,12 @@
     /* We loaded the jump table.  Go.  */			\
     jmp		*%ebx
 
-	.section	.gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
-	.globl	__i686.get_pc_thunk.bx
-	.hidden	__i686.get_pc_thunk.bx
+	.section	.gnu.linkonce.t.GET_PC_THUNK(bx),"ax",@progbits
+	.globl	GET_PC_THUNK(bx)
+	.hidden	GET_PC_THUNK(bx)
 	ALIGN (4)
-	.type	__i686.get_pc_thunk.bx,@function
-__i686.get_pc_thunk.bx:
+	.type	GET_PC_THUNK(bx),@function
+GET_PC_THUNK(bx):
 	movl	(%esp), %ebx
 	ret
 #else
@@ -173,7 +173,7 @@ L(48bytesormore):
 	cmp	$SHARED_CACHE_SIZE_HALF, %ecx
 #else
 # ifdef SHARED
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	add	$_GLOBAL_OFFSET_TABLE_, %ebx
 	cmp	__x86_shared_cache_size_half@GOTOFF(%ebx), %ecx
 # else
@@ -244,7 +244,7 @@ L(shl_0_gobble):
 	cmp	$DATA_CACHE_SIZE_HALF, %ecx
 #else
 # ifdef SHARED
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	add	$_GLOBAL_OFFSET_TABLE_, %ebx
 	cmp	__x86_data_cache_size_half@GOTOFF(%ebx), %ecx
 # else
diff --git a/sysdeps/i386/i686/multiarch/memcpy.S b/sysdeps/i386/i686/multiarch/memcpy.S
index bf1c7cc..01ae350 100644
--- a/sysdeps/i386/i686/multiarch/memcpy.S
+++ b/sysdeps/i386/i686/multiarch/memcpy.S
@@ -1,5 +1,5 @@
 /* Multiple versions of memcpy
-   Copyright (C) 2010 Free Software Foundation, Inc.
+   Copyright (C) 2010, 2012 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    This file is part of the GNU C Library.
 
@@ -25,12 +25,12 @@
    DSO.  In static binaries we need memcpy before the initialization
    happened.  */
 #if defined SHARED && !defined NOT_IN_libc
-	.section	.gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
-	.globl	__i686.get_pc_thunk.bx
-	.hidden	__i686.get_pc_thunk.bx
+	.section	.gnu.linkonce.t.GET_PC_THUNK(bx),"ax",@progbits
+	.globl	GET_PC_THUNK(bx)
+	.hidden	GET_PC_THUNK(bx)
 	.p2align 4
-	.type	__i686.get_pc_thunk.bx,@function
-__i686.get_pc_thunk.bx:
+	.type	GET_PC_THUNK(bx),@function
+GET_PC_THUNK(bx):
 	movl	(%esp), %ebx
 	ret
 
@@ -40,7 +40,7 @@ ENTRY(memcpy)
 	pushl	%ebx
 	cfi_adjust_cfa_offset (4)
 	cfi_rel_offset (ebx, 0)
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
 	cmpl	$0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
 	jne	1f
diff --git a/sysdeps/i386/i686/multiarch/memcpy_chk.S b/sysdeps/i386/i686/multiarch/memcpy_chk.S
index 171ac8a..723cfc9 100644
--- a/sysdeps/i386/i686/multiarch/memcpy_chk.S
+++ b/sysdeps/i386/i686/multiarch/memcpy_chk.S
@@ -1,5 +1,5 @@
 /* Multiple versions of __memcpy_chk
-   Copyright (C) 2010 Free Software Foundation, Inc.
+   Copyright (C) 2010, 2012 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    This file is part of the GNU C Library.
 
@@ -26,12 +26,12 @@
  */
 #ifndef NOT_IN_libc
 # ifdef SHARED
-	.section	.gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
-	.globl	__i686.get_pc_thunk.bx
-	.hidden	__i686.get_pc_thunk.bx
+	.section	.gnu.linkonce.t.GET_PC_THUNK(bx),"ax",@progbits
+	.globl	GET_PC_THUNK(bx)
+	.hidden	GET_PC_THUNK(bx)
 	.p2align 4
-	.type	__i686.get_pc_thunk.bx,@function
-__i686.get_pc_thunk.bx:
+	.type	GET_PC_THUNK(bx),@function
+GET_PC_THUNK(bx):
 	movl	(%esp), %ebx
 	ret
 
@@ -41,7 +41,7 @@ ENTRY(__memcpy_chk)
 	pushl	%ebx
 	cfi_adjust_cfa_offset (4)
 	cfi_rel_offset (ebx, 0)
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
 	cmpl	$0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
 	jne	1f
diff --git a/sysdeps/i386/i686/multiarch/memmove.S b/sysdeps/i386/i686/multiarch/memmove.S
index e0529c0..1257f37 100644
--- a/sysdeps/i386/i686/multiarch/memmove.S
+++ b/sysdeps/i386/i686/multiarch/memmove.S
@@ -1,5 +1,5 @@
 /* Multiple versions of memmove
-   Copyright (C) 2010 Free Software Foundation, Inc.
+   Copyright (C) 2010, 2012 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    This file is part of the GNU C Library.
 
@@ -24,12 +24,12 @@
 /* Define multiple versions only for the definition in lib.  */
 #ifndef NOT_IN_libc
 # ifdef SHARED
-	.section	.gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
-	.globl	__i686.get_pc_thunk.bx
-	.hidden	__i686.get_pc_thunk.bx
+	.section	.gnu.linkonce.t.GET_PC_THUNK(bx),"ax",@progbits
+	.globl	GET_PC_THUNK(bx)
+	.hidden	GET_PC_THUNK(bx)
 	.p2align 4
-	.type	__i686.get_pc_thunk.bx,@function
-__i686.get_pc_thunk.bx:
+	.type	GET_PC_THUNK(bx),@function
+GET_PC_THUNK(bx):
 	movl	(%esp), %ebx
 	ret
 
@@ -39,7 +39,7 @@ ENTRY(memmove)
 	pushl	%ebx
 	cfi_adjust_cfa_offset (4)
 	cfi_rel_offset (ebx, 0)
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
 	cmpl	$0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
 	jne	1f
diff --git a/sysdeps/i386/i686/multiarch/memmove_chk.S b/sysdeps/i386/i686/multiarch/memmove_chk.S
index e33f2a3..2a253de 100644
--- a/sysdeps/i386/i686/multiarch/memmove_chk.S
+++ b/sysdeps/i386/i686/multiarch/memmove_chk.S
@@ -1,5 +1,5 @@
 /* Multiple versions of __memmove_chk
-   Copyright (C) 2010 Free Software Foundation, Inc.
+   Copyright (C) 2010, 2012 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    This file is part of the GNU C Library.
 
@@ -24,12 +24,12 @@
 /* Define multiple versions only for the definition in lib.  */
 #ifndef NOT_IN_libc
 # ifdef SHARED
-	.section	.gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
-	.globl	__i686.get_pc_thunk.bx
-	.hidden	__i686.get_pc_thunk.bx
+	.section	.gnu.linkonce.t.GET_PC_THUNK(bx),"ax",@progbits
+	.globl	GET_PC_THUNK(bx)
+	.hidden	GET_PC_THUNK(bx)
 	.p2align 4
-	.type	__i686.get_pc_thunk.bx,@function
-__i686.get_pc_thunk.bx:
+	.type	GET_PC_THUNK(bx),@function
+GET_PC_THUNK(bx):
 	movl	(%esp), %ebx
 	ret
 
@@ -39,7 +39,7 @@ ENTRY(__memmove_chk)
 	pushl	%ebx
 	cfi_adjust_cfa_offset (4)
 	cfi_rel_offset (ebx, 0)
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
 	cmpl	$0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
 	jne	1f
diff --git a/sysdeps/i386/i686/multiarch/mempcpy.S b/sysdeps/i386/i686/multiarch/mempcpy.S
index df830d2..b4d9378 100644
--- a/sysdeps/i386/i686/multiarch/mempcpy.S
+++ b/sysdeps/i386/i686/multiarch/mempcpy.S
@@ -1,5 +1,5 @@
 /* Multiple versions of mempcpy
-   Copyright (C) 2010 Free Software Foundation, Inc.
+   Copyright (C) 2010, 2012 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    This file is part of the GNU C Library.
 
@@ -25,12 +25,12 @@
    DSO.  In static binaries we need mempcpy before the initialization
    happened.  */
 #if defined SHARED && !defined NOT_IN_libc
-	.section	.gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
-	.globl	__i686.get_pc_thunk.bx
-	.hidden	__i686.get_pc_thunk.bx
+	.section	.gnu.linkonce.t.GET_PC_THUNK(bx),"ax",@progbits
+	.globl	GET_PC_THUNK(bx)
+	.hidden	GET_PC_THUNK(bx)
 	.p2align 4
-	.type	__i686.get_pc_thunk.bx,@function
-__i686.get_pc_thunk.bx:
+	.type	GET_PC_THUNK(bx),@function
+GET_PC_THUNK(bx):
 	movl	(%esp), %ebx
 	ret
 
@@ -40,7 +40,7 @@ ENTRY(__mempcpy)
 	pushl	%ebx
 	cfi_adjust_cfa_offset (4)
 	cfi_rel_offset (ebx, 0)
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
 	cmpl	$0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
 	jne	1f
diff --git a/sysdeps/i386/i686/multiarch/mempcpy_chk.S b/sysdeps/i386/i686/multiarch/mempcpy_chk.S
index 828fb5e..f32a8b5 100644
--- a/sysdeps/i386/i686/multiarch/mempcpy_chk.S
+++ b/sysdeps/i386/i686/multiarch/mempcpy_chk.S
@@ -1,5 +1,5 @@
 /* Multiple versions of __mempcpy_chk
-   Copyright (C) 2010 Free Software Foundation, Inc.
+   Copyright (C) 2010, 2012 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    This file is part of the GNU C Library.
 
@@ -26,12 +26,12 @@
  */
 #ifndef NOT_IN_libc
 # ifdef SHARED
-	.section	.gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
-	.globl	__i686.get_pc_thunk.bx
-	.hidden	__i686.get_pc_thunk.bx
+	.section	.gnu.linkonce.t.GET_PC_THUNK(bx),"ax",@progbits
+	.globl	GET_PC_THUNK(bx)
+	.hidden	GET_PC_THUNK(bx)
 	.p2align 4
-	.type	__i686.get_pc_thunk.bx,@function
-__i686.get_pc_thunk.bx:
+	.type	GET_PC_THUNK(bx),@function
+GET_PC_THUNK(bx):
 	movl	(%esp), %ebx
 	ret
 
@@ -41,7 +41,7 @@ ENTRY(__mempcpy_chk)
 	pushl	%ebx
 	cfi_adjust_cfa_offset (4)
 	cfi_rel_offset (ebx, 0)
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
 	cmpl	$0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
 	jne	1f
diff --git a/sysdeps/i386/i686/multiarch/memrchr.S b/sysdeps/i386/i686/multiarch/memrchr.S
index 8e5b2c5..c3b8a2b 100644
--- a/sysdeps/i386/i686/multiarch/memrchr.S
+++ b/sysdeps/i386/i686/multiarch/memrchr.S
@@ -1,5 +1,5 @@
 /* Multiple versions of memrchr
-   Copyright (C) 2011 Free Software Foundation, Inc.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    This file is part of the GNU C Library.
 
@@ -22,12 +22,12 @@
 #include <init-arch.h>
 
 #ifndef  NOT_IN_libc
-	.section	.gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
-	.globl	__i686.get_pc_thunk.bx
-	.hidden	__i686.get_pc_thunk.bx
+	.section	.gnu.linkonce.t.GET_PC_THUNK(bx),"ax",@progbits
+	.globl	GET_PC_THUNK(bx)
+	.hidden	GET_PC_THUNK(bx)
 	.p2align 4
-	.type	__i686.get_pc_thunk.bx,@function
-__i686.get_pc_thunk.bx:
+	.type	GET_PC_THUNK(bx),@function
+GET_PC_THUNK(bx):
 	movl	(%esp), %ebx
 	ret
 
@@ -44,7 +44,7 @@ ENTRY(__memrchr)
 	.type	__memrchr, @gnu_indirect_function
 	pushl	%ebx
 	CFI_PUSH (%ebx)
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
 	cmpl	$0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
 	jne	1f
diff --git a/sysdeps/i386/i686/multiarch/memset-sse2-rep.S b/sysdeps/i386/i686/multiarch/memset-sse2-rep.S
index f9a0b13..d2b3002 100644
--- a/sysdeps/i386/i686/multiarch/memset-sse2-rep.S
+++ b/sysdeps/i386/i686/multiarch/memset-sse2-rep.S
@@ -1,5 +1,5 @@
 /* memset with SSE2 and REP string.
-   Copyright (C) 2010 Free Software Foundation, Inc.
+   Copyright (C) 2010, 2012 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    This file is part of the GNU C Library.
 
@@ -56,7 +56,7 @@
    jump table with relative offsets.   */
 # define BRANCH_TO_JMPTBL_ENTRY(TABLE)				\
     /* We first load PC into EBX.  */				\
-    call	__i686.get_pc_thunk.bx;				\
+    call	GET_PC_THUNK(bx);				\
     /* Get the address of the jump table.  */			\
     add		$(TABLE - .), %ebx;				\
     /* Get the entry and convert the relative offset to the	\
@@ -66,12 +66,12 @@
     /* We loaded the jump table and adjuested EDX. Go.  */	\
     jmp		*%ebx
 
-	.section	.gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
-	.globl	__i686.get_pc_thunk.bx
-	.hidden	__i686.get_pc_thunk.bx
+	.section	.gnu.linkonce.t.GET_PC_THUNK(bx),"ax",@progbits
+	.globl	GET_PC_THUNK(bx)
+	.hidden	GET_PC_THUNK(bx)
 	ALIGN (4)
-	.type	__i686.get_pc_thunk.bx,@function
-__i686.get_pc_thunk.bx:
+	.type	GET_PC_THUNK(bx),@function
+GET_PC_THUNK(bx):
 	movl	(%esp), %ebx
 	ret
 #else
@@ -273,7 +273,7 @@ L(128bytesormore):
 	mov	$DATA_CACHE_SIZE, %ebx
 #else
 # ifdef SHARED
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	add	$_GLOBAL_OFFSET_TABLE_, %ebx
 	mov	__x86_data_cache_size@GOTOFF(%ebx), %ebx
 # else
diff --git a/sysdeps/i386/i686/multiarch/memset-sse2.S b/sysdeps/i386/i686/multiarch/memset-sse2.S
index 92ad601..82a9455 100644
--- a/sysdeps/i386/i686/multiarch/memset-sse2.S
+++ b/sysdeps/i386/i686/multiarch/memset-sse2.S
@@ -1,5 +1,5 @@
 /* memset with SSE2
-   Copyright (C) 2010 Free Software Foundation, Inc.
+   Copyright (C) 2010, 2012 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    This file is part of the GNU C Library.
 
@@ -56,7 +56,7 @@
    jump table with relative offsets.   */
 # define BRANCH_TO_JMPTBL_ENTRY(TABLE)				\
     /* We first load PC into EBX.  */				\
-    call	__i686.get_pc_thunk.bx;				\
+    call	GET_PC_THUNK(bx);				\
     /* Get the address of the jump table.  */			\
     add		$(TABLE - .), %ebx;				\
     /* Get the entry and convert the relative offset to the	\
@@ -66,12 +66,12 @@
     /* We loaded the jump table and adjuested EDX. Go.  */	\
     jmp		*%ebx
 
-	.section	.gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
-	.globl	__i686.get_pc_thunk.bx
-	.hidden	__i686.get_pc_thunk.bx
+	.section	.gnu.linkonce.t.GET_PC_THUNK(bx),"ax",@progbits
+	.globl	GET_PC_THUNK(bx)
+	.hidden	GET_PC_THUNK(bx)
 	ALIGN (4)
-	.type	__i686.get_pc_thunk.bx,@function
-__i686.get_pc_thunk.bx:
+	.type	GET_PC_THUNK(bx),@function
+GET_PC_THUNK(bx):
 	movl	(%esp), %ebx
 	ret
 #else
@@ -272,7 +272,7 @@ L(128bytesormore):
 	mov	$SHARED_CACHE_SIZE, %ebx
 #else
 # ifdef SHARED
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	add	$_GLOBAL_OFFSET_TABLE_, %ebx
 	mov	__x86_shared_cache_size@GOTOFF(%ebx), %ebx
 # else
@@ -291,7 +291,7 @@ L(128bytesormore):
 #else
 # ifdef SHARED
 #  define RESTORE_EBX_STATE
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	add	$_GLOBAL_OFFSET_TABLE_, %ebx
 	cmp	__x86_data_cache_size@GOTOFF(%ebx), %ecx
 # else
diff --git a/sysdeps/i386/i686/multiarch/memset.S b/sysdeps/i386/i686/multiarch/memset.S
index 34dddce..4142529 100644
--- a/sysdeps/i386/i686/multiarch/memset.S
+++ b/sysdeps/i386/i686/multiarch/memset.S
@@ -1,5 +1,5 @@
 /* Multiple versions of memset
-   Copyright (C) 2010 Free Software Foundation, Inc.
+   Copyright (C) 2010, 2012 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    This file is part of the GNU C Library.
 
@@ -24,12 +24,12 @@
 /* Define multiple versions only for the definition in lib.  */
 #ifndef NOT_IN_libc
 # ifdef SHARED
-	.section	.gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
-	.globl	__i686.get_pc_thunk.bx
-	.hidden	__i686.get_pc_thunk.bx
+	.section	.gnu.linkonce.t.GET_PC_THUNK(bx),"ax",@progbits
+	.globl	GET_PC_THUNK(bx)
+	.hidden	GET_PC_THUNK(bx)
 	.p2align 4
-	.type	__i686.get_pc_thunk.bx,@function
-__i686.get_pc_thunk.bx:
+	.type	GET_PC_THUNK(bx),@function
+GET_PC_THUNK(bx):
 	movl	(%esp), %ebx
 	ret
 
@@ -39,7 +39,7 @@ ENTRY(memset)
 	pushl	%ebx
 	cfi_adjust_cfa_offset (4)
 	cfi_rel_offset (ebx, 0)
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
 	cmpl	$0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
 	jne	1f
diff --git a/sysdeps/i386/i686/multiarch/memset_chk.S b/sysdeps/i386/i686/multiarch/memset_chk.S
index d659c7e..12888c9 100644
--- a/sysdeps/i386/i686/multiarch/memset_chk.S
+++ b/sysdeps/i386/i686/multiarch/memset_chk.S
@@ -1,5 +1,5 @@
 /* Multiple versions of __memset_chk
-   Copyright (C) 2010 Free Software Foundation, Inc.
+   Copyright (C) 2010, 2012 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    This file is part of the GNU C Library.
 
@@ -24,12 +24,12 @@
 /* Define multiple versions only for the definition in lib.  */
 #ifndef NOT_IN_libc
 # ifdef SHARED
-	.section	.gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
-	.globl	__i686.get_pc_thunk.bx
-	.hidden	__i686.get_pc_thunk.bx
+	.section	.gnu.linkonce.t.GET_PC_THUNK(bx),"ax",@progbits
+	.globl	GET_PC_THUNK(bx)
+	.hidden	GET_PC_THUNK(bx)
 	.p2align 4
-	.type	__i686.get_pc_thunk.bx,@function
-__i686.get_pc_thunk.bx:
+	.type	GET_PC_THUNK(bx),@function
+GET_PC_THUNK(bx):
 	movl	(%esp), %ebx
 	ret
 
@@ -39,7 +39,7 @@ ENTRY(__memset_chk)
 	pushl	%ebx
 	cfi_adjust_cfa_offset (4)
 	cfi_rel_offset (ebx, 0)
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
 	cmpl	$0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
 	jne	1f
diff --git a/sysdeps/i386/i686/multiarch/rawmemchr.S b/sysdeps/i386/i686/multiarch/rawmemchr.S
index 111f0dc..21c28a9 100644
--- a/sysdeps/i386/i686/multiarch/rawmemchr.S
+++ b/sysdeps/i386/i686/multiarch/rawmemchr.S
@@ -1,5 +1,5 @@
 /* Multiple versions of rawmemchr
-   Copyright (C) 2011 Free Software Foundation, Inc.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    This file is part of the GNU C Library.
 
@@ -22,12 +22,12 @@
 #include <init-arch.h>
 
 #ifndef  NOT_IN_libc
-	.section	.gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
-	.globl	__i686.get_pc_thunk.bx
-	.hidden	__i686.get_pc_thunk.bx
+	.section	.gnu.linkonce.t.GET_PC_THUNK(bx),"ax",@progbits
+	.globl	GET_PC_THUNK(bx)
+	.hidden	GET_PC_THUNK(bx)
 	.p2align 4
-	.type	__i686.get_pc_thunk.bx,@function
-__i686.get_pc_thunk.bx:
+	.type	GET_PC_THUNK(bx),@function
+GET_PC_THUNK(bx):
 	movl	(%esp), %ebx
 	ret
 
@@ -44,7 +44,7 @@ ENTRY(__rawmemchr)
 	.type	__rawmemchr, @gnu_indirect_function
 	pushl	%ebx
 	CFI_PUSH (%ebx)
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
 	cmpl	$0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
 	jne	1f
diff --git a/sysdeps/i386/i686/multiarch/strcasecmp.S b/sysdeps/i386/i686/multiarch/strcasecmp.S
index 97603d8..2daaa16 100644
--- a/sysdeps/i386/i686/multiarch/strcasecmp.S
+++ b/sysdeps/i386/i686/multiarch/strcasecmp.S
@@ -1,5 +1,5 @@
 /* Entry point for multi-version x86 strcasecmp.
-   Copyright (C) 2011 Free Software Foundation, Inc.
+   Copyright (C) 2011-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
@@ -27,7 +27,7 @@ ENTRY(__strcasecmp)
 	pushl	%ebx
 	cfi_adjust_cfa_offset (4)
 	cfi_rel_offset (ebx, 0)
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
 	cmpl	$0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
 	jne	1f
diff --git a/sysdeps/i386/i686/multiarch/strcat-sse2.S b/sysdeps/i386/i686/multiarch/strcat-sse2.S
index b692036..21209b4 100644
--- a/sysdeps/i386/i686/multiarch/strcat-sse2.S
+++ b/sysdeps/i386/i686/multiarch/strcat-sse2.S
@@ -1,5 +1,5 @@
 /* strcat with SSE2
-   Copyright (C) 2011 Free Software Foundation, Inc.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    This file is part of the GNU C Library.
 
@@ -44,7 +44,7 @@
 
 #  define BRANCH_TO_JMPTBL_ENTRY(TABLE, INDEX, SCALE)	\
 	/* We first load PC into ECX.  */	\
-	call	__i686.get_pc_thunk.cx;	\
+	call	GET_PC_THUNK(cx);	\
 	/* Get the address of the jump table.  */	\
 	addl	$(TABLE - .), %ecx;	\
 	/* Get the entry and convert the relative offset to the	\
diff --git a/sysdeps/i386/i686/multiarch/strcat.S b/sysdeps/i386/i686/multiarch/strcat.S
index 14d4f91..2f9c6b6 100644
--- a/sysdeps/i386/i686/multiarch/strcat.S
+++ b/sysdeps/i386/i686/multiarch/strcat.S
@@ -1,5 +1,5 @@
 /* Multiple versions of strcat
-   Copyright (C) 2011 Free Software Foundation, Inc.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    This file is part of the GNU C Library.
 
@@ -46,12 +46,12 @@
 #ifndef NOT_IN_libc
 
 # ifdef SHARED
-	.section	.gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
-	.globl	__i686.get_pc_thunk.bx
-	.hidden	__i686.get_pc_thunk.bx
+	.section	.gnu.linkonce.t.GET_PC_THUNK(bx),"ax",@progbits
+	.globl	GET_PC_THUNK(bx)
+	.hidden	GET_PC_THUNK(bx)
 	.p2align 4
-	.type	__i686.get_pc_thunk.bx,@function
-__i686.get_pc_thunk.bx:
+	.type	GET_PC_THUNK(bx),@function
+GET_PC_THUNK(bx):
 	movl	(%esp), %ebx
 	ret
 
@@ -61,7 +61,7 @@ ENTRY(STRCAT)
 	pushl	%ebx
 	cfi_adjust_cfa_offset (4)
 	cfi_rel_offset (ebx, 0)
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
 	cmpl	$0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
 	jne	1f
diff --git a/sysdeps/i386/i686/multiarch/strchr.S b/sysdeps/i386/i686/multiarch/strchr.S
index aed967c..27a1252 100644
--- a/sysdeps/i386/i686/multiarch/strchr.S
+++ b/sysdeps/i386/i686/multiarch/strchr.S
@@ -1,5 +1,5 @@
 /* Multiple versions of strchr
-   Copyright (C) 2011 Free Software Foundation, Inc.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    This file is part of the GNU C Library.
 
@@ -22,12 +22,12 @@
 #include <init-arch.h>
 
 #ifndef NOT_IN_libc
-	.section	.gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
-	.globl	__i686.get_pc_thunk.bx
-	.hidden	__i686.get_pc_thunk.bx
+	.section	.gnu.linkonce.t.GET_PC_THUNK(bx),"ax",@progbits
+	.globl	GET_PC_THUNK(bx)
+	.hidden	GET_PC_THUNK(bx)
 	.p2align 4
-	.type	__i686.get_pc_thunk.bx,@function
-__i686.get_pc_thunk.bx:
+	.type	GET_PC_THUNK(bx),@function
+GET_PC_THUNK(bx):
 	movl	(%esp), %ebx
 	ret
 
@@ -37,7 +37,7 @@ ENTRY(strchr)
 	pushl	%ebx
 	cfi_adjust_cfa_offset (4)
 	cfi_rel_offset (ebx, 0)
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
 	cmpl	$0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
 	jne	1f
diff --git a/sysdeps/i386/i686/multiarch/strcmp-sse4.S b/sysdeps/i386/i686/multiarch/strcmp-sse4.S
index c9e0317..132dd50 100644
--- a/sysdeps/i386/i686/multiarch/strcmp-sse4.S
+++ b/sysdeps/i386/i686/multiarch/strcmp-sse4.S
@@ -1,5 +1,5 @@
 /* strcmp with SSE4.2
-   Copyright (C) 2010, 2011 Free Software Foundation, Inc.
+   Copyright (C) 2010-2012 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    This file is part of the GNU C Library.
 
@@ -100,7 +100,7 @@
 ENTRY (__strcasecmp_sse4_2)
 # ifdef PIC
 	PUSH	(%ebx)
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
 	movl	__libc_tsd_LOCALE@GOTNTPOFF(%ebx), %eax
 #  ifdef NO_TLS_DIRECT_SEG_REFS
@@ -132,7 +132,7 @@ END (__strcasecmp_sse4_2)
 ENTRY (__strncasecmp_sse4_2)
 # ifdef PIC
 	PUSH	(%ebx)
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
 	movl	__libc_tsd_LOCALE@GOTNTPOFF(%ebx), %eax
 #  ifdef NO_TLS_DIRECT_SEG_REFS
@@ -173,7 +173,7 @@ END (__strncasecmp_sse4_2)
 
 # ifdef PIC
 	PUSH	(%ebx)
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
 # endif
 L(ascii):
diff --git a/sysdeps/i386/i686/multiarch/strcmp-ssse3.S b/sysdeps/i386/i686/multiarch/strcmp-ssse3.S
index cbba465..fcf2059 100644
--- a/sysdeps/i386/i686/multiarch/strcmp-ssse3.S
+++ b/sysdeps/i386/i686/multiarch/strcmp-ssse3.S
@@ -1,5 +1,5 @@
 /* strcmp with SSSE3
-   Copyright (C) 2010, 2011 Free Software Foundation, Inc.
+   Copyright (C) 2010-2012 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    This file is part of the GNU C Library.
 
@@ -117,7 +117,7 @@
 ENTRY (__strcasecmp_ssse3)
 # ifdef PIC
 	PUSH	(%ebx)
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
 	movl	__libc_tsd_LOCALE@GOTNTPOFF(%ebx), %eax
 #  ifdef NO_TLS_DIRECT_SEG_REFS
@@ -149,7 +149,7 @@ END (__strcasecmp_ssse3)
 ENTRY (__strncasecmp_ssse3)
 # ifdef PIC
 	PUSH	(%ebx)
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
 	movl	__libc_tsd_LOCALE@GOTNTPOFF(%ebx), %eax
 #  ifdef NO_TLS_DIRECT_SEG_REFS
@@ -190,7 +190,7 @@ ENTRY (STRCMP)
 
 # ifdef PIC
 	PUSH	(%ebx)
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
 # endif
 L(ascii):
diff --git a/sysdeps/i386/i686/multiarch/strcmp.S b/sysdeps/i386/i686/multiarch/strcmp.S
index 28e2d61..2d58491 100644
--- a/sysdeps/i386/i686/multiarch/strcmp.S
+++ b/sysdeps/i386/i686/multiarch/strcmp.S
@@ -1,5 +1,5 @@
 /* Multiple versions of strcmp
-   Copyright (C) 2010, 2011 Free Software Foundation, Inc.
+   Copyright (C) 2010-2012 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    This file is part of the GNU C Library.
 
@@ -52,12 +52,12 @@
    need strncmp before the initialization happened.  */
 #if (defined SHARED || !defined USE_AS_STRNCMP) && !defined NOT_IN_libc
 # ifdef SHARED
-	.section	.gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
-	.globl	__i686.get_pc_thunk.bx
-	.hidden	__i686.get_pc_thunk.bx
+	.section	.gnu.linkonce.t.GET_PC_THUNK(bx),"ax",@progbits
+	.globl	GET_PC_THUNK(bx)
+	.hidden	GET_PC_THUNK(bx)
 	.p2align 4
-	.type	__i686.get_pc_thunk.bx,@function
-__i686.get_pc_thunk.bx:
+	.type	GET_PC_THUNK(bx),@function
+GET_PC_THUNK(bx):
 	movl	(%esp), %ebx
 	ret
 
@@ -67,7 +67,7 @@ ENTRY(STRCMP)
 	pushl	%ebx
 	cfi_adjust_cfa_offset (4)
 	cfi_rel_offset (ebx, 0)
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
 	cmpl	$0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
 	jne	1f
diff --git a/sysdeps/i386/i686/multiarch/strcpy-sse2.S b/sysdeps/i386/i686/multiarch/strcpy-sse2.S
index fcef748..641de40 100644
--- a/sysdeps/i386/i686/multiarch/strcpy-sse2.S
+++ b/sysdeps/i386/i686/multiarch/strcpy-sse2.S
@@ -1,5 +1,5 @@
 /* strcpy with SSE2 and unaligned load
-   Copyright (C) 2011 Free Software Foundation, Inc.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    This file is part of the GNU C Library.
 
@@ -59,7 +59,7 @@
 
 #  define BRANCH_TO_JMPTBL_ENTRY(TABLE, INDEX, SCALE)            \
 	/* We first load PC into ECX.  */                       \
-	call	__i686.get_pc_thunk.cx;                         \
+	call	GET_PC_THUNK(cx);                               \
 	/* Get the address of the jump table.  */               \
 	addl	$(TABLE - .), %ecx;                             \
 	/* Get the entry and convert the relative offset to the \
diff --git a/sysdeps/i386/i686/multiarch/strcpy.S b/sysdeps/i386/i686/multiarch/strcpy.S
index d025a4f..4567329 100644
--- a/sysdeps/i386/i686/multiarch/strcpy.S
+++ b/sysdeps/i386/i686/multiarch/strcpy.S
@@ -1,5 +1,5 @@
 /* Multiple versions of strcpy
-   Copyright (C) 2011 Free Software Foundation, Inc.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    This file is part of the GNU C Library.
 
@@ -62,12 +62,12 @@
 #ifndef NOT_IN_libc
 
 # ifdef SHARED
-	.section	.gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
-	.globl	__i686.get_pc_thunk.bx
-	.hidden	__i686.get_pc_thunk.bx
+	.section	.gnu.linkonce.t.GET_PC_THUNK(bx),"ax",@progbits
+	.globl	GET_PC_THUNK(bx)
+	.hidden	GET_PC_THUNK(bx)
 	.p2align 4
-	.type	__i686.get_pc_thunk.bx,@function
-__i686.get_pc_thunk.bx:
+	.type	GET_PC_THUNK(bx),@function
+GET_PC_THUNK(bx):
 	movl	(%esp), %ebx
 	ret
 
@@ -77,7 +77,7 @@ ENTRY(STRCPY)
 	pushl	%ebx
 	cfi_adjust_cfa_offset (4)
 	cfi_rel_offset (ebx, 0)
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
 	cmpl	$0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
 	jne	1f
diff --git a/sysdeps/i386/i686/multiarch/strcspn.S b/sysdeps/i386/i686/multiarch/strcspn.S
index b2310e4..3d8fe67 100644
--- a/sysdeps/i386/i686/multiarch/strcspn.S
+++ b/sysdeps/i386/i686/multiarch/strcspn.S
@@ -1,5 +1,5 @@
 /* Multiple versions of strcspn
-   Copyright (C) 2009 Free Software Foundation, Inc.
+   Copyright (C) 2009, 2012 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    This file is part of the GNU C Library.
 
@@ -43,12 +43,12 @@
    need strpbrk before the initialization happened.  */
 #if (defined SHARED || !defined USE_AS_STRPBRK) && !defined NOT_IN_libc
 # ifdef SHARED
-	.section	.gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
-	.globl	__i686.get_pc_thunk.bx
-	.hidden	__i686.get_pc_thunk.bx
+	.section	.gnu.linkonce.t.GET_PC_THUNK(bx),"ax",@progbits
+	.globl	GET_PC_THUNK(bx)
+	.hidden	GET_PC_THUNK(bx)
 	.p2align 4
-	.type	__i686.get_pc_thunk.bx,@function
-__i686.get_pc_thunk.bx:
+	.type	GET_PC_THUNK(bx),@function
+GET_PC_THUNK(bx):
 	movl	(%esp), %ebx
 	ret
 
@@ -58,7 +58,7 @@ ENTRY(STRCSPN)
 	pushl	%ebx
 	cfi_adjust_cfa_offset (4)
 	cfi_rel_offset (ebx, 0)
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
 	cmpl	$0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
 	jne	1f
diff --git a/sysdeps/i386/i686/multiarch/strlen.S b/sysdeps/i386/i686/multiarch/strlen.S
index 9d465c8..f631f10 100644
--- a/sysdeps/i386/i686/multiarch/strlen.S
+++ b/sysdeps/i386/i686/multiarch/strlen.S
@@ -1,5 +1,5 @@
 /* Multiple versions of strlen
-   Copyright (C) 2009, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2009, 2010, 2012 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    This file is part of the GNU C Library.
 
@@ -25,12 +25,12 @@
    DSO.  In static binaries, we need strlen before the initialization
    happened.  */
 #if defined SHARED && !defined NOT_IN_libc
-	.section	.gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
-	.globl	__i686.get_pc_thunk.bx
-	.hidden	__i686.get_pc_thunk.bx
+	.section	.gnu.linkonce.t.GET_PC_THUNK(bx),"ax",@progbits
+	.globl	GET_PC_THUNK(bx)
+	.hidden	GET_PC_THUNK(bx)
 	.p2align 4
-	.type	__i686.get_pc_thunk.bx,@function
-__i686.get_pc_thunk.bx:
+	.type	GET_PC_THUNK(bx),@function
+GET_PC_THUNK(bx):
 	movl	(%esp), %ebx
 	ret
 
@@ -40,7 +40,7 @@ ENTRY(strlen)
 	pushl	%ebx
 	cfi_adjust_cfa_offset (4)
 	cfi_rel_offset (ebx, 0)
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
 	cmpl	$0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
 	jne	1f
diff --git a/sysdeps/i386/i686/multiarch/strncase.S b/sysdeps/i386/i686/multiarch/strncase.S
index d20532f..7ed92fa 100644
--- a/sysdeps/i386/i686/multiarch/strncase.S
+++ b/sysdeps/i386/i686/multiarch/strncase.S
@@ -1,5 +1,5 @@
 /* Entry point for multi-version x86 strncasecmp.
-   Copyright (C) 2011 Free Software Foundation, Inc.
+   Copyright (C) 2011-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
@@ -27,7 +27,7 @@ ENTRY(__strncasecmp)
 	pushl	%ebx
 	cfi_adjust_cfa_offset (4)
 	cfi_rel_offset (ebx, 0)
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
 	cmpl	$0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
 	jne	1f
diff --git a/sysdeps/i386/i686/multiarch/strnlen.S b/sysdeps/i386/i686/multiarch/strnlen.S
index 7e542d9..26c7c47 100644
--- a/sysdeps/i386/i686/multiarch/strnlen.S
+++ b/sysdeps/i386/i686/multiarch/strnlen.S
@@ -1,5 +1,5 @@
 /* Multiple versions of strnlen
-   Copyright (C) 2011 Free Software Foundation, Inc.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    This file is part of the GNU C Library.
 
@@ -22,12 +22,12 @@
 #include <init-arch.h>
 
 #ifndef  NOT_IN_libc
-	.section	.gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
-	.globl	__i686.get_pc_thunk.bx
-	.hidden	__i686.get_pc_thunk.bx
+	.section	.gnu.linkonce.t.GET_PC_THUNK(bx),"ax",@progbits
+	.globl	GET_PC_THUNK(bx)
+	.hidden	GET_PC_THUNK(bx)
 	.p2align 4
-	.type	__i686.get_pc_thunk.bx,@function
-__i686.get_pc_thunk.bx:
+	.type	GET_PC_THUNK(bx),@function
+GET_PC_THUNK(bx):
 	movl	(%esp), %ebx
 	ret
 
@@ -37,7 +37,7 @@ ENTRY(__strnlen)
 	pushl	%ebx
 	cfi_adjust_cfa_offset (4)
 	cfi_rel_offset (ebx, 0)
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
 	cmpl	$0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
 	jne	1f
diff --git a/sysdeps/i386/i686/multiarch/strrchr.S b/sysdeps/i386/i686/multiarch/strrchr.S
index 866cac0..6e44032 100644
--- a/sysdeps/i386/i686/multiarch/strrchr.S
+++ b/sysdeps/i386/i686/multiarch/strrchr.S
@@ -1,5 +1,5 @@
 /* Multiple versions of strrchr
-   Copyright (C) 2011 Free Software Foundation, Inc.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    This file is part of the GNU C Library.
 
@@ -22,12 +22,12 @@
 #include <init-arch.h>
 
 #ifndef NOT_IN_libc
-	.section	.gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
-	.globl	__i686.get_pc_thunk.bx
-	.hidden	__i686.get_pc_thunk.bx
+	.section	.gnu.linkonce.t.GET_PC_THUNK(bx),"ax",@progbits
+	.globl	GET_PC_THUNK(bx)
+	.hidden	GET_PC_THUNK(bx)
 	.p2align 4
-	.type	__i686.get_pc_thunk.bx,@function
-__i686.get_pc_thunk.bx:
+	.type	GET_PC_THUNK(bx),@function
+GET_PC_THUNK(bx):
 	movl	(%esp), %ebx
 	ret
 
@@ -37,7 +37,7 @@ ENTRY(strrchr)
 	pushl	%ebx
 	cfi_adjust_cfa_offset (4)
 	cfi_rel_offset (ebx, 0)
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
 	cmpl	$0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
 	jne	1f
diff --git a/sysdeps/i386/i686/multiarch/strspn.S b/sysdeps/i386/i686/multiarch/strspn.S
index cd26c80..52047a5 100644
--- a/sysdeps/i386/i686/multiarch/strspn.S
+++ b/sysdeps/i386/i686/multiarch/strspn.S
@@ -1,5 +1,5 @@
 /* Multiple versions of strspn
-   Copyright (C) 2009,2010 Free Software Foundation, Inc.
+   Copyright (C) 2009,2010,2012 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    This file is part of the GNU C Library.
 
@@ -28,12 +28,12 @@
 /* Define multiple versions only for the definition in libc.  */
 #ifndef NOT_IN_libc
 # ifdef SHARED
-	.section	.gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
-	.globl	__i686.get_pc_thunk.bx
-	.hidden	__i686.get_pc_thunk.bx
+	.section	.gnu.linkonce.t.GET_PC_THUNK(bx),"ax",@progbits
+	.globl	GET_PC_THUNK(bx)
+	.hidden	GET_PC_THUNK(bx)
 	.p2align 4
-	.type	__i686.get_pc_thunk.bx,@function
-__i686.get_pc_thunk.bx:
+	.type	GET_PC_THUNK(bx),@function
+GET_PC_THUNK(bx):
 	movl	(%esp), %ebx
 	ret
 
@@ -43,7 +43,7 @@ ENTRY(strspn)
 	pushl	%ebx
 	cfi_adjust_cfa_offset (4)
 	cfi_rel_offset (ebx, 0)
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
 	cmpl	$0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
 	jne	1f
diff --git a/sysdeps/i386/i686/multiarch/wcschr.S b/sysdeps/i386/i686/multiarch/wcschr.S
index bf0d6d5..0e6ee5c 100644
--- a/sysdeps/i386/i686/multiarch/wcschr.S
+++ b/sysdeps/i386/i686/multiarch/wcschr.S
@@ -1,5 +1,5 @@
 /* Multiple versions of wcschr
-   Copyright (C) 2011 Free Software Foundation, Inc.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    This file is part of the GNU C Library.
 
@@ -22,12 +22,12 @@
 #include <init-arch.h>
 
 #ifndef NOT_IN_libc
-	.section	.gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
-	.globl	__i686.get_pc_thunk.bx
-	.hidden	__i686.get_pc_thunk.bx
+	.section	.gnu.linkonce.t.GET_PC_THUNK(bx),"ax",@progbits
+	.globl	GET_PC_THUNK(bx)
+	.hidden	GET_PC_THUNK(bx)
 	.p2align 4
-	.type	__i686.get_pc_thunk.bx,@function
-__i686.get_pc_thunk.bx:
+	.type	GET_PC_THUNK(bx),@function
+GET_PC_THUNK(bx):
 	movl	(%esp), %ebx
 	ret
 
@@ -37,7 +37,7 @@ ENTRY(wcschr)
 	pushl	%ebx
 	cfi_adjust_cfa_offset (4)
 	cfi_rel_offset (ebx, 0)
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
 	cmpl	$0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
 	jne	1f
diff --git a/sysdeps/i386/i686/multiarch/wcscmp.S b/sysdeps/i386/i686/multiarch/wcscmp.S
index c1657ad..f8f8c31 100644
--- a/sysdeps/i386/i686/multiarch/wcscmp.S
+++ b/sysdeps/i386/i686/multiarch/wcscmp.S
@@ -1,5 +1,5 @@
 /* Multiple versions of wcscmp
-   Copyright (C) 2011 Free Software Foundation, Inc.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    This file is part of the GNU C Library.
 
@@ -25,12 +25,12 @@
    DSO.  In static binaries, we need wcscmp before the initialization
    happened.  */
 #ifndef  NOT_IN_libc
-	.section	.gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
-	.globl	__i686.get_pc_thunk.bx
-	.hidden	__i686.get_pc_thunk.bx
+	.section	.gnu.linkonce.t.GET_PC_THUNK(bx),"ax",@progbits
+	.globl	GET_PC_THUNK(bx)
+	.hidden	GET_PC_THUNK(bx)
 	.p2align 4
-	.type	__i686.get_pc_thunk.bx,@function
-__i686.get_pc_thunk.bx:
+	.type	GET_PC_THUNK(bx),@function
+GET_PC_THUNK(bx):
 	movl	(%esp), %ebx
 	ret
 
@@ -40,7 +40,7 @@ ENTRY(wcscmp)
 	pushl	%ebx
 	cfi_adjust_cfa_offset (4)
 	cfi_rel_offset (ebx, 0)
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
 	cmpl	$0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
 	jne	1f
diff --git a/sysdeps/i386/i686/multiarch/wcscpy.S b/sysdeps/i386/i686/multiarch/wcscpy.S
index c7bafbe..2774ea3 100644
--- a/sysdeps/i386/i686/multiarch/wcscpy.S
+++ b/sysdeps/i386/i686/multiarch/wcscpy.S
@@ -1,5 +1,5 @@
 /* Multiple versions of wcscpy
-   Copyright (C) 2011 Free Software Foundation, Inc.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    This file is part of the GNU C Library.
 
@@ -29,7 +29,7 @@ ENTRY(wcscpy)
 	pushl	%ebx
 	cfi_adjust_cfa_offset (4)
 	cfi_rel_offset (ebx, 0)
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
 	cmpl	$0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
 	jne	1f
diff --git a/sysdeps/i386/i686/multiarch/wcslen.S b/sysdeps/i386/i686/multiarch/wcslen.S
index 5867037..4c689ed 100644
--- a/sysdeps/i386/i686/multiarch/wcslen.S
+++ b/sysdeps/i386/i686/multiarch/wcslen.S
@@ -1,5 +1,5 @@
 /* Multiple versions of wcslen
-   Copyright (C) 2011 Free Software Foundation, Inc.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    This file is part of the GNU C Library.
 
@@ -22,12 +22,12 @@
 #include <init-arch.h>
 
 #ifndef  NOT_IN_libc
-	.section	.gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
-	.globl	__i686.get_pc_thunk.bx
-	.hidden	__i686.get_pc_thunk.bx
+	.section	.gnu.linkonce.t.GET_PC_THUNK(bx),"ax",@progbits
+	.globl	GET_PC_THUNK(bx)
+	.hidden	GET_PC_THUNK(bx)
 	.p2align 4
-	.type	__i686.get_pc_thunk.bx,@function
-__i686.get_pc_thunk.bx:
+	.type	GET_PC_THUNK(bx),@function
+GET_PC_THUNK(bx):
 	movl	(%esp), %ebx
 	ret
 
@@ -37,7 +37,7 @@ ENTRY(__wcslen)
 	pushl	%ebx
 	cfi_adjust_cfa_offset (4)
 	cfi_rel_offset (ebx, 0)
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
 	cmpl	$0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
 	jne	1f
diff --git a/sysdeps/i386/i686/multiarch/wcsrchr.S b/sysdeps/i386/i686/multiarch/wcsrchr.S
index 8240063..a3eb5f0 100644
--- a/sysdeps/i386/i686/multiarch/wcsrchr.S
+++ b/sysdeps/i386/i686/multiarch/wcsrchr.S
@@ -1,5 +1,5 @@
 /* Multiple versions of wcsrchr
-   Copyright (C) 2011 Free Software Foundation, Inc.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    This file is part of the GNU C Library.
 
@@ -22,12 +22,12 @@
 #include <init-arch.h>
 
 #ifndef NOT_IN_libc
-	.section	.gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
-	.globl	__i686.get_pc_thunk.bx
-	.hidden	__i686.get_pc_thunk.bx
+	.section	.gnu.linkonce.t.GET_PC_THUNK(bx),"ax",@progbits
+	.globl	GET_PC_THUNK(bx)
+	.hidden	GET_PC_THUNK(bx)
 	.p2align 4
-	.type	__i686.get_pc_thunk.bx,@function
-__i686.get_pc_thunk.bx:
+	.type	GET_PC_THUNK(bx),@function
+GET_PC_THUNK(bx):
 	movl	(%esp), %ebx
 	ret
 
@@ -37,7 +37,7 @@ ENTRY(wcsrchr)
 	pushl	%ebx
 	cfi_adjust_cfa_offset (4)
 	cfi_rel_offset (ebx, 0)
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
 	cmpl	$0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
 	jne	1f
diff --git a/sysdeps/i386/i686/multiarch/wmemcmp.S b/sysdeps/i386/i686/multiarch/wmemcmp.S
index 5080c14..a60aebe 100644
--- a/sysdeps/i386/i686/multiarch/wmemcmp.S
+++ b/sysdeps/i386/i686/multiarch/wmemcmp.S
@@ -1,5 +1,5 @@
 /* Multiple versions of wmemcmp
-   Copyright (C)  2011 Free Software Foundation, Inc.
+   Copyright (C) 2011-2012 Free Software Foundation, Inc.
    Contributed by Intel Corporation.
    This file is part of the GNU C Library.
 
@@ -24,12 +24,12 @@
 /* Define multiple versions only for the definition in libc. */
 
 #ifndef NOT_IN_libc
-	.section	.gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
-	.globl	__i686.get_pc_thunk.bx
-	.hidden	__i686.get_pc_thunk.bx
+	.section	.gnu.linkonce.t.GET_PC_THUNK(bx),"ax",@progbits
+	.globl	GET_PC_THUNK(bx)
+	.hidden	GET_PC_THUNK(bx)
 	.p2align 4
-	.type	__i686.get_pc_thunk.bx,@function
-	__i686.get_pc_thunk.bx:
+	.type	GET_PC_THUNK(bx),@function
+	GET_PC_THUNK(bx):
 	movl	(%esp), %ebx
 	ret
 
@@ -39,7 +39,7 @@ ENTRY(wmemcmp)
 	pushl	%ebx
 	cfi_adjust_cfa_offset (4)
 	cfi_rel_offset (ebx, 0)
-	call	__i686.get_pc_thunk.bx
+	call	GET_PC_THUNK(bx)
 	addl	$_GLOBAL_OFFSET_TABLE_, %ebx
 	cmpl	$0, KIND_OFFSET+__cpu_features@GOTOFF(%ebx)
 	jne	1f
diff --git a/sysdeps/i386/initfini.c b/sysdeps/i386/initfini.c
new file mode 100644
index 0000000..d96b422
--- /dev/null
+++ b/sysdeps/i386/initfini.c
@@ -0,0 +1,145 @@
+/* Special .init and .fini section support.
+   Copyright (C) 1995, 1996, 1997, 2000, 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
+   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.
+
+   In addition to the permissions in the GNU Lesser General Public
+   License, the Free Software Foundation gives you unlimited
+   permission to link the compiled version of this file with other
+   programs, and to distribute those programs without any restriction
+   coming from the use of this file. (The GNU Lesser General Public
+   License restrictions do apply in other respects; for example, they
+   cover modification of the file, and distribution when not linked
+   into another program.)
+
+   Note that people who make modified versions of this file are not
+   obligated to grant this special exception for their modified
+   versions; it is their choice whether to do so. The GNU Lesser
+   General Public License gives permission to release a modified
+   version without this exception; this exception also makes it
+   possible to release a modified version which carries forward this
+   exception.
+
+   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.  */
+
+/* This file is compiled into assembly code which is then munged by a sed
+   script into two files: crti.s and crtn.s.
+
+   * crti.s puts a function prologue at the beginning of the
+   .init and .fini sections and defines global symbols for
+   those addresses, so they can be called as functions.
+
+   * crtn.s puts the corresponding function epilogues
+   in the .init and .fini sections. */
+
+#include <stdlib.h>
+
+/* We use embedded asm for .section unconditionally, as this makes it
+   easier to insert the necessary directives into crtn.S. */
+#define SECTION(x) asm (".section " x )
+
+/* Embed an #include to pull in the alignment and .end directives. */
+asm ("\n#include \"defs.h\"");
+
+/* See sysdeps/i386/sysdep.h.  */
+asm ("\n#ifdef __i686\n\
+#undef __i686\n\
+#define __i686 __i686\n\
+#endif");
+
+/* The initial common code ends here. */
+asm ("\n/*@HEADER_ENDS*/");
+
+/* To determine whether we need .end and .align: */
+asm ("\n/*@TESTS_BEGIN*/");
+extern void dummy (void (*foo) (void));
+void
+dummy (void (*foo) (void))
+{
+  if (foo)
+    (*foo) ();
+}
+asm ("\n/*@TESTS_END*/");
+
+/* The beginning of _init:  */
+asm ("\n/*@_init_PROLOG_BEGINS*/");
+
+static void
+call_gmon_start(void)
+{
+  extern void __gmon_start__ (void) __attribute__ ((weak)); /*weak_extern (__gmon_start__);*/
+  void (*gmon_start) (void) = __gmon_start__;
+
+  if (gmon_start)
+    gmon_start ();
+}
+
+SECTION (".init");
+extern void __attribute__ ((section (".init"))) _init (void);
+void
+_init (void)
+{
+  /* We cannot use the normal constructor mechanism in gcrt1.o because it
+     appears before crtbegin.o in the link, so the header elt of .ctors
+     would come after the elt for __gmon_start__.  One approach is for
+     gcrt1.o to reference a symbol which would be defined by some library
+     module which has a constructor; but then user code's constructors
+     would come first, and not be profiled.  */
+  call_gmon_start ();
+
+  asm ("ALIGN");
+  asm("END_INIT");
+  /* Now the epilog. */
+  asm ("\n/*@_init_PROLOG_ENDS*/");
+  asm ("\n/*@_init_EPILOG_BEGINS*/");
+  SECTION(".init");
+}
+asm ("END_INIT");
+
+/* End of the _init epilog, beginning of the _fini prolog. */
+asm ("\n/*@_init_EPILOG_ENDS*/");
+asm ("\n/*@_fini_PROLOG_BEGINS*/");
+
+SECTION (".fini");
+extern void __attribute__ ((section (".fini"))) _fini (void);
+void
+_fini (void)
+{
+
+  /* End of the _fini prolog. */
+  asm ("ALIGN");
+  asm ("END_FINI");
+  asm ("\n/*@_fini_PROLOG_ENDS*/");
+
+  {
+    /* Let GCC know that _fini is not a leaf function by having a dummy
+       function call here.  We arrange for this call to be omitted from
+       either crt file.  */
+    extern void i_am_not_a_leaf (void);
+    i_am_not_a_leaf ();
+  }
+
+  /* Beginning of the _fini epilog. */
+  asm ("\n/*@_fini_EPILOG_BEGINS*/");
+  SECTION (".fini");
+}
+asm ("END_FINI");
+
+/* End of the _fini epilog.  Any further generated assembly (e.g. .ident)
+   is shared between both crt files. */
+asm ("\n/*@_fini_EPILOG_ENDS*/");
+asm ("\n/*@TRAILER_BEGINS*/");
+
+/* End of file. */
diff --git a/sysdeps/i386/sysdep.h b/sysdeps/i386/sysdep.h
index ffa38ed..97208d6 100644
--- a/sysdeps/i386/sysdep.h
+++ b/sysdeps/i386/sysdep.h
@@ -20,6 +20,31 @@
 
 #include <sysdeps/generic/sysdep.h>
 
+#include <features.h> /* For __GNUC_PREREQ.  */
+
+/* It is desirable that the names of PIC thunks match those used by
+   GCC so that multiple copies are eliminated by the linker.  Because
+   GCC 4.6 and earlier use __i686 in the names, it it necessary to
+   override that predefined macro.  */
+#if defined __i686 && defined __ASSEMBLER__
+#undef __i686
+#define __i686 __i686
+#endif
+
+#ifdef	__ASSEMBLER__
+# if __GNUC_PREREQ (4, 7)
+#  define GET_PC_THUNK(reg) __x86.get_pc_thunk.reg
+# else
+#  define GET_PC_THUNK(reg) __i686.get_pc_thunk.reg
+# endif
+#else
+# if __GNUC_PREREQ (4, 7)
+#  define GET_PC_THUNK_STR(reg) "__x86.get_pc_thunk." #reg
+# else
+#  define GET_PC_THUNK_STR(reg) "__i686.get_pc_thunk." #reg
+# endif
+#endif
+
 #ifdef	__ASSEMBLER__
 
 /* Syntactic details of assembler.  */
@@ -121,18 +146,18 @@ lose: SYSCALL_PIC_SETUP							      \
     addl $_GLOBAL_OFFSET_TABLE+[.-0b], %ebx;
 
 # define SETUP_PIC_REG(reg) \
-  .ifndef __i686.get_pc_thunk.reg;					      \
-  .section .gnu.linkonce.t.__i686.get_pc_thunk.reg,"ax",@progbits;	      \
-  .globl __i686.get_pc_thunk.reg;					      \
-  .hidden __i686.get_pc_thunk.reg;					      \
-  .type __i686.get_pc_thunk.reg,@function;				      \
-__i686.get_pc_thunk.reg:						      \
+  .ifndef GET_PC_THUNK(reg);						      \
+  .section .gnu.linkonce.t.GET_PC_THUNK(reg),"ax",@progbits;		      \
+  .globl GET_PC_THUNK(reg);						      \
+  .hidden GET_PC_THUNK(reg);						      \
+  .type GET_PC_THUNK(reg),@function;					      \
+GET_PC_THUNK(reg):							      \
   movl (%esp), %e##reg;							      \
   ret;									      \
-  .size __i686.get_pc_thunk.reg, . - __i686.get_pc_thunk.reg;		      \
+  .size GET_PC_THUNK(reg), . - GET_PC_THUNK(reg);			      \
   .previous;								      \
   .endif;								      \
-  call __i686.get_pc_thunk.reg
+  call GET_PC_THUNK(reg)
 
 # define LOAD_PIC_REG(reg) \
   SETUP_PIC_REG(reg); addl $_GLOBAL_OFFSET_TABLE_, %e##reg
diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.h b/sysdeps/unix/sysv/linux/i386/sysdep.h
index 64ef400..90660fd 100644
--- a/sysdeps/unix/sysv/linux/i386/sysdep.h
+++ b/sysdeps/unix/sysv/linux/i386/sysdep.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1992,1993,1995-2000,2002-2006,2007,2011
+/* Copyright (C) 1992,1993,1995-2000,2002-2006,2007,2011-2012
 	Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper, <drepper@gnu.org>, August 1995.
@@ -514,17 +514,17 @@ asm (".L__X'%ebx = 1\n\t"
 # define check_consistency()						      \
   ({ int __res;								      \
      __asm__ __volatile__						      \
-       ("call __i686.get_pc_thunk.cx;"					      \
+       ("call "GET_PC_THUNK_STR(cx)";"					      \
 	"addl $_GLOBAL_OFFSET_TABLE_, %%ecx;"				      \
 	"subl %%ebx, %%ecx;"						      \
 	"je 1f;"							      \
 	"ud2;"								      \
 	"1:\n"								      \
-	".section .gnu.linkonce.t.__i686.get_pc_thunk.cx,\"ax\",@progbits;"   \
-	".globl __i686.get_pc_thunk.cx;"				      \
-	".hidden __i686.get_pc_thunk.cx;"				      \
-	".type __i686.get_pc_thunk.cx,@function;"			      \
-	"__i686.get_pc_thunk.cx:"					      \
+	".section .gnu.linkonce.t."GET_PC_THUNK_STR(cx)",\"ax\",@progbits;"   \
+	".globl "GET_PC_THUNK_STR(cx)";"				      \
+	".hidden "GET_PC_THUNK_STR(cx)";"				      \
+	".type "GET_PC_THUNK_STR(cx)",@function;"			      \
+	GET_PC_THUNK_STR(cx)":"						      \
 	"movl (%%esp), %%ecx;"						      \
 	"ret;"								      \
 	".previous"							      \

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]