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

[Commits] r17787 - in /fsf/trunk/ports: ./ sysdeps/alpha/ sysdeps/alpha/elf/ sysdeps/arm/ sysdeps/arm/elf/ sysdeps/m68k/ sysdeps/m68k/...



Author: eglibc
Date: Wed Mar 28 00:03:17 2012
New Revision: 17787

Log:
Import glibc-ports-mainline for 2012-03-28

Added:
    fsf/trunk/ports/sysdeps/alpha/configure
    fsf/trunk/ports/sysdeps/alpha/configure.in
    fsf/trunk/ports/sysdeps/alpha/crti.S
    fsf/trunk/ports/sysdeps/alpha/crtn.S
    fsf/trunk/ports/sysdeps/alpha/start.S
    fsf/trunk/ports/sysdeps/arm/start.S
    fsf/trunk/ports/sysdeps/m68k/start.S
    fsf/trunk/ports/sysdeps/mips/configure
    fsf/trunk/ports/sysdeps/mips/configure.in
    fsf/trunk/ports/sysdeps/mips/start.S
Removed:
    fsf/trunk/ports/sysdeps/alpha/elf/
    fsf/trunk/ports/sysdeps/arm/elf/
    fsf/trunk/ports/sysdeps/m68k/elf/
    fsf/trunk/ports/sysdeps/mips/elf/
    fsf/trunk/ports/sysdeps/unix/arm/start.c
Modified:
    fsf/trunk/ports/ChangeLog.alpha
    fsf/trunk/ports/ChangeLog.arm
    fsf/trunk/ports/ChangeLog.m68k
    fsf/trunk/ports/ChangeLog.mips
    fsf/trunk/ports/sysdeps/arm/configure
    fsf/trunk/ports/sysdeps/arm/configure.in

Modified: fsf/trunk/ports/ChangeLog.alpha
==============================================================================
--- fsf/trunk/ports/ChangeLog.alpha (original)
+++ fsf/trunk/ports/ChangeLog.alpha Wed Mar 28 00:03:17 2012
@@ -1,3 +1,15 @@
+2012-03-27  Richard Henderson  <rth@xxxxxxxxxxx>
+
+	* sysdeps/alpha/elf/configure.in: Move to ...
+	* sysdeps/alpha/configure.in: ... here.  Update comment.
+	* sysdeps/alpha/configure: Regenerate.
+	* sysdeps/alpha/elf/crti.S: Move to ...
+	* sysdeps/alpha/crti.S: ... here.
+	* sysdeps/alpha/elf/crtn.S: Move to ...
+	* sysdeps/alpha/crtn.S: ... here.
+	* sysdeps/alpha/elf/start.S: Move to ...
+	* sysdeps/alpha/start.S: ... here.
+
 2012-03-21  Richard Henderson  <rth@xxxxxxxxxxx>
 
 	* sysdeps/alpha/hp-timing.h: Include <_itoa.h> instead

Modified: fsf/trunk/ports/ChangeLog.arm
==============================================================================
--- fsf/trunk/ports/ChangeLog.arm (original)
+++ fsf/trunk/ports/ChangeLog.arm Wed Mar 28 00:03:17 2012
@@ -1,3 +1,14 @@
+2012-03-27  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/arm/elf/start.S: Moved to ...
+	* sysdeps/arm/start.S: ...here.
+	* sysdeps/arm/elf/configure.in: Merge into ...
+	* sysdeps/arm/configure.in: ...here.
+	* sysdeps/arm/configure: Regenerated.
+	* sysdeps/arm/elf/configure.in: Remove file.
+	* sysdeps/arm/elf/configure: Likewise.
+	* sysdeps/unix/arm/start.c: Likewise.
+
 2012-03-20  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
 
 	* sysdeps/unix/sysv/linux/arm/register-dump.h: Include <_itoa.h>

Modified: fsf/trunk/ports/ChangeLog.m68k
==============================================================================
--- fsf/trunk/ports/ChangeLog.m68k (original)
+++ fsf/trunk/ports/ChangeLog.m68k Wed Mar 28 00:03:17 2012
@@ -1,3 +1,8 @@
+2012-03-27  Andreas Schwab  <schwab@xxxxxxxxxxxxxx>
+
+	* sysdeps/m68k/elf/start.S: Move to ...
+	* sysdeps/m68k/start.S: ... here.
+
 2012-03-23  Andreas Schwab  <schwab@xxxxxxxxxxxxxx>
 
 	* sysdeps/m68k/m680x0/fpu/libm-test-ulps: Update.

