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

[Commits] r18097 - in /fsf/trunk/ports: ./ sysdeps/hppa/ sysdeps/hppa/elf/ sysdeps/m68k/m680x0/fpu/ sysdeps/unix/sysv/linux/arm/



Author: eglibc
Date: Wed Apr 18 00:01:45 2012
New Revision: 18097

Log:
Import glibc-ports-mainline for 2012-04-18

Added:
    fsf/trunk/ports/sysdeps/hppa/crti.S
    fsf/trunk/ports/sysdeps/hppa/crtn.S
    fsf/trunk/ports/sysdeps/hppa/dl-fptr.c
    fsf/trunk/ports/sysdeps/hppa/dl-irel.h
    fsf/trunk/ports/sysdeps/hppa/entry.h
    fsf/trunk/ports/sysdeps/hppa/start.S
    fsf/trunk/ports/sysdeps/m68k/m680x0/fpu/e_ilogb.c
    fsf/trunk/ports/sysdeps/m68k/m680x0/fpu/e_ilogbf.c
    fsf/trunk/ports/sysdeps/m68k/m680x0/fpu/e_ilogbl.c
Removed:
    fsf/trunk/ports/sysdeps/hppa/elf/
    fsf/trunk/ports/sysdeps/m68k/m680x0/fpu/s_ilogb.c
    fsf/trunk/ports/sysdeps/m68k/m680x0/fpu/s_ilogbf.c
    fsf/trunk/ports/sysdeps/m68k/m680x0/fpu/s_ilogbl.c
Modified:
    fsf/trunk/ports/ChangeLog.arm
    fsf/trunk/ports/ChangeLog.hppa
    fsf/trunk/ports/ChangeLog.m68k
    fsf/trunk/ports/sysdeps/hppa/configure
    fsf/trunk/ports/sysdeps/hppa/configure.in
    fsf/trunk/ports/sysdeps/hppa/dl-fptr.h
    fsf/trunk/ports/sysdeps/hppa/dl-machine.h
    fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/ldsodefs.h

Modified: fsf/trunk/ports/ChangeLog.arm
==============================================================================
--- fsf/trunk/ports/ChangeLog.arm (original)
+++ fsf/trunk/ports/ChangeLog.arm Wed Apr 18 00:01:45 2012
@@ -1,3 +1,8 @@
+2012-04-16  Andreas Jaeger  <aj@xxxxxxx>
+
+	* sysdeps/unix/sysv/linux/arm/ldsodefs.h: Undefine
+	MORE_ELF_HEADER_DATA to avoid warnings about redefinition.
+
 2012-03-28  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
 
 	* sysdeps/unix/sysv/linux/arm/bits/mman.h (MAP_STACK): Define.

Modified: fsf/trunk/ports/ChangeLog.hppa
==============================================================================
--- fsf/trunk/ports/ChangeLog.hppa (original)
+++ fsf/trunk/ports/ChangeLog.hppa Wed Apr 18 00:01:45 2012
@@ -1,3 +1,28 @@
+2012-04-17  Carlos O'Donell  <carlos@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/hppa/dl-irel.h: New file.
+
+2012-04-17  Carlos O'Donell  <carlos@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/hppa/dl-fptr.h: Add prototype for _dl_fptr_init.
+	* sysdeps/hppa/dl-fptr.c: New file.
+	* sysdeps/hppa/dl-machine.h (ELF_MACHINE_BEFORE_RTLD_RELOC):
+	Call _dl_fptr_init.
+
+2012-04-17  Carlos O'Donell  <carlos@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/hppa/elf/configure: Removed file.
+	* sysdeps/hppa/elf/configure.in: Move to...
+	* sysdeps/hppa/configure.in: ... here.
+	* sysdeps/hppa/configure: Regenerate.
+	* sysdeps/hppa/elf/initfini.c: Removed file.
+	* sysdeps/hppa/crti.S: New file.
+	* sysdeps/hppa/crtn.S: New file.
+	* sysdeps/hppa/elf/entry.h: Moved to ...
+	* sysdeps/hppa/entry.h: ... here.
+	* sysdeps/hppa/elf/start.S: Move to ...
+	* sysdeps/hppa/start.S: ... here.
+
 2012-03-22  Carlos O'Donell  <carlos@xxxxxxxxxxxxxxxx>
 
 	[BZ #6730]

Modified: fsf/trunk/ports/ChangeLog.m68k
==============================================================================
--- fsf/trunk/ports/ChangeLog.m68k (original)
+++ fsf/trunk/ports/ChangeLog.m68k Wed Apr 18 00:01:45 2012
@@ -1,3 +1,12 @@
+2012-04-17  Andreas Schwab  <schwab@xxxxxxxxxxxxxx>
+
+	* sysdeps/m68k/m680x0/fpu/e_ilogb.c: Renamed from s_ilogb.c.
+	Define __ieee754_ilogb instead of __ilogb.
+	* sysdeps/m68k/m680x0/fpu/e_ilogbf.c: Renamed from s_ilogbf.c and
+	adjusted.
+	* sysdeps/m68k/m680x0/fpu/e_ilogbl.c: Renamed from s_ilogbl.c and
+	adjusted.
+
 2012-03-28  Andreas Schwab  <schwab@xxxxxxxxxxxxxx>
 
 	* sysdeps/unix/sysv/linux/m68k/bits/mman.h (MAP_STACK)

Modified: fsf/trunk/ports/sysdeps/hppa/configure
==============================================================================
--- fsf/trunk/ports/sysdeps/hppa/configure (original)
+++ fsf/trunk/ports/sysdeps/hppa/configure Wed Apr 18 00:01:45 2012
@@ -84,7 +84,7 @@
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for assembler line separator" >&5
 $as_echo_n "checking for assembler line separator... " >&6; }
