[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[commits] r8102 - in /fsf/trunk/libc: ./ crypt/ elf/ locale/ localedata/ localedata/locales/ string/ sysdeps/i386/ sysdeps/x86_64/



Author: eglibc
Date: Sun Mar 15 00:05:25 2009
New Revision: 8102

Log:
Import glibc-mainline for 2009-03-15

Added:
    fsf/trunk/libc/localedata/locales/nan_TW@latin
    fsf/trunk/libc/string/tst-svc2.c
    fsf/trunk/libc/sysdeps/x86_64/dl-runtime.c
Modified:
    fsf/trunk/libc/ChangeLog
    fsf/trunk/libc/NEWS
    fsf/trunk/libc/crypt/sha256test.c
    fsf/trunk/libc/elf/dl-runtime.c
    fsf/trunk/libc/elf/dl-sysdep.c
    fsf/trunk/libc/locale/iso-639.def
    fsf/trunk/libc/localedata/ChangeLog
    fsf/trunk/libc/localedata/SUPPORTED
    fsf/trunk/libc/string/Makefile
    fsf/trunk/libc/string/strverscmp.c
    fsf/trunk/libc/sysdeps/i386/dl-machine.h
    fsf/trunk/libc/sysdeps/x86_64/dl-trampoline.S

Modified: fsf/trunk/libc/ChangeLog
==============================================================================
--- fsf/trunk/libc/ChangeLog (original)
+++ fsf/trunk/libc/ChangeLog Sun Mar 15 00:05:25 2009
@@ -1,3 +1,48 @@
+2009-03-14  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* crypt/sha256test.c (main): Perform 100,000 'a' test in a second way.
+
+	* elf/dl-runtime.c (reloc_offset): Define.
+	(reloc_index): Define.
+	(_dl_fixup): Rename reloc_offset parameter to reloc_arg.
+	(_dl_fixup_profile): Likewise.  Use reloc_index instead of
+	computing index from reloc_offset.
+	(_dl_call_pltexit): Likewise.
+	* sysdeps/x86_64/dl-trampoline.S (_dl_runtime_resolve): Just pass
+	the relocation index to _dl_fixup.
+	(_dl_runtime_profile): Likewise for _dl_fixup_profile and
+	_dl_call_pltexit.
+	* sysdeps/x86_64/dl-runtime.c: New file.
+
+	[BZ #9893]
+	* sysdeps/x86_64/dl-trampoline.S (_dl_runtime_profile): Fix
+	alignement of La_x86_64_regs.  Store xmm parameters.
+	Patch mostly by Jiri Olsa <olsajiri@xxxxxxxxx>.
+
+	[BZ #9913]
+	* string/strverscmp.c (__strverscmp): Fix case of different digits
+	in fractional part of string.
+	Patch by Jingyu Liu <jyliu@xxxxxxxxxxxx>.
+	* string/Makefile (tests): Add tst-svc2.
+	* string/tst-svc2.c: New file.
+
+	* string/strverscmp.c (__strverscmp): Optimize size of tables.
+
+	* locale/iso-639.def: Add Min Nan.
+
+2009-03-11  Carlos Eduardo Seo  <cseo@xxxxxxxxxxxxxxxxxx>
+
+	[BZ #9948]
+	* elf/dl-sysdep.c (_dl_show_auxv): Add support for AT_BASE_PLATFORM.
+
+2009-03-14  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	* elf/dl-sysdep.c (auxvars): Compress data structure.
+
+	* sysdeps/i386/dl-machine.h (elf_machine_rel): Implement
+	STT_GNU_IFUNC handling.
+	(elf_machine_rela): Likewise.
+
 2009-03-13  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	* config.h.in (USE_MULTIARCH): Define.

Modified: fsf/trunk/libc/NEWS
==============================================================================
--- fsf/trunk/libc/NEWS (original)
+++ fsf/trunk/libc/NEWS Sun Mar 15 00:05:25 2009
@@ -1,4 +1,4 @@
-GNU C Library NEWS -- history of user-visible changes.  2009-3-12
+GNU C Library NEWS -- history of user-visible changes.  2009-3-14
 Copyright (C) 1992-2008, 2009 Free Software Foundation, Inc.
 See the end for copying conditions.
 
@@ -20,6 +20,11 @@
 
 * New ISO C++1x interfaces: quick_exit, at_quick_exit
   Implemented by Ulrich Drepper.
+
+* Support for selecting between multiple function definitions at runtime
+  using STT_GNU_IFUNC symbols.  Implemented by Ulrich Drepper.
+
+* New locale: nan_TW@latin
 
 
 Version 2.9

Modified: fsf/trunk/libc/crypt/sha256test.c
==============================================================================
--- fsf/trunk/libc/crypt/sha256test.c (original)
+++ fsf/trunk/libc/crypt/sha256test.c Sun Mar 15 00:05:25 2009
@@ -84,7 +84,17 @@
     "\xf1\x80\x9a\x48\xa4\x97\x20\x0e\x04\x6d\x39\xcc\xc7\x11\x2c\xd0";
   if (memcmp (expected, sum, 32) != 0)
     {
-      printf ("test %d failed\n", cnt);
+      printf ("test %d failed\n", cnt++);
+      result = 1;
+    }
+
+  __sha256_init_ctx (&ctx);
+  for (int i = 0; i < 100000; ++i)
+    __sha256_process_bytes (buf, 10, &ctx);
+  __sha256_finish_ctx (&ctx, sum);
+  if (memcmp (expected, sum, 32) != 0)
+    {
+      printf ("test %d failed\n", cnt++);
       result = 1;
     }
 

Modified: fsf/trunk/libc/elf/dl-runtime.c
==============================================================================
--- fsf/trunk/libc/elf/dl-runtime.c (original)
+++ fsf/trunk/libc/elf/dl-runtime.c Sun Mar 15 00:05:25 2009
@@ -1,5 +1,5 @@
 /* On-demand PLT fixup for shared objects.
-   Copyright (C) 1995-2006, 2007, 2008 Free Software Foundation, Inc.
+   Copyright (C) 1995-2006, 2007, 2008, 2009 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
@@ -45,6 +45,12 @@
 #ifndef ARCH_FIXUP_ATTRIBUTE
 # define ARCH_FIXUP_ATTRIBUTE
 #endif
+
+#ifndef reloc_offset
+# define reloc_offset reloc_arg
+# define reloc_index  reloc_arg / sizeof (PLTREL)
+#endif
+
 
 
 /* This function is called through a special trampoline from the PLT the
@@ -63,7 +69,7 @@
 # endif
 	   /* GKM FIXME: Fix trampoline to pass bounds so we can do
 	      without the `__unbounded' qualifier.  */
-	   struct link_map *__unbounded l, ElfW(Word) reloc_offset)
+	   struct link_map *__unbounded l, ElfW(Word) reloc_arg)
 {
   const ElfW(Sym) *const symtab
     = (const void *) D_PTR (l, l_info[DT_SYMTAB]);
@@ -142,22 +148,20 @@
 #endif
 
 #if !defined PROF && !defined ELF_MACHINE_NO_PLT && !__BOUNDED_POINTERS__
-
 DL_FIXUP_VALUE_TYPE
 __attribute ((noinline)) ARCH_FIXUP_ATTRIBUTE
 _dl_profile_fixup (
 #ifdef ELF_MACHINE_RUNTIME_FIXUP_ARGS
 		   ELF_MACHINE_RUNTIME_FIXUP_ARGS,
 #endif
-		   struct link_map *l, ElfW(Word) reloc_offset,
+		   struct link_map *l, ElfW(Word) reloc_arg,
 		   ElfW(Addr) retaddr, void *regs, long int *framesizep)
 {
   void (*mcount_fct) (ElfW(Addr), ElfW(Addr)) = INTUSE(_dl_mcount);
 
   /* This is the address in the array where we store the result of previous
      relocations.  */
-  struct reloc_result *reloc_result
-    = &l->l_reloc_result[reloc_offset / sizeof (PLTREL)];
+  struct reloc_result *reloc_result = &l->l_reloc_result[reloc_index];
   DL_FIXUP_VALUE_TYPE *resultp = &reloc_result->addr;
 
   DL_FIXUP_VALUE_TYPE value = *resultp;
@@ -415,7 +419,7 @@
 #include <stdio.h>
 void
 ARCH_FIXUP_ATTRIBUTE
-_dl_call_pltexit (struct link_map *l, ElfW(Word) reloc_offset,
+_dl_call_pltexit (struct link_map *l, ElfW(Word) reloc_arg,
 		  const void *inregs, void *outregs)
 {
 #ifdef SHARED
@@ -423,8 +427,7 @@
      relocations.  */
   // XXX Maybe the bound information must be stored on the stack since
   // XXX with bind_not a new value could have been stored in the meantime.
-  struct reloc_result *reloc_result
-    = &l->l_reloc_result[reloc_offset / sizeof (PLTREL)];
+  struct reloc_result *reloc_result = &l->l_reloc_result[reloc_index];
   ElfW(Sym) *defsym = ((ElfW(Sym) *) D_PTR (reloc_result->bound,
 					    l_info[DT_SYMTAB])
 		       + reloc_result->boundndx);

Modified: fsf/trunk/libc/elf/dl-sysdep.c
==============================================================================
--- fsf/trunk/libc/elf/dl-sysdep.c (original)
+++ fsf/trunk/libc/elf/dl-sysdep.c Sun Mar 15 00:05:25 2009
@@ -269,36 +269,37 @@
     {
       static const struct
       {
-	const char label[20];
-	enum { unknown = 0, dec, hex, str, ignore } form;
+	const char label[17];
+	enum { unknown = 0, dec, hex, str, ignore } form : 8;
       } auxvars[] =
 	{
-	  [AT_EXECFD - 2] =		{ "AT_EXECFD:       ", dec },
-	  [AT_EXECFN - 2] =		{ "AT_EXECFN:       ", str },
-	  [AT_PHDR - 2] =		{ "AT_PHDR:         0x", hex },
-	  [AT_PHENT - 2] =		{ "AT_PHENT:        ", dec },
-	  [AT_PHNUM - 2] =		{ "AT_PHNUM:        ", dec },
-	  [AT_PAGESZ - 2] =		{ "AT_PAGESZ:       ", dec },
-	  [AT_BASE - 2] =		{ "AT_BASE:         0x", hex },
-	  [AT_FLAGS - 2] =		{ "AT_FLAGS:        0x", hex },
-	  [AT_ENTRY - 2] =		{ "AT_ENTRY:        0x", hex },
-	  [AT_NOTELF - 2] =		{ "AT_NOTELF:       ", hex },
-	  [AT_UID - 2] =		{ "AT_UID:          ", dec },
-	  [AT_EUID - 2] =		{ "AT_EUID:         ", dec },
-	  [AT_GID - 2] =		{ "AT_GID:          ", dec },
-	  [AT_EGID - 2] =		{ "AT_EGID:         ", dec },
-	  [AT_PLATFORM - 2] =		{ "AT_PLATFORM:     ", str },
-	  [AT_HWCAP - 2] =		{ "AT_HWCAP:        ", hex },
-	  [AT_CLKTCK - 2] =		{ "AT_CLKTCK:       ", dec },
-	  [AT_FPUCW - 2] =		{ "AT_FPUCW:        ", hex },
-	  [AT_DCACHEBSIZE - 2] =	{ "AT_DCACHEBSIZE:  0x", hex },
-	  [AT_ICACHEBSIZE - 2] =	{ "AT_ICACHEBSIZE:  0x", hex },
-	  [AT_UCACHEBSIZE - 2] =	{ "AT_UCACHEBSIZE:  0x", hex },
-	  [AT_IGNOREPPC - 2] =		{ "AT_IGNOREPPC", ignore },
-	  [AT_SECURE - 2] =		{ "AT_SECURE:       ", dec },
-	  [AT_SYSINFO - 2] =		{ "AT_SYSINFO:      0x", hex },
-	  [AT_SYSINFO_EHDR - 2] =	{ "AT_SYSINFO_EHDR: 0x", hex },
-	  [AT_RANDOM - 2] =		{ "AT_RANDOM:       0x", hex },
+	  [AT_EXECFD - 2] =		{ "EXECFD:       ", dec },
+	  [AT_EXECFN - 2] =		{ "EXECFN:       ", str },
+	  [AT_PHDR - 2] =		{ "PHDR:         0x", hex },
+	  [AT_PHENT - 2] =		{ "PHENT:        ", dec },
+	  [AT_PHNUM - 2] =		{ "PHNUM:        ", dec },
+	  [AT_PAGESZ - 2] =		{ "PAGESZ:       ", dec },
+	  [AT_BASE - 2] =		{ "BASE:         0x", hex },
+	  [AT_FLAGS - 2] =		{ "FLAGS:        0x", hex },
+	  [AT_ENTRY - 2] =		{ "ENTRY:        0x", hex },
+	  [AT_NOTELF - 2] =		{ "NOTELF:       ", hex },
+	  [AT_UID - 2] =		{ "UID:          ", dec },
+	  [AT_EUID - 2] =		{ "EUID:         ", dec },
+	  [AT_GID - 2] =		{ "GID:          ", dec },
+	  [AT_EGID - 2] =		{ "EGID:         ", dec },
+	  [AT_PLATFORM - 2] =		{ "PLATFORM:     ", str },
+	  [AT_HWCAP - 2] =		{ "HWCAP:        ", hex },
+	  [AT_CLKTCK - 2] =		{ "CLKTCK:       ", dec },
+	  [AT_FPUCW - 2] =		{ "FPUCW:        ", hex },
+	  [AT_DCACHEBSIZE - 2] =	{ "DCACHEBSIZE:  0x", hex },
+	  [AT_ICACHEBSIZE - 2] =	{ "ICACHEBSIZE:  0x", hex },
+	  [AT_UCACHEBSIZE - 2] =	{ "UCACHEBSIZE:  0x", hex },
+	  [AT_IGNOREPPC - 2] =		{ "IGNOREPPC", ignore },
+	  [AT_SECURE - 2] =		{ "SECURE:       ", dec },
+	  [AT_BASE_PLATFORM - 2] =	{ "BASE_PLATFORM:", str },
+	  [AT_SYSINFO - 2] =		{ "SYSINFO:      0x", hex },
+	  [AT_SYSINFO_EHDR - 2] =	{ "SYSINFO_EHDR: 0x", hex },
+	  [AT_RANDOM - 2] =		{ "RANDOM:       0x", hex },
 	};
       unsigned int idx = (unsigned int) (av->a_type - 2);
 
@@ -327,7 +328,7 @@
 	    val = _itoa ((unsigned long int) av->a_un.a_val,
 			 buf + sizeof buf - 1, 16, 0);
 
-	  _dl_printf ("%s%s\n", auxvars[idx].label, val);
+	  _dl_printf ("AT_%s%s\n", auxvars[idx].label, val);
 
 	  continue;
 	}

Modified: fsf/trunk/libc/locale/iso-639.def
==============================================================================
--- fsf/trunk/libc/locale/iso-639.def (original)
+++ fsf/trunk/libc/locale/iso-639.def Sun Mar 15 00:05:25 2009
@@ -303,6 +303,7 @@
 DEFINE_LANGUAGE_CODE3 ("Mende", men, men)
 DEFINE_LANGUAGE_CODE3 ("Mi'kmaq; Micmac", mic, mic)
 DEFINE_LANGUAGE_CODE3 ("Minangkabau", min, min)
+DEFINE_LANGUAGE_CODE3 ("Min Nan", nan, nan)
 DEFINE_LANGUAGE_CODE3 ("Mirandese", mwl, mwl)
 DEFINE_LANGUAGE_CODE3 ("Miscellaneous languages", mis, mis)
 DEFINE_LANGUAGE_CODE3 ("Mohawk", moh, moh)

Modified: fsf/trunk/libc/localedata/ChangeLog
==============================================================================
--- fsf/trunk/libc/localedata/ChangeLog (original)
+++ fsf/trunk/libc/localedata/ChangeLog Sun Mar 15 00:05:25 2009
@@ -1,3 +1,10 @@
+2009-03-14  Ulrich Drepper  <drepper@xxxxxxxxxx>
+
+	[BZ #9916]
+	* SUPPORTED (SUPPORTED-LOCALES): Add nan_TW@latin.
+	* locales/nan_TW@latin: New file.
+	Contributed by Arne Goetje.
+
 2009-02-11  Ulrich Drepper  <drepper@xxxxxxxxxx>
 
 	* locales/iso14651_t1_common: Add rules for sorting Malayalam.

Modified: fsf/trunk/libc/localedata/SUPPORTED
==============================================================================
--- fsf/trunk/libc/localedata/SUPPORTED (original)
+++ fsf/trunk/libc/localedata/SUPPORTED Sun Mar 15 00:05:25 2009
@@ -287,6 +287,7 @@
 ms_MY/ISO-8859-1 \
 mt_MT.UTF-8/UTF-8 \
 mt_MT/ISO-8859-3 \
+nan_TW@latin/UTF-8 \
 nb_NO.UTF-8/UTF-8 \
 nb_NO/ISO-8859-1 \
 nds_DE/UTF-8 \

Added: fsf/trunk/libc/localedata/locales/nan_TW@latin
==============================================================================
--- fsf/trunk/libc/localedata/locales/nan_TW@latin (added)
+++ fsf/trunk/libc/localedata/locales/nan_TW@latin Sun Mar 15 00:05:25 2009
@@ -1,0 +1,205 @@
+comment_char %
+escape_char  /
+%
+% Minnan Language Locale for Taiwan
+% Source:
+% Contact: Arne Goetje
+% Email: arne@xxxxxxxxxx
+% Language: nan
+% Territory: TW
+% Revision: 0.1
+% Date: 2008-06-16
+% Users: general
+% Charset: UTF-8
+% Distribution and use is free, also
+% for commercial purposes.
+
+LC_IDENTIFICATION
+title "Minnan language locale for Taiwan"
+source ""
+address ""
+contact "Arne Goetje"
+email "arne@xxxxxxxxxxxxx"
+tel ""
+fax ""
+language "Minnan"
+territory "Taiwan"
+revision "0.1"
+date "2008-06-16"
+
+category "nan_TW@latin:2000";LC_IDENTIFICATION
+category "nan_TW@latin:2000";LC_CTYPE
+category "nan_TW@latin:2000";LC_COLLATE
+category "nan_TW@latin:2000";LC_TIME
+category "nan_TW@latin:2000";LC_NUMERIC
+category "nan_TW@latin:2000";LC_PAPER
+category "nan_TW@latin:2000";LC_TELEPHONE
+category "nan_TW@latin:2000";LC_MEASUREMENT
+category "nan_TW@latin:2000";LC_ADDRESS
+category "nan_TW@latin:2000";LC_MESSAGES
+category "nan_TW@latin:2000";LC_MONETARY
+
+END LC_IDENTIFICATION
+
+LC_CTYPE
+copy "i18n"
+
+translit_start
+
+% accents are simply omitted if they cannot be represented.
+include "translit_combining";""
+
+translit_end
+
+END LC_CTYPE
+
+LC_COLLATE
+copy "iso14651_t1"
+
+%% a b c d e f g h i j k l m n o o͘ p q r s t u v w x y z ⁿ
+
+collating-element <oo> from "<U006F><U0358>"
+collating-element <OO> from "<U004F><U0358>"
+collating-element <nn> from "<U207F>"
+
+collating-symbol <CAP-MIN>
+collating-symbol <MIN-CAP>
+
+reorder-after <MIN>
+<MIN-CAP>
+reorder-after <CAP>
+<CAP-MIN>
+
+reorder-after <U006E>
+<oo>
+reorder-after <U004E>
+<OO>
+reorder-after <U007A>
+<nn>
+reorder-after <U005A>
+<nn>
+
+reorder-end
+
+END LC_COLLATE
+
+LC_MONETARY
+copy "zh_TW"
+END LC_MONETARY
+
+LC_NUMERIC
+copy "zh_TW"
+END LC_NUMERIC
+
+LC_TIME
+abday   "<U006C><U0070>";/
+	"<U0070><U0031>";/
+	"<U0070><U0032>";/
+	"<U0070><U0033>";/
+	"<U0070><U0034>";/
+	"<U0070><U0035>";/
+	"<U0070><U0036>"
+day     "<U006C><U00E9><U002D><U0070><U00E0><U0069><U002D><U006A><U0069><U030D><U0074>";/
+        "<U0070><U00E0><U0069><U002D><U0069><U0074>";/
+        "<U0070><U00E0><U0069><U002D><U006A><U012B>";/
+        "<U0070><U00E0><U0069><U002D><U0073><U0061><U207F>";/
+        "<U0070><U00E0><U0069><U002D><U0073><U00EC>";/
+        "<U0070><U00E0><U0069><U002D><U0067><U014D><U0358>";/
+        "<U0070><U00E0><U0069><U002D><U006C><U0061><U030D><U006B>"
+abmon   "<U0031><U0067>";/
+	"<U0032><U0067>";/
+	"<U0033><U0067>";/
+	"<U0034><U0067>";/
+	"<U0035><U0067>";/
+	"<U0036><U0067>";/
+	"<U0037><U0067>";/
+	"<U0038><U0067>";/
+	"<U0039><U0067>";/
+	"<U0031><U0030><U0067>";/
+	"<U0031><U0031><U0067>";/
+	"<U0031><U0032><U0067>"
+mon     "<U0031><U0067><U006F><U0065><U030D><U0068>";/
+	"<U0032><U0067><U006F><U0065><U030D><U0068>";/
+	"<U0033><U0067><U006F><U0065><U030D><U0068>";/
+	"<U0034><U0067><U006F><U0065><U030D><U0068>";/
+	"<U0035><U0067><U006F><U0065><U030D><U0068>";/
+	"<U0036><U0067><U006F><U0065><U030D><U0068>";/
+	"<U0037><U0067><U006F><U0065><U030D><U0068>";/
+	"<U0038><U0067><U006F><U0065><U030D><U0068>";/
+	"<U0039><U0067><U006F><U0065><U030D><U0068>";/
+	"<U0031><U0030><U0067><U006F><U0065><U030D><U0068>";/
+	"<U0031><U0031><U0067><U006F><U0065><U030D><U0068>";/
+	"<U0031><U0032><U0067><U006F><U0065><U030D><U0068>"
+%
+d_t_fmt    "<U0025><U0059><U0020><U0025><U0062><U0020><U0025><U0064><U0020><U0028><U0025><U0061><U0029><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A>"
+d_fmt       "<U0025><U0046>"
+t_fmt       "<U0025><U0072>"
+am_pm       "<U0074><U00E9><U006E><U0067><U002D><U0070><U006F><U0358>";"<U0113><U002D><U0070><U006F><U0358>"
+t_fmt_ampm  "<U0025><U0049><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U0070>"
+timezone    "<U0054><U0053><U0054><U002D><U0038>"
+date_fmt    "<U0025><U0059><U0020><U0025><U0062><U0020><U0025><U0064><U0020><U0028><U0025><U0061><U0029><U0020><U0025><U0048><U003A><U0025><U004D><U003A><U0025><U0053><U0020><U0025><U005A>"
+END LC_TIME
+
+LC_MESSAGES
+
+% "^[sS].*" for "Yes"
+yesexpr "<U005E><U005B><U0073><U0053><U005D><U002E><U002A>"
+
+% "^[mM].*" for "No"
+noexpr "<U005E><U005B><U006D><U004D><U005D><U002E><U002A>"
+
+% "SÄ«" for "Yes"
+yesstr "<U0053><U012B>"
+
+% "M̄-sī" for "No"
+nostr "<U004D><U0304><U002D><U0053><U012B>"
+
+END LC_MESSAGES
+
+LC_PAPER
+height      297
+width       210
+END LC_PAPER
+
+LC_MEASUREMENT
+measurement 1
+END LC_MEASUREMENT
+
+LC_NAME
+%FIXME
+name_fmt    "<U0025><U0064><U0025><U0074><U0025><U0067><U0025><U0074>/
+<U0025><U006D><U0025><U0074><U0025><U0066>"
+name_miss   "<U006B><U006F><U0358><U002D><U006E><U0069><U00FB>"
+name_mr     "<U0073><U0069><U0061><U006E><U002D><U0073><U0069><U207F>"
+name_mrs    "<U006C><U00FA><U002D><U0073><U016B>"
+name_ms     "<U0073><U0069><U00F3><U002D><U0063><U0068><U0069><U00E1>"
+END LC_NAME
+
+LC_ADDRESS
+% postal_fmt: "%f%N%a%N%d%N%b%N%r %e %h %s%N%z %T%N%c%N"
+postal_fmt    "<U0025><U0066><U0025><U004E><U0025><U0061><U0025><U004E>/
+<U0025><U0064><U0025><U004E><U0025><U0062><U0025><U004E><U0025><U0072>/
+<U0020><U0025><U0065><U0020><U0025><U0068><U0020><U0025><U0073><U0025>/
+<U004E><U0025><U007A><U0020><U0025><U0054><U0025>/
+<U004E><U0025><U0063><U0025><U004E>"
+% Reference:	http://www.un.org/Depts/unsd/methods/m49alpha.htm
+%		http://www.isbn.spk-berlin.de/html/prefix.htm
+% country_ab2:	TW
+% country_ab3:	TWN
+% country_isbn:	957
+country_name	"<U0054><U00E2><U0069><U002D><U006F><U00E2><U006E>"
+%country_post	"FIXME"
+country_ab2	"<U0054><U0057>"
+country_ab3	"<U0054><U0057><U004E>"
+country_num	158
+%country_car    "FIXME"
+country_isbn	"<U0039><U0035><U0037>"
+%lang_name "Bân-lâm-gú, Hō-ló-oē"
+lang_name "<U0042><U00E2><U006E><U002D><U006C><U00E2><U006D><U002D><U0067><U00FA><U002C><U0020><U0048><U014D><U002D><U006C><U00F3><U002D><U006F><U0113>"
+lang_term "<U006E><U0061><U006E>"
+lang_lib "<U006E><U0061><U006E>"
+END LC_ADDRESS
+
+LC_TELEPHONE
+copy "zh_TW"
+END LC_TELEPHONE

Modified: fsf/trunk/libc/string/Makefile
==============================================================================
--- fsf/trunk/libc/string/Makefile (original)
+++ fsf/trunk/libc/string/Makefile Sun Mar 15 00:05:25 2009
@@ -1,4 +1,4 @@
-# Copyright (C) 1991-2002, 2005-2007, 2008 Free Software Foundation, Inc.
+# Copyright (C) 1991-2002, 2005-2008, 2009 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
@@ -54,7 +54,7 @@
 		   bug-strncat1 bug-strspn1 bug-strpbrk1 tst-bswap	\
 		   tst-strtok tst-strxfrm bug-strcoll1 tst-strfry	\
 		   bug-strtok1 $(addprefix test-,$(strop-tests))	\
-		   bug-envz1 tst-strxfrm2 tst-endian
+		   bug-envz1 tst-strxfrm2 tst-endian tst-svc2
 distribute	:= memcopy.h pagecopy.h tst-svc.expect test-string.h	\
 		   str-two-way.h
 

Modified: fsf/trunk/libc/string/strverscmp.c
==============================================================================
--- fsf/trunk/libc/string/strverscmp.c (original)
+++ fsf/trunk/libc/string/strverscmp.c Sun Mar 15 00:05:25 2009
@@ -1,5 +1,5 @@
 /* Compare strings while treating digits characters numerically.
-   Copyright (C) 1997, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1997, 2002, 2009 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jean-François Bignolles <bignolle@xxxxxxxxxxxxxxx>, 1997.
 
@@ -18,15 +18,16 @@
    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
    02111-1307 USA.  */
 
+#include <stdint.h>
 #include <string.h>
 #include <ctype.h>
 
 /* states: S_N: normal, S_I: comparing integral part, S_F: comparing
            fractionnal parts, S_Z: idem but with leading Zeroes only */
 #define  S_N    0x0
-#define  S_I    0x4
-#define  S_F    0x8
-#define  S_Z    0xC
+#define  S_I    0x3
+#define  S_F    0x6
+#define  S_Z    0x9
 
 /* result_type: CMP: return diff; LEN: compare using len_diff/diff */
 #define  CMP    2
@@ -45,53 +46,49 @@
 {
   const unsigned char *p1 = (const unsigned char *) s1;
   const unsigned char *p2 = (const unsigned char *) s2;
-  unsigned char c1, c2;
-  int state;
-  int diff;
 
-  /* Symbol(s)    0       [1-9]   others  (padding)
-     Transition   (10) 0  (01) d  (00) x  (11) -   */
-  static const unsigned int next_state[] =
+  /* Symbol(s)    0       [1-9]   others
+     Transition   (10) 0  (01) d  (00) x   */
+  static const uint8_t next_state[] =
   {
-      /* state    x    d    0    - */
-      /* S_N */  S_N, S_I, S_Z, S_N,
-      /* S_I */  S_N, S_I, S_I, S_I,
-      /* S_F */  S_N, S_F, S_F, S_F,
-      /* S_Z */  S_N, S_F, S_Z, S_Z
+      /* state    x    d    0  */
+      /* S_N */  S_N, S_I, S_Z,
+      /* S_I */  S_N, S_I, S_I,
+      /* S_F */  S_N, S_F, S_F,
+      /* S_Z */  S_N, S_F, S_Z
   };
 
-  static const int result_type[] =
+  static const int8_t result_type[] =
   {
-      /* state   x/x  x/d  x/0  x/-  d/x  d/d  d/0  d/-
-                 0/x  0/d  0/0  0/-  -/x  -/d  -/0  -/- */
+      /* state   x/x  x/d  x/0  d/x  d/d  d/0  0/x  0/d  0/0  */
 
-      /* S_N */  CMP, CMP, CMP, CMP, CMP, LEN, CMP, CMP,
-                 CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP,
-      /* S_I */  CMP, -1,  -1,  CMP, +1,  LEN, LEN, CMP,
-                 +1,  LEN, LEN, CMP, CMP, CMP, CMP, CMP,
-      /* S_F */  CMP, CMP, CMP, CMP, CMP, LEN, CMP, CMP,
-                 CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP,
-      /* S_Z */  CMP, +1,  +1,  CMP, -1,  CMP, CMP, CMP,
-                 -1,  CMP, CMP, CMP
+      /* S_N */  CMP, CMP, CMP, CMP, LEN, CMP, CMP, CMP, CMP,
+      /* S_I */  CMP, -1,  -1,  +1,  LEN, LEN, +1,  LEN, LEN,
+      /* S_F */  CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP, CMP,
+      /* S_Z */  CMP, +1,  +1,  -1,  CMP, CMP, -1,  CMP, CMP
   };
 
   if (p1 == p2)
     return 0;
 
-  c1 = *p1++;
-  c2 = *p2++;
+  unsigned char c1 = *p1++;
+  unsigned char c2 = *p2++;
   /* Hint: '0' is a digit too.  */
-  state = S_N | ((c1 == '0') + (isdigit (c1) != 0));
+  int state = S_N | ((c1 == '0') + (isdigit (c1) != 0));
 
-  while ((diff = c1 - c2) == 0 && c1 != '\0')
+  int diff;
+  while ((diff = c1 - c2) == 0)
     {
+      if (c1 == '\0')
+	return diff;
+
       state = next_state[state];
       c1 = *p1++;
       c2 = *p2++;
       state |= (c1 == '0') + (isdigit (c1) != 0);
     }
 
-  state = result_type[state << 2 | (((c2 == '0') + (isdigit (c2) != 0)))];
+  state = result_type[state * 3 | (((c2 == '0') + (isdigit (c2) != 0)))];
 
   switch (state)
   {

Added: fsf/trunk/libc/string/tst-svc2.c
==============================================================================
--- fsf/trunk/libc/string/tst-svc2.c (added)
+++ fsf/trunk/libc/string/tst-svc2.c Sun Mar 15 00:05:25 2009
@@ -1,0 +1,62 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+
+static struct
+{
+  const char *str1;
+  const char *str2;
+} tests[] =
+  {
+    { "B0075022800016.gbp.corp.com", "B007502280067.gbp.corp.com" },
+    { "B0075022800016.gbp.corp.com", "B007502357019.GBP.CORP.COM" },
+    { "B007502280067.gbp.corp.com", "B007502357019.GBP.CORP.COM" }
+  };
+#define ntests (sizeof (tests) / sizeof (tests[0]))
+
+
+int
+compare (const char *str1, const char *str2, int exp)
+{
+  int c = strverscmp (str1, str2);
+  if (c != 0)
+    c /= abs (c);
+  return c != exp;
+}
+
+
+static int
+do_test (void)
+{
+  int res = 0;
+  for (int i = 0; i < ntests; ++i)
+    {
+      if (compare (tests[i].str1, tests[i].str2, -1))
+	{
+	  printf ("FAIL: \"%s\" > \"%s\"\n", tests[i].str1, tests[i].str2);
+	  res = 1;
+	}
+      if (compare (tests[i].str2, tests[i].str1, +1))
+	{
+	  printf ("FAIL: \"%s\" > \"%s\"\n", tests[i].str2, tests[i].str1);
+	  res = 1;
+	}
+      char *copy1 = strdupa (tests[i].str1);
+      if (compare (tests[i].str1, copy1, 0))
+	{
+	  printf ("FAIL: \"%s\" != \"%s\"\n", tests[i].str1, copy1);
+	  res = 1;
+	}
+      char *copy2 = strdupa (tests[i].str2);
+      if (compare (tests[i].str2, copy2, 0))
+	{
+	  printf ("FAIL: \"%s\" != \"%s\"\n", tests[i].str2, copy2);
+	  res = 1;
+	}
+    }
+  return res;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"

Modified: fsf/trunk/libc/sysdeps/i386/dl-machine.h
==============================================================================
--- fsf/trunk/libc/sysdeps/i386/dl-machine.h (original)
+++ fsf/trunk/libc/sysdeps/i386/dl-machine.h Sun Mar 15 00:05:25 2009
@@ -1,5 +1,5 @@
 /* Machine-dependent ELF dynamic relocation inline functions.  i386 version.
-   Copyright (C) 1995-2005, 2006 Free Software Foundation, Inc.
+   Copyright (C) 1995-2005, 2006, 2009 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
@@ -316,33 +316,38 @@
   Elf32_Addr *const reloc_addr = reloc_addr_arg;
   const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
 
-#if !defined RTLD_BOOTSTRAP || !defined HAVE_Z_COMBRELOC
+# if !defined RTLD_BOOTSTRAP || !defined HAVE_Z_COMBRELOC
   if (__builtin_expect (r_type == R_386_RELATIVE, 0))
     {
-# if !defined RTLD_BOOTSTRAP && !defined HAVE_Z_COMBRELOC
+#  if !defined RTLD_BOOTSTRAP && !defined HAVE_Z_COMBRELOC
       /* This is defined in rtld.c, but nowhere in the static libc.a;
 	 make the reference weak so static programs can still link.
 	 This declaration cannot be done when compiling rtld.c
 	 (i.e. #ifdef RTLD_BOOTSTRAP) because rtld.c contains the
 	 common defn for _dl_rtld_map, which is incompatible with a
 	 weak decl in the same file.  */
-#  ifndef SHARED
+#   ifndef SHARED
       weak_extern (_dl_rtld_map);
-#  endif
+#   endif
       if (map != &GL(dl_rtld_map)) /* Already done in rtld itself.  */
-# endif
+#  endif
 	*reloc_addr += map->l_addr;
     }
-# ifndef RTLD_BOOTSTRAP
+#  ifndef RTLD_BOOTSTRAP
   else if (__builtin_expect (r_type == R_386_NONE, 0))
     return;
-# endif
+#  endif
   else
-#endif	/* !RTLD_BOOTSTRAP and have no -z combreloc */
+# endif	/* !RTLD_BOOTSTRAP and have no -z combreloc */
     {
       const Elf32_Sym *const refsym = sym;
       struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);
       Elf32_Addr value = sym_map == NULL ? 0 : sym_map->l_addr + sym->st_value;
+
+      if (sym != NULL
+	  && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC,
+			       0))
+	value = ((Elf32_Addr (*) (void)) value) ();
 
       switch (r_type)
 	{
@@ -351,44 +356,44 @@
 	  *reloc_addr = value;
 	  break;
 
-#if !defined RTLD_BOOTSTRAP || USE___THREAD
+# if !defined RTLD_BOOTSTRAP || USE___THREAD
 	case R_386_TLS_DTPMOD32:
-# ifdef RTLD_BOOTSTRAP
+#  ifdef RTLD_BOOTSTRAP
 	  /* During startup the dynamic linker is always the module
 	     with index 1.
 	     XXX If this relocation is necessary move before RESOLVE
 	     call.  */
 	  *reloc_addr = 1;
-# else
+#  else
 	  /* Get the information from the link map returned by the
 	     resolv function.  */
 	  if (sym_map != NULL)
 	    *reloc_addr = sym_map->l_tls_modid;
-# endif
+#  endif
 	  break;
 	case R_386_TLS_DTPOFF32:
-# ifndef RTLD_BOOTSTRAP
+#  ifndef RTLD_BOOTSTRAP
 	  /* During relocation all TLS symbols are defined and used.
 	     Therefore the offset is already correct.  */
 	  if (sym != NULL)
 	    *reloc_addr = sym->st_value;
-# endif
+#  endif
 	  break;
 	case R_386_TLS_DESC:
 	  {
 	    struct tlsdesc volatile *td =
 	      (struct tlsdesc volatile *)reloc_addr;
 
-# ifndef RTLD_BOOTSTRAP
+#  ifndef RTLD_BOOTSTRAP
 	    if (! sym)
 	      td->entry = _dl_tlsdesc_undefweak;
 	    else
-# endif
+#  endif
 	      {
-# ifndef RTLD_BOOTSTRAP
-#  ifndef SHARED
+#  ifndef RTLD_BOOTSTRAP
+#   ifndef SHARED
 		CHECK_STATIC_TLS (map, sym_map);
-#  else
+#   else
 		if (!TRY_STATIC_TLS (map, sym_map))
 		  {
 		    td->arg = _dl_make_tlsdesc_dynamic
@@ -396,8 +401,8 @@
 		    td->entry = _dl_tlsdesc_dynamic;
 		  }
 		else
-#  endif
-# endif
+#   endif
+#  endif
 		  {
 		    td->arg = (void*)(sym->st_value - sym_map->l_tls_offset
 				      + (ElfW(Word))td->arg);
@@ -408,9 +413,9 @@
 	  }
 	case R_386_TLS_TPOFF32:
 	  /* The offset is positive, backward from the thread pointer.  */
-# ifdef RTLD_BOOTSTRAP
+#  ifdef RTLD_BOOTSTRAP
 	  *reloc_addr += map->l_tls_offset - sym->st_value;
-# else
+#  else
 	  /* We know the offset of object the symbol is contained in.
 	     It is a positive value which will be subtracted from the
 	     thread pointer.  To get the variable position in the TLS
@@ -420,13 +425,13 @@
 	      CHECK_STATIC_TLS (map, sym_map);
 	      *reloc_addr += sym_map->l_tls_offset - sym->st_value;
 	    }
-# endif
+#  endif
 	  break;
 	case R_386_TLS_TPOFF:
 	  /* The offset is negative, forward from the thread pointer.  */
-# ifdef RTLD_BOOTSTRAP
+#  ifdef RTLD_BOOTSTRAP
 	  *reloc_addr += sym->st_value - map->l_tls_offset;
-# else
+#  else
 	  /* We know the offset of object the symbol is contained in.
 	     It is a negative value which will be added to the
 	     thread pointer.  */
@@ -435,11 +440,11 @@
 	      CHECK_STATIC_TLS (map, sym_map);
 	      *reloc_addr += sym->st_value - sym_map->l_tls_offset;
 	    }
-# endif
-	  break;
-#endif	/* use TLS */
-
-#ifndef RTLD_BOOTSTRAP
+#  endif
+	  break;
+# endif	/* use TLS */
+
+# ifndef RTLD_BOOTSTRAP
 	case R_386_32:
 	  *reloc_addr += value;
 	  break;
@@ -469,12 +474,12 @@
 	default:
 	  _dl_reloc_bad_type (map, r_type, 0);
 	  break;
-#endif	/* !RTLD_BOOTSTRAP */
+# endif	/* !RTLD_BOOTSTRAP */
 	}
     }
 }
 
-#ifndef RTLD_BOOTSTRAP
+# ifndef RTLD_BOOTSTRAP
 auto inline void
 __attribute__ ((always_inline))
 elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
@@ -488,11 +493,16 @@
     *reloc_addr = map->l_addr + reloc->r_addend;
   else if (r_type != R_386_NONE)
     {
-# ifndef RESOLVE_CONFLICT_FIND_MAP
+#  ifndef RESOLVE_CONFLICT_FIND_MAP
       const Elf32_Sym *const refsym = sym;
-# endif
+#  endif
       struct link_map *sym_map = RESOLVE_MAP (&sym, version, r_type);
       Elf32_Addr value = sym == NULL ? 0 : sym_map->l_addr + sym->st_value;
+
+      if (sym != NULL
+	  && __builtin_expect (ELFW(ST_TYPE) (sym->st_info) == STT_GNU_IFUNC,
+			       0))
+	value = ((Elf32_Addr (*) (void)) value) ();
 
       switch (ELF32_R_TYPE (reloc->r_info))
 	{
@@ -501,7 +511,7 @@
 	case R_386_32:
 	  *reloc_addr = value + reloc->r_addend;
 	  break;
-# ifndef RESOLVE_CONFLICT_FIND_MAP
+#  ifndef RESOLVE_CONFLICT_FIND_MAP
 	  /* Not needed for dl-conflict.c.  */
 	case R_386_PC32:
 	  *reloc_addr = (value + reloc->r_addend - (Elf32_Addr) reloc_addr);
@@ -523,19 +533,19 @@
 	    struct tlsdesc volatile *td =
 	      (struct tlsdesc volatile *)reloc_addr;
 
-# ifndef RTLD_BOOTSTRAP
+#   ifndef RTLD_BOOTSTRAP
 	    if (!sym)
 	      {
 		td->arg = (void*)reloc->r_addend;
 		td->entry = _dl_tlsdesc_undefweak;
 	      }
 	    else
-# endif
+#   endif
 	      {
-# ifndef RTLD_BOOTSTRAP
-#  ifndef SHARED
+#   ifndef RTLD_BOOTSTRAP
+#    ifndef SHARED
 		CHECK_STATIC_TLS (map, sym_map);
-#  else
+#    else
 		if (!TRY_STATIC_TLS (map, sym_map))
 		  {
 		    td->arg = _dl_make_tlsdesc_dynamic
@@ -543,8 +553,8 @@
 		    td->entry = _dl_tlsdesc_dynamic;
 		  }
 		else
-#  endif
-# endif
+#    endif
+#   endif
 		  {
 		    td->arg = (void*)(sym->st_value - sym_map->l_tls_offset
 				      + reloc->r_addend);
@@ -598,7 +608,7 @@
 	  memcpy (reloc_addr_arg, (void *) value,
 		  MIN (sym->st_size, refsym->st_size));
 	  break;
-# endif /* !RESOLVE_CONFLICT_FIND_MAP */
+#  endif /* !RESOLVE_CONFLICT_FIND_MAP */
 	default:
 	  /* We add these checks in the version to relocate ld.so only
 	     if we are still debugging.  */
@@ -607,7 +617,7 @@
 	}
     }
 }
-#endif	/* !RTLD_BOOTSTRAP */
+# endif	/* !RTLD_BOOTSTRAP */
 
 auto inline void
 __attribute ((always_inline))
@@ -619,7 +629,7 @@
   *reloc_addr += l_addr;
 }
 
-#ifndef RTLD_BOOTSTRAP
+# ifndef RTLD_BOOTSTRAP
 auto inline void
 __attribute__ ((always_inline))
 elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc,
@@ -628,7 +638,7 @@
   Elf32_Addr *const reloc_addr = reloc_addr_arg;
   *reloc_addr = l_addr + reloc->r_addend;
 }
-#endif	/* !RTLD_BOOTSTRAP */
+# endif	/* !RTLD_BOOTSTRAP */
 
 auto inline void
 __attribute__ ((always_inline))
@@ -672,12 +682,12 @@
 	  const ElfW(Sym) *const symtab =
 	    (const void *) D_PTR (map, l_info[DT_SYMTAB]);
 
-#ifdef RTLD_BOOTSTRAP
+# ifdef RTLD_BOOTSTRAP
 	  /* The dynamic linker always uses versioning.  */
 	  assert (map->l_info[VERSYMIDX (DT_VERSYM)] != NULL);
-#else
+# else
 	  if (map->l_info[VERSYMIDX (DT_VERSYM)])
-#endif
+# endif
 	    {
 	      const ElfW(Half) *const version =
 		(const void *) D_PTR (map, l_info[VERSYMIDX (DT_VERSYM)]);
@@ -686,18 +696,18 @@
 			       &map->l_versions[ndx],
 			       (void *) (l_addr + r->r_offset));
 	    }
-#ifndef RTLD_BOOTSTRAP
+# ifndef RTLD_BOOTSTRAP
 	  else
 	    elf_machine_rel (map, r, &symtab[ELFW(R_SYM) (r->r_info)], NULL,
 			     (void *) (l_addr + r->r_offset));
-#endif
+# endif
 	}
     }
   else
     _dl_reloc_bad_type (map, r_type, 1);
 }
 
-#ifndef RTLD_BOOTSTRAP
+# ifndef RTLD_BOOTSTRAP
 
 auto inline void
 __attribute__ ((always_inline))
@@ -720,6 +730,6 @@
     _dl_reloc_bad_type (map, r_type, 1);
 }
 
-#endif	/* !RTLD_BOOTSTRAP */
+# endif	/* !RTLD_BOOTSTRAP */
 
 #endif /* RESOLVE_MAP */

Added: fsf/trunk/libc/sysdeps/x86_64/dl-runtime.c
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/dl-runtime.c (added)
+++ fsf/trunk/libc/sysdeps/x86_64/dl-runtime.c Sun Mar 15 00:05:25 2009
@@ -1,0 +1,9 @@
+/* The ABI calls for the PLT stubs to pass the index of the relocation
+   and not its offset.  In _dl_profile_fixup and _dl_call_pltexit we
+   also use the index.  Therefore it is wasteful to compute the offset
+   in the trampoline just to reverse the operation immediately
+   afterwards.  */
+#define reloc_offset reloc_arg * sizeof (PLTREL)
+#define reloc_index  reloc_arg
+
+#include <elf/dl-runtime.c>

Modified: fsf/trunk/libc/sysdeps/x86_64/dl-trampoline.S
==============================================================================
--- fsf/trunk/libc/sysdeps/x86_64/dl-trampoline.S (original)
+++ fsf/trunk/libc/sysdeps/x86_64/dl-trampoline.S Sun Mar 15 00:05:25 2009
@@ -1,5 +1,5 @@
 /* PLT trampolines.  x86-64 version.
-   Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2004, 2005, 2007, 2009 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
@@ -35,10 +35,6 @@
 	movq %r8, 40(%rsp)
 	movq %r9, 48(%rsp)
 	movq 64(%rsp), %rsi	# Copy args pushed by PLT in register.
-	movq %rsi, %r11		# Multiply by 24
-	addq %r11, %rsi
-	addq %r11, %rsi
-	shlq $3, %rsi
 	movq 56(%rsp), %rdi	# %rdi: link_map, %rsi: reloc_offset
 	call _dl_fixup		# Call resolver.
 	movq %rax, %r11		# Save return value
@@ -61,132 +57,165 @@
 	.type _dl_runtime_profile, @function
 	.align 16
 	cfi_startproc
+
 _dl_runtime_profile:
-	subq $88, %rsp
-	cfi_adjust_cfa_offset(104) # Incorporate PLT
-	movq %rax, (%rsp)	# Preserve registers otherwise clobbered.
-	movq %rdx, 8(%rsp)
-	movq %r8, 16(%rsp)
-	movq %r9, 24(%rsp)
-	movq %rcx, 32(%rsp)
-	movq %rsi, 40(%rsp)
-	movq %rdi, 48(%rsp)
-	movq %rbp, 56(%rsp)	# Information for auditors.
-	leaq 104(%rsp), %rax
-	movq %rax, 64(%rsp)
-	leaq 8(%rsp), %rcx
-	movq 104(%rsp), %rdx	# Load return address if needed
-	movq 96(%rsp), %rsi	# Copy args pushed by PLT in register.
-	movq %rsi,%r11		# Multiply by 24
-	addq %r11,%rsi
-	addq %r11,%rsi
-	shlq $3, %rsi
-	movq 88(%rsp), %rdi	# %rdi: link_map, %rsi: reloc_offset
-	leaq 72(%rsp), %r8
+	/* The La_x86_64_regs data structure pointed to by the
+	   fourth paramater must be 16-byte aligned.  This must
+	   be explicitly enforced.  We have the set up a dynamically
+	   sized stack frame.  %rbx points to the top half which
+	   has a fixed size and preserves the original stack pointer.  */
+
+	subq $32, %rsp		# Allocate the local storage.
+	cfi_adjust_cfa_offset(48) # Incorporate PLT
+	movq %rbx, (%rsp)
+	cfi_rel_offset(%rbx, 0)
+
+	/* On the stack:
+		56(%rbx)	parameter #1
+		48(%rbx)	return address
+
+		40(%rbx)	reloc index
+		32(%rbx)	link_map
+
+		24(%rbx)	La_x86_64_regs pointer
+		16(%rbx)	framesize
+		 8(%rbx)	rax
+		  (%rbx)	rbx
+	*/
+
+	movq %rax, 8(%rsp)
+	movq %rsp, %rbx
+	cfi_def_cfa_register(%rbx)
+
+	/* Actively align the La_x86_64_regs structure.  */
+	andq $0xfffffffffffffff0, %rsp
+	subq $192, %rsp		# sizeof(La_x86_64_regs)
+	movq %rsp, 24(%rbx)
+
+	movq %rdx,   (%rsp)	# Fill the La_x86_64_regs structure.
+	movq %r8,   8(%rsp)
+	movq %r9,  16(%rsp)
+	movq %rcx, 24(%rsp)
+	movq %rsi, 32(%rsp)
+	movq %rdi, 40(%rsp)
+	movq %rbp, 48(%rsp)
+	leaq 48(%rbx), %rax
+	movq %rax, 56(%rsp)
+	movaps %xmm0,  64(%rsp)
+	movaps %xmm1,  80(%rsp)
+	movaps %xmm2,  96(%rsp)
+	movaps %xmm3, 112(%rsp)
+	movaps %xmm4, 128(%rsp)
+	movaps %xmm5, 144(%rsp)
+	movaps %xmm7, 160(%rsp)
+
+	movq %rsp, %rcx		# La_x86_64_regs pointer to %rcx.
+	movq 48(%rbx), %rdx	# Load return address if needed.
+	movq 40(%rbx), %rsi	# Copy args pushed by PLT in register.
+	movq 32(%rbx), %rdi	# %rdi: link_map, %rsi: reloc_offset
+	leaq 16(%rbx), %r8
 	call _dl_profile_fixup	# Call resolver.
-	movq %rax, %r11		# Save return value
-	movq 8(%rsp), %rdx	# Get back register content.
-	movq 16(%rsp), %r8
-	movq 24(%rsp), %r9
-	movq (%rsp),%rax
-	movq 72(%rsp), %r10
+
+	movq %rax, %r11		# Save return value.
+
+	movq 8(%rbx), %rax	# Get back register content.
+	movq      (%rsp), %rdx
+	movq     8(%rsp), %r8
+	movq    16(%rsp), %r9
+	movaps  64(%rsp), %xmm0
+	movaps  80(%rsp), %xmm1
+	movaps  96(%rsp), %xmm2
+	movaps 112(%rsp), %xmm3
+	movaps 128(%rsp), %xmm4
+	movaps 144(%rsp), %xmm5
+	movaps 160(%rsp), %xmm7
+
+	movq 16(%rbx), %r10	# Anything in framesize?
 	testq %r10, %r10
 	jns 1f
-	movq 32(%rsp), %rcx
-	movq 40(%rsp), %rsi
-	movq 48(%rsp), %rdi
-	addq $104,%rsp		# Adjust stack
-	cfi_adjust_cfa_offset (-104)
+
+	/* There's nothing in the frame size, so there
+	   will be no call to the _dl_call_pltexit. */
+
+	movq 24(%rsp), %rcx	# Get back registers content.
+	movq 32(%rsp), %rsi
+	movq 40(%rsp), %rdi
+
+	movq %rbx, %rsp
+	movq (%rsp), %rbx
+	cfi_restore(rbx)
+	cfi_def_cfa_register(%rsp)
+
+	addq $48, %rsp		# Adjust the stack to the return value
+				# (eats the reloc index and link_map)
+	cfi_adjust_cfa_offset(-48)
 	jmp *%r11		# Jump to function address.
 
-	/*
-	    +104     return address
-	    +96     PLT2
-	    +88     PLT1
-	    +80     free
-	    +72     free
-	    +64     %rsp
-	    +56     %rbp
-	    +48     %rdi
-	    +40     %rsi
-	    +32     %rcx
-	    +24     %r9
-	    +16     %r8
-	    +8      %rdx
-	   %rsp     %rax
-	*/
-	cfi_adjust_cfa_offset (104)
-1:	movq %rbx, 72(%rsp)
-	cfi_rel_offset (rbx, 72)
-	leaq 112(%rsp), %rsi
-	movq %rsp, %rbx
-	cfi_def_cfa_register (%rbx)
-	movq %r10, %rcx
+1:
+	cfi_adjust_cfa_offset(48)
+	cfi_rel_offset(%rbx, 0)
+	cfi_def_cfa_register(%rbx)
+
+	/* At this point we need to prepare new stack for the function
+	   which has to be called.  We copy the original stack to a
+	   temporary buffer of the size specified by the 'framesize'
+	   returned from _dl_profile_fixup */
+
+	leaq 56(%rbx), %rsi	# stack
 	addq $8, %r10
 	andq $0xfffffffffffffff0, %r10
+	movq %r10, %rcx
 	subq %r10, %rsp
 	movq %rsp, %rdi
 	shrq $3, %rcx
 	rep
 	movsq
-	movq 32(%rbx), %rcx
-	movq 40(%rbx), %rsi
-	movq 48(%rbx), %rdi
+
+	movq 24(%rdi), %rcx	# Get back register content.
+	movq 32(%rdi), %rsi
+	movq 40(%rdi), %rdi
+
 	call *%r11
-	movq %rbx, %rsp
-	cfi_def_cfa_register (%rsp)
-	subq $72, %rsp
-	cfi_adjust_cfa_offset (72)
-	movq %rsp, %rcx
-	movq %rax, (%rcx)
+
+	mov 24(%rbx), %rsp	# Drop the copied stack content
+
+	/* Now we have to prepare the La_x86_64_retval structure for the
+	   _dl_call_pltexit.  The La_x86_64_regs is being pointed by rsp now,
+	   so we just need to allocate the sizeof(La_x86_64_retval) space on
+	   the stack, since the alignment has already been taken care of. */
+
+	subq $80, %rsp		# sizeof(La_x86_64_retval)
+	movq %rsp, %rcx		# La_x86_64_retval argument to %rcx.
+
+	movq %rax, (%rcx)	# Fill in the La_x86_64_retval structure.
 	movq %rdx, 8(%rcx)
-	/* Even though the stack is correctly aligned to allow using movaps
-	   we use movups.  Some callers might provide an incorrectly aligned
-	   stack and we do not want to have it blow up here.  */
-	movups %xmm0, 16(%rcx)
-	movups %xmm1, 32(%rcx)
+	movaps %xmm0, 16(%rcx)
+	movaps %xmm1, 32(%rcx)
 	fstpt 48(%rcx)
 	fstpt 64(%rcx)
-	/*
-	    +176    return address
-	    +168    PLT2
-	    +160    PLT1
-	    +152    free
-	    +144    free
-	    +136    %rsp
-	    +128    %rbp
-	    +120    %rdi
-	    +112    %rsi
-	    +104    %rcx
-	    +96     %r9
-	    +88     %r8
-	    +80     %rdx
-	    +64     %st1 result
-	    +48     %st result
-	    +32     %xmm1 result
-	    +16     %xmm0 result
-	    +8      %rdx result
-	   %rsp     %rax result
-	*/
-	leaq 80(%rsp), %rdx
-	movq 144(%rsp), %rbx
-	cfi_restore (rbx)
-	movq 168(%rsp), %rsi	# Copy args pushed by PLT in register.
-	movq %rsi,%r11		# Multiply by 24
-	addq %r11,%rsi
-	addq %r11,%rsi
-	shlq $3, %rsi
-	movq 160(%rsp), %rdi	# %rdi: link_map, %rsi: reloc_offset
+
+	movq 24(%rbx), %rdx	# La_x86_64_regs argument to %rdx.
+	movq 40(%rbx), %rsi	# Copy args pushed by PLT in register.
+        movq 32(%rbx), %rdi	# %rdi: link_map, %rsi: reloc_offset
 	call _dl_call_pltexit
-	movq (%rsp), %rax
+
+	movq  (%rsp), %rax	# Restore return registers.
 	movq 8(%rsp), %rdx
-	movups 16(%rsp), %xmm0
-	movups 32(%rsp), %xmm1
+	movaps 16(%rsp), %xmm0
+	movaps 32(%rsp), %xmm1
 	fldt 64(%rsp)
 	fldt 48(%rsp)
-	addq $176, %rsp
-	cfi_adjust_cfa_offset (-176)
+
+	movq %rbx, %rsp
+	movq  (%rsp), %rbx
+	cfi_restore(rbx)
+	cfi_def_cfa_register(%rsp)
+
+	addq $48, %rsp		# Adjust the stack to the return value
+				# (eats the reloc index and link_map)
+	cfi_adjust_cfa_offset(-48)
 	retq
+
 	cfi_endproc
 	.size _dl_runtime_profile, .-_dl_runtime_profile
 #endif