Modified: fsf/trunk/ports/ChangeLog.mips
==============================================================================
--- fsf/trunk/ports/ChangeLog.mips (original)
+++ fsf/trunk/ports/ChangeLog.mips Wed Mar 28 00:03:17 2012
@@ -1,3 +1,11 @@
+2012-03-27  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
+
+	* sysdeps/mips/elf/start.S: Moved to ...
+	* sysdeps/mips/start.S: ...here.
+	* sysdeps/mips/elf/configure.in: Moved to ...
+	* sysdeps/mips/configure.in: ...here.  Update comment.
+	* sysdeps/mips/configure: New generated file.
+
 2012-03-20  Joseph Myers  <joseph@xxxxxxxxxxxxxxxx>
 
 	* sysdeps/unix/sysv/linux/mips/register-dump.h: Include <_itoa.h>

Added: fsf/trunk/ports/sysdeps/alpha/configure
==============================================================================
--- fsf/trunk/ports/sysdeps/alpha/configure (added)
+++ fsf/trunk/ports/sysdeps/alpha/configure Wed Mar 28 00:03:17 2012
@@ -1,0 +1,176 @@
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+
+  as_lineno_1=$LINENO as_lineno_1a=$LINENO
+  as_lineno_2=$LINENO as_lineno_2a=$LINENO
+  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+# This file is generated from configure.in by Autoconf.  DO NOT EDIT!
+ # Local configure fragment for sysdeps/alpha.
+
+# Check for support of thread-local storage handling in assembler and linker.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Alpha TLS support" >&5
+$as_echo_n "checking for Alpha TLS support... " >&6; }
+if ${libc_cv_alpha_tls+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat > conftest.s <<\EOF
+	.section ".tdata", "awT", @progbits
+	.globl foo
+foo:	.quad	1
+	.section ".tbss", "awT", @nobits
+	.globl bar
+bar:	.skip	8
+	.text
+baz:
+	.set nomacro
+	ldq	$27, __tls_get_addr($29)	!literal!1
+	ldq	$16, a($29)			!tlsgd!1
+	jsr	$26, ($27), __tls_get_addr	!lituse_tlsgd!1
+
+	jsr	$26, ($27), __tls_get_addr	!lituse_tlsldm!2
+	ldq	$27, __tls_get_addr($29)	!literal!2
+	ldq	$16, b($29)			!tlsldm!2
+
+	ldq	$16, c($29)			!tlsgd
+	ldq	$16, d($29)			!tlsldm
+
+	ldq	$16, e($29)			!tlsgd!3
+	ldq	$16, f($29)			!tlsldm!4
+
+	ldq	$16, g($29)			!gotdtprel
+	ldah	$16, h($31)			!dtprelhi
+	lda	$16, i($16)			!dtprello
+	lda	$16, j($31)			!dtprel
+
+	ldq	$16, k($29)			!gottprel
+	ldah	$16, l($31)			!tprelhi
+	lda	$16, m($16)			!tprello
+	lda	$16, n($31)			!tprel
+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_alpha_tls=yes
+else
+  libc_cv_alpha_tls=no
+fi
+rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_alpha_tls" >&5
+$as_echo "$libc_cv_alpha_tls" >&6; }
+if test $libc_cv_alpha_tls = no; then
+  as_fn_error $? "the assembler must support TLS" "$LINENO" 5
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GP relative module local relocs" >&5
+$as_echo_n "checking for GP relative module local relocs... " >&6; }
+if ${libc_cv_alpha_hidden_gprel+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat > conftest.c <<\EOF
+static volatile int bar;
+int baz __attribute__((visibility("hidden")));
+int f(void) { return bar + baz; }
+EOF
+
+libc_cv_alpha_hidden_gprel=no
+if { ac_try='${CC-cc} -S $CFLAGS -O2 -fpic conftest.c 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
+  if grep -q 'bar.*!gprel' conftest.s \
+     && grep -q 'baz.*!gprel' conftest.s \
+     && ! grep -q 'bar.*!literal' conftest.s \
+     && ! grep -q 'baz.*!literal' conftest.s; then
+    libc_cv_alpha_hidden_gprel=yes
+  fi
+fi
+rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_alpha_hidden_gprel" >&5
+$as_echo "$libc_cv_alpha_hidden_gprel" >&6; }
+if test $libc_cv_alpha_hidden_gprel = yes; then
+  $as_echo "#define PI_STATIC_AND_HIDDEN 1" >>confdefs.h
+
+fi

Added: fsf/trunk/ports/sysdeps/alpha/configure.in
==============================================================================
--- fsf/trunk/ports/sysdeps/alpha/configure.in (added)
+++ fsf/trunk/ports/sysdeps/alpha/configure.in Wed Mar 28 00:03:17 2012
@@ -1,0 +1,71 @@
+GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+# Local configure fragment for sysdeps/alpha.
+
+# Check for support of thread-local storage handling in assembler and linker.
+AC_CACHE_CHECK(for Alpha TLS support, libc_cv_alpha_tls, [dnl
+cat > conftest.s <<\EOF
+	.section ".tdata", "awT", @progbits
+	.globl foo
+foo:	.quad	1
+	.section ".tbss", "awT", @nobits
+	.globl bar
+bar:	.skip	8
+	.text
+baz:
+	.set nomacro
+	ldq	$27, __tls_get_addr($29)	!literal!1
+	ldq	$16, a($29)			!tlsgd!1
+	jsr	$26, ($27), __tls_get_addr	!lituse_tlsgd!1
+
+	jsr	$26, ($27), __tls_get_addr	!lituse_tlsldm!2
+	ldq	$27, __tls_get_addr($29)	!literal!2
+	ldq	$16, b($29)			!tlsldm!2
+
+	ldq	$16, c($29)			!tlsgd
+	ldq	$16, d($29)			!tlsldm
+
+	ldq	$16, e($29)			!tlsgd!3
+	ldq	$16, f($29)			!tlsldm!4
+
+	ldq	$16, g($29)			!gotdtprel
+	ldah	$16, h($31)			!dtprelhi
+	lda	$16, i($16)			!dtprello
+	lda	$16, j($31)			!dtprel
+
+	ldq	$16, k($29)			!gottprel
+	ldah	$16, l($31)			!tprelhi
+	lda	$16, m($16)			!tprello
+	lda	$16, n($31)			!tprel
+EOF
+dnl
+if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
+  libc_cv_alpha_tls=yes
+else
+  libc_cv_alpha_tls=no
+fi
+rm -f conftest*])
+if test $libc_cv_alpha_tls = no; then
+  AC_MSG_ERROR([the assembler must support TLS])
+fi
+
+AC_CACHE_CHECK(for GP relative module local relocs, libc_cv_alpha_hidden_gprel, [dnl
+cat > conftest.c <<\EOF
+static volatile int bar;
+int baz __attribute__((visibility("hidden")));
+int f(void) { return bar + baz; }
+EOF
+dnl
+
+libc_cv_alpha_hidden_gprel=no
+if AC_TRY_COMMAND(${CC-cc} -S $CFLAGS -O2 -fpic conftest.c 1>&AS_MESSAGE_LOG_FD); then
+  if grep -q 'bar.*!gprel' conftest.s \
+     && grep -q 'baz.*!gprel' conftest.s \
+     && ! grep -q 'bar.*!literal' conftest.s \
+     && ! grep -q 'baz.*!literal' conftest.s; then
+    libc_cv_alpha_hidden_gprel=yes
+  fi
+fi
+rm -f conftest*])
+if test $libc_cv_alpha_hidden_gprel = yes; then
+  AC_DEFINE(PI_STATIC_AND_HIDDEN)
+fi

Added: fsf/trunk/ports/sysdeps/alpha/crti.S
==============================================================================
--- fsf/trunk/ports/sysdeps/alpha/crti.S (added)
+++ fsf/trunk/ports/sysdeps/alpha/crti.S Wed Mar 28 00:03:17 2012
@@ -1,0 +1,99 @@
+/* Special .init and .fini section support for Alpha.
+   Copyright (C) 2001, 2002, 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
+   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.
+
+   This differs from what would be generated for ordinary code in that
+   we save and restore the GP within the function.  In order for linker
+   relaxation to work, the value in the GP register on exit from a function
+   must be valid for the function entry point.  Normally, a function is
+   contained within one object file and this is not an issue, provided
+   that the function reloads the gp after making any function calls.
+   However, _init and _fini are constructed from pieces of many object
+   files, all of which may have different GP values.  So we must reload
+   the GP value from crti.o in crtn.o.  */
+
+#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
+
+#if PREINIT_FUNCTION_WEAK
+        weak_extern (PREINIT_FUNCTION)
+#else
+        .hidden PREINIT_FUNCTION
+#endif
+
+	.section .init, "ax", @progbits
+	.globl	_init
+	.type	_init, @function
+	.usepv	_init, std
+_init:
+	ldgp	$29, 0($27)
+	subq	$30, 16, $30
+#if PREINIT_FUNCTION_WEAK
+	lda	$27, PREINIT_FUNCTION
+#endif
+	stq	$26, 0($30)
+	stq	$29, 8($30)
+#if PREINIT_FUNCTION_WEAK
+	beq	$27, 1f
+	jsr	$26, ($27), PREINIT_FUNCTION
+	ldq	$29, 8($30)
+1:
+#else
+	bsr	$26, PREINIT_FUNCTION !samegp
+#endif
+	.p2align 3
+
+	.section .fini, "ax", @progbits
+	.globl	_fini
+	.type	_fini,@function
+	.usepv	_fini,std
+_fini:
+	ldgp	$29, 0($27)
+	subq	$30, 16, $30
+	stq	$26, 0($30)
+	stq	$29, 8($30)
+	.p2align 3

Added: fsf/trunk/ports/sysdeps/alpha/crtn.S
==============================================================================
--- fsf/trunk/ports/sysdeps/alpha/crtn.S (added)
+++ fsf/trunk/ports/sysdeps/alpha/crtn.S Wed Mar 28 00:03:17 2012
@@ -1,0 +1,49 @@
+/* Special .init and .fini section support for Alpha.
+   Copyright (C) 2001, 2002, 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
+   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/>.  */
+
+/* crtn.S puts function epilogues in the .init and .fini sections
+   corresponding to the prologues in crti.S. */
+
+	.section .init, "ax", @progbits
+	ldq	$26, 0($30)
+	ldq	$29, 8($30)
+	addq	$30, 16, $30
+	ret
+
+	.section .fini, "ax", @progbits
+	ldq	$26, 0($30)
+	ldq	$29, 8($30)
+	addq	$30, 16, $30
+	ret

Added: fsf/trunk/ports/sysdeps/alpha/start.S
==============================================================================
--- fsf/trunk/ports/sysdeps/alpha/start.S (added)
+++ fsf/trunk/ports/sysdeps/alpha/start.S Wed Mar 28 00:03:17 2012
@@ -1,0 +1,86 @@
+/* Startup code for Alpha/ELF.
+   Copyright (C) 1993, 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003
+   Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+   Contributed by Richard Henderson <rth@xxxxxxxx>
+
+   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>
+
+	.text
+	.align 3
+	.globl _start
+	.ent _start, 0
+	.type _start,@function
+_start:
+	.frame	$15, 0, $15
+	br	gp, 1f
+1:	ldgp	gp, 0(gp)
+	subq	sp, 16, sp
+	mov	0, $15
+	.prologue 0
+
+  /* Load address of the user's main function.  */
+	lda	a0, main
+
+	ldl	a1, 16(sp)	/* get argc */
+	lda	a2, 24(sp)	/* get argv */
+
+  /* Load address of our own entry points to .fini and .init.  */
+	lda	a3, __libc_csu_init
+	lda	a4, __libc_csu_fini
+
+  /* Store address of the shared library termination function.  */
+	mov	v0, a5
+
+  /* Provide the highest stack address to the user code.  */
+	stq	sp, 0(sp)
+
+  /* Call the user's main function, and exit with its value.
+     But let the libc call main.  */
+	jsr	ra, __libc_start_main
+
+  /* Die very horribly if exit returns.  Call_pal hlt is callable from
+     kernel mode only; this will result in an illegal instruction trap.  */
+	call_pal 0
+	.end _start
+
+/* For ECOFF backwards compatibility. */
+weak_alias (_start, __start)
+
+/* Define a symbol for the first piece of initialized data.  */
+	.data
+	.globl __data_start
+__data_start:
+	.weak data_start
+	data_start = __data_start

Modified: fsf/trunk/ports/sysdeps/arm/configure
==============================================================================
--- fsf/trunk/ports/sysdeps/arm/configure (original)
+++ fsf/trunk/ports/sysdeps/arm/configure Wed Mar 28 00:03:17 2012
@@ -1,9 +1,129 @@
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+
+  as_lineno_1=$LINENO as_lineno_1a=$LINENO
+  as_lineno_2=$LINENO as_lineno_2a=$LINENO
+  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
 # This file is generated from configure.in by Autoconf.  DO NOT EDIT!
  # Local configure fragment for sysdeps/arm.
 
-{ $as_echo "$as_me:$LINENO: checking whether the CFI directive .cfi_sections is supported" >&5
+# Check for support of thread-local storage handling in assembler and
+# linker.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ARM TLS support" >&5
+$as_echo_n "checking for ARM TLS support... " >&6; }
+if ${libc_cv_arm_tls+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat > conftest.s <<\EOF
+	.section ".tdata", "awT", %progbits
+	.globl foo
+foo:	.long	1
+	.section ".tbss", "awT", %nobits
+	.globl bar
+bar:	.skip	4
+	.text
+.word	foo(tpoff)
+.word	foo(tlsgd)
+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_arm_tls=yes
+else
+  libc_cv_arm_tls=no
+fi
+rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_arm_tls" >&5
+$as_echo "$libc_cv_arm_tls" >&6; }
+if test $libc_cv_arm_tls = no; then
+  as_fn_error $? "the assembler must support TLS" "$LINENO" 5
+fi
+
+#AC_DEFINE(PI_STATIC_AND_HIDDEN)
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the CFI directive .cfi_sections is supported" >&5
 $as_echo_n "checking whether the CFI directive .cfi_sections is supported... " >&6; }