-if test "${libc_cv_asm_line_sep+set}" = set; then :
+if ${libc_cv_asm_line_sep+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat > conftest.s <<EOF
@@ -113,3 +113,59 @@
 #define ASM_LINE_SEP $libc_cv_asm_line_sep
 _ACEOF
 
+
+# Check for support of thread-local storage handling in assembler and
+# linker.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for hppa TLS support" >&5
+$as_echo_n "checking for hppa TLS support... " >&6; }
+if ${libc_cv_hppa_tls+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat > conftest.s <<\EOF
+; Setup tls data
+.section ".tdata","awT",@progbits
+foo:	.data	32
+	.text
+; Test general dyanmic relocations
+test0:
+	addil 	LT'foo-$tls_gdidx$, %r19
+	ldo 	RT'foo-$tls_gdidx$(%r1), %r26
+	b 	__tls_get_addr
+	nop
+; Test local dynamic relocations
+test1:
+	addil 	LT'foo-$tls_ldidx$, %r19
+	b 	__tls_get_addr
+	ldo 	RT'foo-$tls_ldidx$(%r1), %r26
+	ldo 	RR'foo-$tls_dtpoff$(%r1), %r25
+	; More variables can be loaded...
+; Test initial exec reloctiosn
+test2:
+	mfctl 	%cr27, %r26
+	addil 	LT'foo-$tls_ieoff$, %r19
+	ldw 	RT'foo-$tls_ieoff$(%r1), %r25
+	add 	%r26, %r25, %r24
+; Test local exec relocations
+test3:
+	mfctl 	%cr27, %r26
+	addil 	LR'foo-$tls_leoff$, %r26
+	ldo 	RR'foo-$tls_leoff$(%r1), %r25
+; Done all the TLS tests.
+EOF
+if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+  libc_cv_hppa_tls=yes
+else
+  libc_cv_hppa_tls=no
+fi
+rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_hppa_tls" >&5
+$as_echo "$libc_cv_hppa_tls" >&6; }
+if test $libc_cv_hppa_tls = no; then
+  as_fn_error $? "the assembler must support TLS" "$LINENO" 5
+fi

Modified: fsf/trunk/ports/sysdeps/hppa/configure.in
==============================================================================
--- fsf/trunk/ports/sysdeps/hppa/configure.in (original)
+++ fsf/trunk/ports/sysdeps/hppa/configure.in Wed Apr 18 00:01:45 2012
@@ -19,3 +19,48 @@
 fi
 rm -f conftest*])
 AC_DEFINE_UNQUOTED(ASM_LINE_SEP, $libc_cv_asm_line_sep)
+
+# Check for support of thread-local storage handling in assembler and
+# linker.
+AC_CACHE_CHECK(for hppa TLS support, libc_cv_hppa_tls, [dnl
+cat > conftest.s <<\EOF
+; Setup tls data
+.section ".tdata","awT",@progbits
+foo:	.data	32 
+	.text
+; Test general dyanmic relocations
+test0:
+	addil 	LT'foo-$tls_gdidx$, %r19	
+	ldo 	RT'foo-$tls_gdidx$(%r1), %r26
+	b 	__tls_get_addr
+	nop
+; Test local dynamic relocations
+test1:
+	addil 	LT'foo-$tls_ldidx$, %r19
+	b 	__tls_get_addr
+	ldo 	RT'foo-$tls_ldidx$(%r1), %r26
+	ldo 	RR'foo-$tls_dtpoff$(%r1), %r25
+	; More variables can be loaded...
+; Test initial exec reloctiosn
+test2:
+	mfctl 	%cr27, %r26
+	addil 	LT'foo-$tls_ieoff$, %r19
+	ldw 	RT'foo-$tls_ieoff$(%r1), %r25
+	add 	%r26, %r25, %r24
+; Test local exec relocations
+test3:
+	mfctl 	%cr27, %r26
+	addil 	LR'foo-$tls_leoff$, %r26 
+	ldo 	RR'foo-$tls_leoff$(%r1), %r25
+; Done all the TLS tests.
+EOF
+dnl
+if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
+  libc_cv_hppa_tls=yes
+else
+  libc_cv_hppa_tls=no
+fi
+rm -f conftest*])
+if test $libc_cv_hppa_tls = no; then
+  AC_MSG_ERROR([the assembler must support TLS])
+fi

Added: fsf/trunk/ports/sysdeps/hppa/crti.S
==============================================================================
--- fsf/trunk/ports/sysdeps/hppa/crti.S (added)
+++ fsf/trunk/ports/sysdeps/hppa/crti.S Wed Apr 18 00:01:45 2012
@@ -1,0 +1,80 @@
+/* Special .init and .fini section support for HPPA
+   Copyright (C) 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+/* 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.  The symbols _init and _fini are
+   magic and cause the linker to emit DT_INIT and DT_FINI.  */
+
+#include <libc-symbols.h>
+#include <sysdep.h>
+
+#ifndef PREINIT_FUNCTION
+# define PREINIT_FUNCTION __gmon_start__
+#endif
+
+#ifndef PREINIT_FUNCTION_WEAK
+# define PREINIT_FUNCTION_WEAK 1
+#endif
+
+/* _init prologue.  */
+	.section .init, "ax", %progbits
+	.align 4
+	.globl _init
+	.type _init,@function
+_init:
+	stw	%rp,-20(%sp)
+	stwm	%r4,64(%sp)
+	stw	%r19,-32(%sp)
+#if PREINIT_FUNCTION_WEAK
+	bl	PREINIT_FUNCTION,%rp
+	copy	%r19,%r4	/* delay slot */
+#else
+	bl	PREINIT_FUNCTION,%rp
+	copy	%r19,%r4	/* delay slot */
+#endif
+	copy	%r4,%r19
+
+/* _fini prologue.  */
+        .section .fini,"ax",%progbits
+	.align 4
+	.globl _fini
+	.type _fini,@function
+_fini:
+	stw	%rp,-20(%sp)
+	stwm	%r4,64(%sp)
+	stw	%r19,-32(%sp)
+	copy	%r19,%r4
+

Added: fsf/trunk/ports/sysdeps/hppa/crtn.S
==============================================================================
--- fsf/trunk/ports/sysdeps/hppa/crtn.S (added)
+++ fsf/trunk/ports/sysdeps/hppa/crtn.S Wed Apr 18 00:01:45 2012
@@ -1,0 +1,88 @@
+/* Special .init and .fini section support for HPPA
+   Copyright (C) 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, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <sysdep.h>
+
+/* crtn.S puts function epilogues in the .init and .fini sections
+   corresponding to the prologues in crti.S. */
+
+/* Note that we cannot have a weak undefined __gmon_start__, because
+   that would require this to be PIC, and the linker is currently not
+   able to generate a proper procedure descriptor for _init.  Sad but
+   true.  Anyway, HPPA is one of those horrible architectures where
+   making the comparison and indirect call is quite expensive (see the
+   comment in sysdeps/generic/initfini.c). */
+        .text
+        .align 4
+        .weak   __gmon_start__
+        .type    __gmon_start__,@function
+__gmon_start__:
+	.proc
+	.callinfo
+	.entry
+        bv,n %r0(%r2)
+	.exit
+	.procend
+
+/* Here is the tail end of _init.  We put __gmon_start before this so
+   that the assembler creates the .PARISC.unwind section for us, ie.
+   with the right attributes.  */
+	.section .init, "ax", @progbits
+	ldw	-84(%sp),%rp
+	copy	%r4,%r19
+	bv	%r0(%rp)
+_end_init:
+	ldwm	-64(%sp),%r4
+
+/* Our very own unwind info, because the assembler can't handle
+   functions split into two or more pieces.  */
+	.section .PARISC.unwind
+	.extern _init
+	.word	_init, _end_init
+	.byte	0x08, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08
+
+/* Here is the tail end of _fini.  */
+	.section .fini, "ax", @progbits
+	ldw	-84(%sp),%rp
+	copy	%r4,%r19
+	bv	%r0(%rp)
+_end_fini:
+	ldwm	-64(%sp),%r4
+
+	.section .PARISC.unwind
+	.extern _fini
+	.word	_fini, _end_fini
+	.byte	0x08, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08
+