-if test "${libc_cv_asm_cfi_directive_sections+set}" = set; then
+if ${libc_cv_asm_cfi_directive_sections+:} false; then :
   $as_echo_n "(cached) " >&6
 else
   cat > conftest.s <<EOF
@@ -13,21 +133,19 @@
 	.cfi_endproc
 EOF
   if { ac_try='${CC-cc} $ASFLAGS -c conftest.s 1>&5'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
   (eval $ac_try) 2>&5
   ac_status=$?
-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
     libc_cv_asm_cfi_directive_sections=yes
   else
     libc_cv_asm_cfi_directive_sections=no
   fi
   rm -f conftest*
 fi
-{ $as_echo "$as_me:$LINENO: result: $libc_cv_asm_cfi_directive_sections" >&5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_asm_cfi_directive_sections" >&5
 $as_echo "$libc_cv_asm_cfi_directive_sections" >&6; }
 if test $libc_cv_asm_cfi_directive_sections != yes; then
-  { { $as_echo "$as_me:$LINENO: error: need .cfi_sections in this configuration" >&5
-$as_echo "$as_me: error: need .cfi_sections in this configuration" >&2;}
-   { (exit 1); exit 1; }; }
+  as_fn_error $? "need .cfi_sections in this configuration" "$LINENO" 5
 fi

Modified: fsf/trunk/ports/sysdeps/arm/configure.in
==============================================================================
--- fsf/trunk/ports/sysdeps/arm/configure.in (original)
+++ fsf/trunk/ports/sysdeps/arm/configure.in Wed Mar 28 00:03:17 2012
@@ -1,5 +1,36 @@
 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
 # Local configure fragment for sysdeps/arm.
+
+# Check for support of thread-local storage handling in assembler and
+# linker.
+AC_CACHE_CHECK(for ARM TLS support, libc_cv_arm_tls, [dnl
+cat > conftest.s <<\EOF
+	.section ".tdata", "awT", %progbits
+	.globl foo
+foo:	.long	1
+	.section ".tbss", "awT", %nobits
+	.globl bar
+bar:	.skip	4
+	.text
+.word	foo(tpoff)
+.word	foo(tlsgd)
+EOF
+dnl
+if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
+  libc_cv_arm_tls=yes
+else
+  libc_cv_arm_tls=no
+fi
+rm -f conftest*])
+if test $libc_cv_arm_tls = no; then
+  AC_MSG_ERROR([the assembler must support TLS])
+fi
+
+dnl It is always possible to access static and hidden symbols in an
+dnl position independent way.
+dnl NOTE: This feature was added by the GCC TLS patches.  We should test for
+dnl it.  Until we do, don't define it.
+#AC_DEFINE(PI_STATIC_AND_HIDDEN)
 
 AC_CACHE_CHECK([whether the CFI directive .cfi_sections is supported],
   [libc_cv_asm_cfi_directive_sections],

Added: fsf/trunk/ports/sysdeps/arm/start.S
==============================================================================
--- fsf/trunk/ports/sysdeps/arm/start.S (added)
+++ fsf/trunk/ports/sysdeps/arm/start.S Wed Mar 28 00:03:17 2012
@@ -1,0 +1,156 @@
+/* Startup code for ARM & ELF
+   Copyright (C) 1995, 1996, 1997, 1998, 2001, 2002, 2005, 2008
+   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/>.  */
+
+/* This is the canonical entry point, usually the first thing in the text
+   segment.
+
+	Note that the code in the .init section has already been run.
+	This includes _init and _libc_init
+
+
+	At this entry point, most registers' values are unspecified, except:
+
+   a1		Contains a function pointer to be registered with `atexit'.
+		This is how the dynamic linker arranges to have DT_FINI
+		functions called for shared libraries that have been loaded
+		before this code runs.
+
+   sp		The stack contains the arguments and environment:
+		0(sp)			argc
+		4(sp)			argv[0]
+		...
+		(4*argc)(sp)		NULL
+		(4*(argc+1))(sp)	envp[0]
+		...
+					NULL
+*/
+
+#if defined(__ARM_EABI__)
+/* Tag_ABI_align8_preserved: This code preserves 8-byte
+   alignment in any callee.  */
+	.eabi_attribute 25, 1
+/* Tag_ABI_align8_needed: This code may require 8-byte alignment from
+   the caller.  */
+	.eabi_attribute 24, 1
+#endif
+
+#if defined(__thumb2__)
+	.thumb
+	.syntax unified
+#endif
+
+	.text
+	.globl _start
+	.type _start,#function
+_start:
+#if !defined(__USING_SJLJ_EXCEPTIONS__)
+       /* Protect against unhandled exceptions.  */
+       .fnstart
+#endif
+	/* Clear the frame pointer and link register since this is the outermost frame. */
+	mov fp, #0
+	mov lr, #0
+
+	/* Pop argc off the stack and save a pointer to argv */
+	ldr a2, [sp], #4
+	mov a3, sp
+
+	/* Push stack limit */
+	str a3, [sp, #-4]!
+
+	/* Push rtld_fini */
+	str a1, [sp, #-4]!
+
+#ifdef SHARED
+	ldr sl, .L_GOT
+	adr a4, .L_GOT
+	add sl, sl, a4
+
+	ldr ip, .L_GOT+4	/* __libc_csu_fini */
+	ldr ip, [sl, ip]
+
+	str ip, [sp, #-4]!	/* Push __libc_csu_fini */
+
+	ldr a4, .L_GOT+8	/* __libc_csu_init */
+	ldr a4, [sl, a4]
+
+	ldr a1, .L_GOT+12	/* main */
+	ldr a1, [sl, a1]
+
+	/* __libc_start_main (main, argc, argv, init, fini, rtld_fini, stack_end) */
+	/* Let the libc call main and exit with its return code.  */
+	bl __libc_start_main(PLT)
+#else
+	/* Fetch address of __libc_csu_fini */
+	ldr ip, =__libc_csu_fini
+
+	/* Push __libc_csu_fini */
+	str ip, [sp, #-4]!
+
+	/* Set up the other arguments in registers */
+	ldr a1, =main
+	ldr a4, =__libc_csu_init
+
+	/* __libc_start_main (main, argc, argv, init, fini, rtld_fini, stack_end) */
+	/* Let the libc call main and exit with its return code.  */
+	bl __libc_start_main
+#endif
+
+	/* should never get here....*/
+	bl abort
+
+#ifdef SHARED
+	.align 2
+.L_GOT:
+	.word _GLOBAL_OFFSET_TABLE_ - .L_GOT
+	.word __libc_csu_fini(GOT)
+	.word __libc_csu_init(GOT)
+	.word main(GOT)
+#endif
+
+
+#if !defined(__USING_SJLJ_EXCEPTIONS__)
+       .cantunwind
+       .fnend
+#endif
+
+/* 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/start.S
==============================================================================
--- fsf/trunk/ports/sysdeps/m68k/start.S (added)
+++ fsf/trunk/ports/sysdeps/m68k/start.S Wed Mar 28 00:03:17 2012
@@ -1,0 +1,99 @@
+/* Startup code compliant to the ELF m68k ABI.
+   Copyright (C) 1996, 1997, 1998, 2001, 2002 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/>.  */
+
+/* This is the canonical entry point, usually the first thing in the text
+   segment.  The SVR4/m68k ABI says that when the entry point runs,
+   most registers' values are unspecified, except for:
+
+   %a1		Contains a function pointer to be registered with `atexit'.
+		This is how the dynamic linker arranges to have DT_FINI
+		functions called for shared libraries that have been loaded
+		before this code runs.
+
+   %sp		The stack contains the arguments and environment:
+		0(%sp)			argc
+		4(%sp)			argv[0]
+		...
+		(4*argc)(%sp)		NULL
+		(4*(argc+1))(%sp)	envp[0]
+		...
+					NULL
+*/
+
+	.text
+	.globl _start
+	.type _start,@function
+_start:
+	/* Clear the frame pointer.  The ABI suggests this be done, to mark
+	   the outermost frame obviously.  */
+	sub.l %fp, %fp
+
+	/* Extract the arguments as encoded on the stack and set up the
+	   arguments for `main': argc, argv.  envp will be determined
+	   later in __libc_start_main.  */
+	move.l (%sp)+, %d0	/* Pop the argument count.  */
+	move.l %sp, %a0		/* The argument vector starts just at the
+				   current stack top.  */
+
+	/* Provide the highest stack address to the user code (for stacks
+	   which grow downward).  */
+	pea (%sp)
+
+	pea (%a1)		/* Push address of the shared library
+				   termination function.  */
+
+	/* Push the address of our own entry points to `.fini' and
+	   `.init'.  */
+	pea __libc_csu_fini
+	pea __libc_csu_init
+
+	pea (%a0)		/* Push second argument: argv.  */
+	move.l %d0, -(%sp)	/* Push first argument: argc.  */
+
+	pea main
+
+	/* Call the user's main function, and exit with its value.  But
+	   let the libc call main.  */
+	jbsr __libc_start_main
+
+	illegal			/* Crash if somehow `exit' does return.  */
+
+/* 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/mips/configure
==============================================================================
--- fsf/trunk/ports/sysdeps/mips/configure (added)
+++ fsf/trunk/ports/sysdeps/mips/configure Wed Mar 28 00:03:17 2012
@@ -1,0 +1,123 @@
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+
+  as_lineno_1=$LINENO as_lineno_1a=$LINENO
+  as_lineno_2=$LINENO as_lineno_2a=$LINENO
+  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+# This file is generated from configure.in by Autoconf.  DO NOT EDIT!
+ # Local configure fragment for sysdeps/mips.
+
+# Check for support of thread-local storage handling in assembler and
+# linker.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for MIPS TLS support" >&5
+$as_echo_n "checking for MIPS TLS support... " >&6; }
+if ${libc_cv_mips_tls+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat > conftest.s <<\EOF
+	.section ".tdata", "awT", %progbits
+	.globl foo
+foo:	.long	1
+	.section ".tbss", "awT", %nobits
+	.globl bar
+bar:	.skip	4
+	.text
+
+	lw	$25, %call16(__tls_get_addr)($28)
+	jalr	$25
+	addiu	$4, $28, %tlsgd(x)
+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_mips_tls=yes
+else
+  libc_cv_mips_tls=no
+fi
+rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mips_tls" >&5
+$as_echo "$libc_cv_mips_tls" >&6; }
+if test $libc_cv_mips_tls = no; then
+  as_fn_error $? "the assembler must support TLS" "$LINENO" 5
+fi
+

Added: fsf/trunk/ports/sysdeps/mips/configure.in
==============================================================================
--- fsf/trunk/ports/sysdeps/mips/configure.in (added)
+++ fsf/trunk/ports/sysdeps/mips/configure.in Wed Mar 28 00:03:17 2012
@@ -1,0 +1,33 @@
+GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
+# Local configure fragment for sysdeps/mips.
+
+# Check for support of thread-local storage handling in assembler and
+# linker.
+AC_CACHE_CHECK(for MIPS TLS support, libc_cv_mips_tls, [dnl
+cat > conftest.s <<\EOF
+	.section ".tdata", "awT", %progbits
+	.globl foo
+foo:	.long	1
+	.section ".tbss", "awT", %nobits
+	.globl bar
+bar:	.skip	4
+	.text
+
+	lw	$25, %call16(__tls_get_addr)($28)
+	jalr	$25
+	addiu	$4, $28, %tlsgd(x) 
+EOF
+dnl
+if AC_TRY_COMMAND(${CC-cc} -c $CFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
+  libc_cv_mips_tls=yes
+else
+  libc_cv_mips_tls=no
+fi
+rm -f conftest*])
+if test $libc_cv_mips_tls = no; then
+  AC_MSG_ERROR([the assembler must support TLS])
+fi
+
+dnl No MIPS GCC supports accessing static and hidden symbols in an
+dnl position independent way.
+dnl AC_DEFINE(PI_STATIC_AND_HIDDEN)

Added: fsf/trunk/ports/sysdeps/mips/start.S
==============================================================================
--- fsf/trunk/ports/sysdeps/mips/start.S (added)
+++ fsf/trunk/ports/sysdeps/mips/start.S Wed Mar 28 00:03:17 2012
@@ -1,0 +1,118 @@
+/* Startup code compliant to the ELF Mips ABI.
+   Copyright (C) 1995, 1997, 2000, 2001, 2002, 2003, 2004
+	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/>.  */
+
+#define __ASSEMBLY__ 1
+#include <entry.h>
+#include <sgidefs.h>
+#include <sys/asm.h>
+
+#ifndef ENTRY_POINT
+#error ENTRY_POINT needs to be defined for start.S on MIPS/ELF.
+#endif
+
+/* This is the canonical entry point, usually the first thing in the text
+   segment.  The SVR4/Mips ABI (pages 3-31, 3-32) says that when the entry
+   point runs, most registers' values are unspecified, except for:
+
+   v0 ($2)	Contains a function pointer to be registered with `atexit'.
+		This is how the dynamic linker arranges to have DT_FINI
+		functions called for shared libraries that have been loaded
+		before this code runs.
+
+   sp ($29)	The stack contains the arguments and environment:
+		0(%esp)			argc
+		4(%esp)			argv[0]
+		...
+		(4*argc)(%esp)		NULL
+		(4*(argc+1))(%esp)	envp[0]
+		...
+					NULL
+   ra ($31)	The return address register is set to zero so that programs
+		that search backword through stack frames recognize the last
+		stack frame.
+*/
+
+
+/* We need to call:
+   __libc_start_main (int (*main) (int, char **, char **), int argc,
+		      char **argv, void (*init) (void), void (*fini) (void),
+		      void (*rtld_fini) (void), void *stack_end)
+*/
+	
+	.text
+	.globl ENTRY_POINT
+	.type ENTRY_POINT,@function
+ENTRY_POINT:
+#ifdef __PIC__
+	SETUP_GPX($0)
+	SETUP_GPX64($25,$0)
+#else
+	PTR_LA $28, _gp		/* Setup GP correctly if we're non-PIC.  */
+	move $31, $0
+#endif
+
+	PTR_LA $4, main		/* main */
+	PTR_L $5, 0($29)		/* argc */
+	PTR_ADDIU $6, $29, PTRSIZE	/* argv  */
+	
+	/* Allocate space on the stack for seven arguments (o32 only)
+	   and make sure the stack is aligned to double words (8 bytes) 
+	   on o32 and quad words (16 bytes) on n32 and n64.  */
+	
+	and $29, -2 * SZREG
+#if _MIPS_SIM == _ABIO32
+	PTR_SUBIU $29, 32
+#endif
+	PTR_LA $7, __libc_csu_init		/* init */
+	PTR_LA $8, __libc_csu_fini
+#if _MIPS_SIM == _ABIO32
+	PTR_S $8, 16($29)		/* fini */
+	PTR_S $2, 20($29)		/* rtld_fini */
+	PTR_S $29, 24($29)		/* stack_end */
+#else
+	move $9, $2		/* rtld_fini */
+	move $10, $29		/* stack_end */
+#endif
+	jal __libc_start_main
+hlt:	b hlt			/* Crash if somehow it does return.  */
+
+/* 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

Removed: fsf/trunk/ports/sysdeps/unix/arm/start.c
==============================================================================
--- fsf/trunk/ports/sysdeps/unix/arm/start.c (original)
+++ fsf/trunk/ports/sysdeps/unix/arm/start.c (removed)
@@ -1,85 +1,0 @@
-/* Special startup code for ARM a.out binaries.
-   Copyright (C) 1998, 2004, 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 <errno.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sysdep.h>
-
-/* The first piece of initialized data.  */
-int __data_start = 0;
-weak_alias (__data_start, data_start)
-
-extern void __libc_init (int argc, char **argv, char **envp);
-extern int main (int argc, char **argv, char **envp);
-
-/* N.B.: It is important that this be the first function.
-   This file is the first thing in the text section.  */
-
-/* If this was in C it might create its own stack frame and
-   screw up the arguments.  */
-asm (".text; .globl _start; _start: B start1");
-
-/* Fool gcc into thinking that more args are passed.  This makes it look
-   on the stack (correctly) for the real arguments.  It causes somewhat
-   strange register usage in start1(), but we aren't too bothered about
-   that at the moment. */
-#define DUMMIES a1, a2, a3, a4
-
-#ifdef	DUMMIES
-#define	ARG_DUMMIES	DUMMIES,
-#define	DECL_DUMMIES	int DUMMIES;
-#else
-#define	ARG_DUMMIES
-#define	DECL_DUMMIES
-#endif
-
-/* ARGSUSED */
-static void
-start1 (ARG_DUMMIES argc, argv, envp)
-     DECL_DUMMIES
-     int argc;
-     char **argv;
-     char **envp;
-{
-  /* Store a pointer to the environment.  */
-  __environ = envp;
-
-  /* Do C library initializations.  */
-  __libc_init (argc, argv, __environ);
-
-  /* Call the user program.  */
-  exit (main (argc, argv, __environ));
-}

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