Added: fsf/trunk/ports/sysdeps/hppa/dl-fptr.c
==============================================================================
--- fsf/trunk/ports/sysdeps/hppa/dl-fptr.c (added)
+++ fsf/trunk/ports/sysdeps/hppa/dl-fptr.c Wed Apr 18 00:01:45 2012
@@ -1,0 +1,337 @@
+/* Manage function descriptors.  Generic version.
+   Copyright (C) 1999-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.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+#include <libintl.h>
+#include <unistd.h>
+#include <string.h>
+#include <sys/param.h>
+#include <sys/mman.h>
+#include <link.h>
+#include <ldsodefs.h>
+#include <elf/dynamic-link.h>
+#include <dl-fptr.h>
+#include <atomic.h>
+
+#ifndef ELF_MACHINE_BOOT_FPTR_TABLE_LEN
+/* ELF_MACHINE_BOOT_FPTR_TABLE_LEN should be greater than the number of
+   dynamic symbols in ld.so.  */
+# define ELF_MACHINE_BOOT_FPTR_TABLE_LEN 256
+#endif
+
+#ifndef ELF_MACHINE_LOAD_ADDRESS
+# error "ELF_MACHINE_LOAD_ADDRESS is not defined."
+#endif
+
+#ifndef COMPARE_AND_SWAP
+# define COMPARE_AND_SWAP(ptr, old, new) \
+  (catomic_compare_and_exchange_bool_acq (ptr, new, old) == 0)
+#endif
+
+ElfW(Addr) _dl_boot_fptr_table [ELF_MACHINE_BOOT_FPTR_TABLE_LEN];
+
+static struct local
+  {
+    struct fdesc_table *root;
+    struct fdesc *free_list;
+    unsigned int npages;		/* # of pages to allocate */
+    /* the next to members MUST be consecutive! */
+    struct fdesc_table boot_table;
+    struct fdesc boot_fdescs[1024];
+  }
+local =
+  {
+#ifdef SHARED
+    /* Address of .boot_table is not known until runtime.  */
+    .root = 0,
+#else
+    .root = &local.boot_table,
+#endif
+    .npages = 2,
+    .boot_table =
+      {
+	.len = sizeof (local.boot_fdescs) / sizeof (local.boot_fdescs[0]),
+	.first_unused = 0
+      }
+  };
+
+/* Create a new fdesc table and return a pointer to the first fdesc
+   entry.  The fdesc lock must have been acquired already.  */
+
+static struct fdesc_table *
+new_fdesc_table (struct local *l, size_t *size)
+{
+  size_t old_npages = l->npages;
+  size_t new_npages = old_npages + old_npages;
+  struct fdesc_table *new_table;
+
+  /* If someone has just created a new table, we return NULL to tell
+     the caller to use the new table.  */
+  if (! COMPARE_AND_SWAP (&l->npages, old_npages, new_npages))
+    return (struct fdesc_table *) NULL;
+
+  *size = old_npages * GLRO(dl_pagesize);
+  new_table = __mmap (NULL, *size,
+		      PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE, -1, 0);
+  if (new_table == MAP_FAILED)
+    _dl_signal_error (errno, NULL, NULL,
+		      N_("cannot map pages for fdesc table"));
+
+  new_table->len
+    = (*size - sizeof (*new_table)) / sizeof (struct fdesc);
+  new_table->first_unused = 1;
+  return new_table;
+}
+
+/* Must call _dl_fptr_init before using any other function.  */
+void 
+_dl_fptr_init (void)
+{
+  struct local *l;
+
+  ELF_MACHINE_LOAD_ADDRESS (l, local);
+  l->root = &l->boot_table;
+}
+
+static ElfW(Addr)
+make_fdesc (ElfW(Addr) ip, ElfW(Addr) gp)
+{
+  struct fdesc *fdesc = NULL;
+  struct fdesc_table *root;
+  unsigned int old;
+  struct local *l;
+
+  ELF_MACHINE_LOAD_ADDRESS (l, local);
+
+ retry:
+  root = l->root;
+  while (1)
+    {
+      old = root->first_unused;
+      if (old >= root->len)
+	break;
+      else if (COMPARE_AND_SWAP (&root->first_unused, old, old + 1))
+	{
+	  fdesc = &root->fdesc[old];
+	  goto install;
+	}
+    }
+
+  if (l->free_list)
+    {
+      /* Get it from free-list.  */
+      do
+	{
+	  fdesc = l->free_list;
+	  if (fdesc == NULL)
+	    goto retry;
+	}
+      while (! COMPARE_AND_SWAP ((ElfW(Addr) *) &l->free_list,
+				 (ElfW(Addr)) fdesc, fdesc->ip));
+    }
+  else
+    {
+      /* Create a new fdesc table.  */
+      size_t size;
+      struct fdesc_table *new_table = new_fdesc_table (l, &size);
+
+      if (new_table == NULL)
+	goto retry;
+
+      new_table->next = root;
+      if (! COMPARE_AND_SWAP ((ElfW(Addr) *) &l->root,
+			      (ElfW(Addr)) root,
+			      (ElfW(Addr)) new_table))
+	{
+	  /* Someone has just installed a new table. Return NULL to
+	     tell the caller to use the new table.  */
+	  __munmap (new_table, size);
+	  goto retry;
+	}
+
+      /* Note that the first entry was reserved while allocating the
+	 memory for the new page.  */
+      fdesc = &new_table->fdesc[0];
+    }
+
+ install:
+  fdesc->ip = ip;
+  fdesc->gp = gp;
+
+  return (ElfW(Addr)) fdesc;
+}
+
+
+static inline ElfW(Addr) * __attribute__ ((always_inline))
+make_fptr_table (struct link_map *map)
+{
+  const ElfW(Sym) *symtab
+    = (const void *) D_PTR (map, l_info[DT_SYMTAB]);
+  const char *strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]);
+  ElfW(Addr) *fptr_table;
+  size_t size;
+  size_t len;
+
+  /* XXX Apparently the only way to find out the size of the dynamic
+     symbol section is to assume that the string table follows right
+     afterwards...  */
+  len = ((strtab - (char *) symtab)
+	 / map->l_info[DT_SYMENT]->d_un.d_val);
+  size = ((len * sizeof (fptr_table[0]) + GLRO(dl_pagesize) - 1)
+	  & -GLRO(dl_pagesize));
+  /* XXX We don't support here in the moment systems without MAP_ANON.
+     There probably are none for IA-64.  In case this is proven wrong
+     we will have to open /dev/null here and use the file descriptor
+     instead of the hard-coded -1.  */
+  fptr_table = __mmap (NULL, size,
+		       PROT_READ | PROT_WRITE, MAP_ANON | MAP_PRIVATE,
+		       -1, 0);
+  if (fptr_table == MAP_FAILED)
+    _dl_signal_error (errno, NULL, NULL,
+		      N_("cannot map pages for fptr table"));
+
+  if (COMPARE_AND_SWAP ((ElfW(Addr) *) &map->l_mach.fptr_table,
+			(ElfW(Addr)) NULL, (ElfW(Addr)) fptr_table))
+    map->l_mach.fptr_table_len = len;
+  else
+    __munmap (fptr_table, len * sizeof (fptr_table[0]));
+
+  return map->l_mach.fptr_table;
+}
+
+
+ElfW(Addr)
+_dl_make_fptr (struct link_map *map, const ElfW(Sym) *sym,
+	       ElfW(Addr) ip)
+{
+  ElfW(Addr) *ftab = map->l_mach.fptr_table;
+  const ElfW(Sym) *symtab;
+  Elf_Symndx symidx;
+  struct local *l;
+
+  if (__builtin_expect (ftab == NULL, 0))
+    ftab = make_fptr_table (map);
+
+  symtab = (const void *) D_PTR (map, l_info[DT_SYMTAB]);
+  symidx = sym - symtab;
+
+  if (symidx >= map->l_mach.fptr_table_len)
+    _dl_signal_error (0, NULL, NULL,
+		      N_("internal error: symidx out of range of fptr table"));
+
+  while (ftab[symidx] == 0)
+    {
+      /* GOT has already been relocated in elf_get_dynamic_info -
+	 don't try to relocate it again.  */
+      ElfW(Addr) fdesc
+	= make_fdesc (ip, map->l_info[DT_PLTGOT]->d_un.d_ptr);
+
+      if (__builtin_expect (COMPARE_AND_SWAP (&ftab[symidx], (ElfW(Addr)) NULL,
+					      fdesc), 1))
+	{
+	  /* Noone has updated the entry and the new function
+	     descriptor has been installed.  */
+#if 0
+	  const char *strtab
+	    = (const void *) D_PTR (map, l_info[DT_STRTAB]);
+
+	  ELF_MACHINE_LOAD_ADDRESS (l, local);
+	  if (l->root != &l->boot_table
+	      || l->boot_table.first_unused > 20)
+	    _dl_debug_printf ("created fdesc symbol `%s' at %lx\n",
+			      strtab + sym->st_name, ftab[symidx]);
+#endif
+	  break;
+	}
+      else
+	{
+	  /* We created a duplicated function descriptor. We put it on
+	     free-list.  */
+	  struct fdesc *f = (struct fdesc *) fdesc;
+
+	  ELF_MACHINE_LOAD_ADDRESS (l, local);
+
+	  do
+	    f->ip = (ElfW(Addr)) l->free_list;
+	  while (! COMPARE_AND_SWAP ((ElfW(Addr) *) &l->free_list,
+				     f->ip, fdesc));
+	}
+    }
+
+  return ftab[symidx];
+}
+
+
+void
+_dl_unmap (struct link_map *map)
+{
+  ElfW(Addr) *ftab = map->l_mach.fptr_table;
+  struct fdesc *head = NULL, *tail = NULL;
+  size_t i;
+
+  __munmap ((void *) map->l_map_start,
+	    map->l_map_end - map->l_map_start);
+
+  if (ftab == NULL)
+    return;
+
+  /* String together the fdesc structures that are being freed.  */
+  for (i = 0; i < map->l_mach.fptr_table_len; ++i)
+    {
+      if (ftab[i])
+	{
+	  *(struct fdesc **) ftab[i] = head;
+	  head = (struct fdesc *) ftab[i];
+	  if (tail == NULL)
+	    tail = head;
+	}
+    }
+
+  /* Prepend the new list to the free_list: */
+  if (tail)
+    do
+      tail->ip = (ElfW(Addr)) local.free_list;
+    while (! COMPARE_AND_SWAP ((ElfW(Addr) *) &local.free_list,
+			       tail->ip, (ElfW(Addr)) head));
+
+  __munmap (ftab, (map->l_mach.fptr_table_len
+		   * sizeof (map->l_mach.fptr_table[0])));
+
+  map->l_mach.fptr_table = NULL;
+}
+
+
+ElfW(Addr)
+_dl_lookup_address (const void *address)
+{
+  ElfW(Addr) addr = (ElfW(Addr)) address;
+  struct fdesc_table *t;
+  unsigned long int i;
+
+  for (t = local.root; t != NULL; t = t->next)
+    {
+      i = (struct fdesc *) addr - &t->fdesc[0];
+      if (i < t->first_unused && addr == (ElfW(Addr)) &t->fdesc[i])
+	{
+	  addr = t->fdesc[i].ip;
+	  break;
+	}
+    }
+
+  return addr;
+}

Modified: fsf/trunk/ports/sysdeps/hppa/dl-fptr.h
==============================================================================
--- fsf/trunk/ports/sysdeps/hppa/dl-fptr.h (original)
+++ fsf/trunk/ports/sysdeps/hppa/dl-fptr.h Wed Apr 18 00:01:45 2012
@@ -1,5 +1,5 @@
 /* Function descriptors.  HPPA version.
-   Copyright (C) 2003, 2009 Free Software Foundation, Inc.
+   Copyright (C) 2003-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
@@ -21,6 +21,9 @@
 
 #include <sysdeps/generic/dl-fptr.h>
 
+/* Initialize function pointer code. Call before relocation processing.  */
+extern void _dl_fptr_init (void);
+
 /* There are currently 33 dynamic symbols in ld.so.
    ELF_MACHINE_BOOT_FPTR_TABLE_LEN needs to be at least that big.  */
 #define ELF_MACHINE_BOOT_FPTR_TABLE_LEN 64	

Added: fsf/trunk/ports/sysdeps/hppa/dl-irel.h
==============================================================================
--- fsf/trunk/ports/sysdeps/hppa/dl-irel.h (added)
+++ fsf/trunk/ports/sysdeps/hppa/dl-irel.h Wed Apr 18 00:01:45 2012
@@ -1,0 +1,47 @@
+/* Machine-dependent ELF indirect relocation inline functions.
+   HP-PARISC version.
+   Copyright (C) 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.
+
+   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.  */
+
+#ifndef _DL_IREL_H
+#define _DL_IREL_H
+
+#include <stdio.h>
+#include <unistd.h>
+#include <dl-fptr.h>
+
+#define ELF_MACHINE_IREL	1
+
+/* Implement enough to get the build going again.  */
+#warning "NEED STT_GNU_IFUNC IMPLEMENTATION"
+
+static inline struct fdesc 
+__attribute ((always_inline))
+elf_ifunc_invoke (uintptr_t addr)
+{
+  return ((struct fdesc) {0, 0});
+}
+
+static inline void
+__attribute ((always_inline))
+elf_irel (const Elf32_Rel *reloc)
+{
+  return;
+}
+
+#endif /* dl-irel.h */

Modified: fsf/trunk/ports/sysdeps/hppa/dl-machine.h
==============================================================================
--- fsf/trunk/ports/sysdeps/hppa/dl-machine.h (original)
+++ fsf/trunk/ports/sysdeps/hppa/dl-machine.h Wed Apr 18 00:01:45 2012
@@ -1,6 +1,5 @@
 /* Machine-dependent ELF dynamic relocation inline functions.  PA-RISC version.
-   Copyright (C) 1995-1997,1999-2003,2011
-	Free Software Foundation, Inc.
+   Copyright (C) 1995-2012 Free Software Foundation, Inc.
    Contributed by David Huggins-Daines <dhd@xxxxxxxxxx>
    This file is part of the GNU C Library.
 
@@ -63,7 +62,8 @@
 }
 
 #define ELF_MACHINE_BEFORE_RTLD_RELOC(dynamic_info)		\
-	__hppa_init_bootstrap_fdesc_table (&bootstrap_map);
+	__hppa_init_bootstrap_fdesc_table (&bootstrap_map);	\
+	_dl_fptr_init();
 
 /* Return nonzero iff ELF header is compatible with the running host.  */
 static inline int

Added: fsf/trunk/ports/sysdeps/hppa/entry.h
==============================================================================
--- fsf/trunk/ports/sysdeps/hppa/entry.h (added)
+++ fsf/trunk/ports/sysdeps/hppa/entry.h Wed Apr 18 00:01:45 2012
@@ -1,0 +1,10 @@
+#ifndef __ASSEMBLY__
+extern void _start (void);
+#endif
+
+/* The function's entry point is stored in the first word of the
+   function descriptor (plabel) of _start().  */
+#define ENTRY_POINT __canonicalize_funcptr_for_compare(_start)
+
+/* We have to provide a special declaration.  */
+#define ENTRY_POINT_DECL(class) class void _start (void);

Added: fsf/trunk/ports/sysdeps/hppa/start.S
==============================================================================
--- fsf/trunk/ports/sysdeps/hppa/start.S (added)
+++ fsf/trunk/ports/sysdeps/hppa/start.S Wed Apr 18 00:01:45 2012
@@ -1,0 +1,143 @@
+/* ELF startup code for HPPA.
+   Copyright (C) 2002, 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
+   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, see
+   <http://www.gnu.org/licenses/>.  */
+
+	.import main, code
+	.import $global$, data
+	.import __libc_start_main, code
+	.import __libc_csu_fini, code
+	.import __libc_csu_init, code
+
+	/* Have the linker create plabel words so we get PLABEL32 
+	   relocs and not 21/14.  The use of 21/14 relocs is only 
+	   supported in the latest dynamic linker.  */
+	.section	.rodata
+	.align 4
+.Lpmain:
+	.word P%main
+.Lp__libc_start_main:
+	.word P%__libc_start_main
+.Lp__libc_csu_fini:
+	.word P%__libc_csu_fini
+.Lp__libc_csu_init:
+	.word P%__libc_csu_init
+
+	.text
+	.align 4
+	.globl _start
+	.export _start, ENTRY
+	.type _start,@function
+_start:
+	/* At entry to the function we have:
+
+		r26 - Unused
+		r25 - argc
+		r24 - argv
+		r23 - False _dl_fini plabel address
+
+	   This function is called from the lower half of RTLD_START.  
+
+	   The call to __libc_start_main expects:
+
+		1. r26 - Application main
+		2. r25 - argc
+		3. r24 - argv
+		4. r23 - __libc_csu_init
+		5. sp-52 - __libc_csu_fini
+		6. sp-56 - rtld_fini
+		7. sp-60 - stackend  */ 
+
+	.proc
+	.callinfo
+	/* Clear previous-sp.  */
+	stw	%r0, -4(%sp)
+	/* Setup the stack and frame.  */
+	stw	%rp, -20(%sp)
+	ldo	64(%sp), %sp
+	stw	%sp, -4(%sp)
+	stw	%r19, -32(%sp)
+
+	/* argc and argv should be in 25 and 24 (2nd and 3rd argument) */
+	/* void (*rtld_fini) (void) (6th argument) */
+	stw	%r23, -56(%sp)
+	/* Need to setup 1, 4, 5, and 7th arguments */
+
+#if SHARED
+	/* load main (1st argument) */
+	addil	LT'.Lpmain, %r19
+	ldw	RT'.Lpmain(%r1), %r26
+	ldw	0(%r26),%r26
+	/* void (*init) (void) (4th argument) */
+	addil	LT'.Lp__libc_csu_init, %r19
+	ldw	RT'.Lp__libc_csu_init(%r1), %r23
+	ldw	0(%r23), %r23
+	/* void (*fini) (void) (5th argument) */
+	addil	LT'.Lp__libc_csu_fini, %r19
+	ldw	RT'.Lp__libc_csu_fini(%r1), %r22
+	ldw	0(%r22), %r22
+#else
+	/* load main (1st argument) */
+	ldil	LR'.Lpmain, %r26
+	ldw	RR'.Lpmain(%r26), %r26
+	/* void (*init) (void) (4th argument) */
+	ldil	LR'.Lp__libc_csu_init, %r23
+	ldw	RR'.Lp__libc_csu_init(%r23), %r23
+	/* void (*fini) (void) (5th argument) */
+	ldil	LR'.Lp__libc_csu_fini, %r22
+	ldw	RR'.Lp__libc_csu_fini(%r22), %r22
+#endif
+	/* Store 5th argument */
+	stw	%r22, -52(%sp)
+	/* void *stack_end (7th argument) */
+	stw	%sp, -60(%sp)
+
+	/* load global */
+	ldil	L%$global$, %dp
+	ldo	R%$global$(%dp), %dp
+
+	bl	__libc_start_main,%r2
+	nop
+	/* die horribly if it returned (it shouldn't) */
+	iitlbp %r0,(%sr0,%r0)
+	nop
+
+	.procend
+
+/* Define a symbol for the first piece of initialized data.  */
+	.data
+	.globl __data_start
+__data_start:
+	.long 0
+	.weak data_start
+	data_start = __data_start

Added: fsf/trunk/ports/sysdeps/m68k/m680x0/fpu/e_ilogb.c
==============================================================================
--- fsf/trunk/ports/sysdeps/m68k/m680x0/fpu/e_ilogb.c (added)
+++ fsf/trunk/ports/sysdeps/m68k/m680x0/fpu/e_ilogb.c Wed Apr 18 00:01:45 2012
@@ -1,0 +1,47 @@
+/* Copyright (C) 1996-2012 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library.  If not, see
+   <http://www.gnu.org/licenses/>.  */
+
+#include <math.h>
+#include "mathimpl.h"
+
+#ifndef SUFF
+#define SUFF
+#endif
+#ifndef float_type
+#define float_type double
+#endif
+
+#define CONCATX(a,b) __CONCAT(a,b)
+#define s(name) CONCATX(name,SUFF)
+#define m81(func) __m81_u(s(func))
+
+int
+s(__ieee754_ilogb) (float_type x)
+{
+  float_type result;
+  unsigned long x_cond;
+
+  x_cond = __m81_test (x);
+  /* We must return consistent values for zero and NaN.  */
+  if (x_cond & __M81_COND_ZERO)
+    return FP_ILOGB0;
+  if (x_cond & (__M81_COND_NAN | __M81_COND_INF))
+    return FP_ILOGBNAN;
+
+  __asm ("fgetexp%.x %1, %0" : "=f" (result) : "f" (x));
+  return (int) result;
+}

Added: fsf/trunk/ports/sysdeps/m68k/m680x0/fpu/e_ilogbf.c
==============================================================================
--- fsf/trunk/ports/sysdeps/m68k/m680x0/fpu/e_ilogbf.c (added)
+++ fsf/trunk/ports/sysdeps/m68k/m680x0/fpu/e_ilogbf.c Wed Apr 18 00:01:45 2012
@@ -1,0 +1,3 @@
+#define SUFF f
+#define float_type float
+#include <e_ilogb.c>

Added: fsf/trunk/ports/sysdeps/m68k/m680x0/fpu/e_ilogbl.c
==============================================================================
--- fsf/trunk/ports/sysdeps/m68k/m680x0/fpu/e_ilogbl.c (added)
+++ fsf/trunk/ports/sysdeps/m68k/m680x0/fpu/e_ilogbl.c Wed Apr 18 00:01:45 2012
@@ -1,0 +1,3 @@
+#define SUFF l
+#define float_type long double
+#include <e_ilogb.c>

Removed: fsf/trunk/ports/sysdeps/m68k/m680x0/fpu/s_ilogb.c
==============================================================================
--- fsf/trunk/ports/sysdeps/m68k/m680x0/fpu/s_ilogb.c (original)
+++ fsf/trunk/ports/sysdeps/m68k/m680x0/fpu/s_ilogb.c (removed)
@@ -1,50 +1,0 @@
-/* Copyright (C) 1996, 1997, 1999 Free Software Foundation, Inc.
-   This file is part of the GNU C Library.
-
-   The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Lesser General Public
-   License as published by the Free Software Foundation; either
-   version 2.1 of the License, or (at your option) any later version.
-
-   The GNU C Library is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Lesser General Public License for more details.
-
-   You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library.  If not, see
-   <http://www.gnu.org/licenses/>.  */
-
-#include <math.h>
-#include "mathimpl.h"
-
-#ifndef SUFF
-#define SUFF
-#endif
-#ifndef float_type
-#define float_type double
-#endif
-
-#define CONCATX(a,b) __CONCAT(a,b)
-#define s(name) CONCATX(name,SUFF)
-#define m81(func) __m81_u(s(func))
-
-int
-s(__ilogb) (float_type x)
-{
-  float_type result;
-  unsigned long x_cond;
-
-  x_cond = __m81_test (x);
-  /* We must return consistent values for zero and NaN.  */
-  if (x_cond & __M81_COND_ZERO)
-    return FP_ILOGB0;
-  if (x_cond & (__M81_COND_NAN | __M81_COND_INF))
-    return FP_ILOGBNAN;
-
-  __asm ("fgetexp%.x %1, %0" : "=f" (result) : "f" (x));
-  return (int) result;
-}
-
-#define weak_aliasx(a,b) weak_alias(a,b)
-weak_aliasx (s(__ilogb), s(ilogb))

Removed: fsf/trunk/ports/sysdeps/m68k/m680x0/fpu/s_ilogbf.c
==============================================================================
--- fsf/trunk/ports/sysdeps/m68k/m680x0/fpu/s_ilogbf.c (original)
+++ fsf/trunk/ports/sysdeps/m68k/m680x0/fpu/s_ilogbf.c (removed)
@@ -1,3 +1,0 @@
-#define SUFF f
-#define float_type float
-#include <s_ilogb.c>

Removed: fsf/trunk/ports/sysdeps/m68k/m680x0/fpu/s_ilogbl.c
==============================================================================
--- fsf/trunk/ports/sysdeps/m68k/m680x0/fpu/s_ilogbl.c (original)
+++ fsf/trunk/ports/sysdeps/m68k/m680x0/fpu/s_ilogbl.c (removed)
@@ -1,3 +1,0 @@
-#define SUFF l
-#define float_type long double
-#include <s_ilogb.c>

Modified: fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/ldsodefs.h
==============================================================================
--- fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/ldsodefs.h (original)
+++ fsf/trunk/ports/sysdeps/unix/sysv/linux/arm/ldsodefs.h Wed Apr 18 00:01:45 2012
@@ -1,5 +1,5 @@
 /* Run-time dynamic linker data structures for loaded ELF shared objects.
-   Copyright (C) 2010 Free Software Foundation, Inc.
+   Copyright (C) 2010, 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
@@ -23,6 +23,7 @@
 
 #undef VALID_ELF_HEADER
 #undef VALID_ELF_OSABI
+#undef MORE_ELF_HEADER_DATA
 
 #ifdef __ARM_EABI__
 #define EXTRA_OSABI ELFOSABI_ARM_AEABI

_______________________________________________
Commits mailing list
Commits@xxxxxxxxxx
http://eglibc.org/cgi-bin/mailman/listinfo/commits