aboutsummaryrefslogtreecommitdiff
path: root/csu
diff options
context:
space:
mode:
Diffstat (limited to 'csu')
-rw-r--r--csu/Makefile7
-rw-r--r--csu/init.c37
2 files changed, 41 insertions, 3 deletions
diff --git a/csu/Makefile b/csu/Makefile
index cb9e6eb..681366a 100644
--- a/csu/Makefile
+++ b/csu/Makefile
@@ -36,7 +36,7 @@ omit-deps = $(patsubst %.o,%,$(start-installed-name) g$(start-installed-name) \
$(csu-dummies))
install-lib = $(start-installed-name) g$(start-installed-name) \
$(csu-dummies)
-distribute = initfini.c gmon-start.c start.c defs.awk abi-note.S
+distribute = initfini.c gmon-start.c start.c defs.awk abi-note.S init.c
all: # Make this the default target; it will be defined in Rules.
@@ -89,7 +89,7 @@ $(objpfx)defs.h: $(objpfx)initfini.s
endif
ifeq (yes,$(elf))
-extra-objs += abi-note.o
+extra-objs += abi-note.o init.o
asm-CPPFLAGS += -I$(objpfx).
endif
@@ -103,7 +103,8 @@ ifndef start-installed-name-rule
ifeq (yes,$(elf))
# We link the ELF startfile along with a SHT_NOTE section indicating
# the the kernel ABI the binaries linked with this library will require.
-$(objpfx)$(start-installed-name): $(objpfx)start.o $(objpfx)abi-note.o
+$(objpfx)$(start-installed-name): $(objpfx)start.o $(objpfx)abi-note.o \
+ $(objpfx)init.o
$(link-relocatable)
else
# The startfile is installed under different names, so we just call our
diff --git a/csu/init.c b/csu/init.c
new file mode 100644
index 0000000..2b7a2ef
--- /dev/null
+++ b/csu/init.c
@@ -0,0 +1,37 @@
+/* Special startup support.
+ Copyright (C) 1997 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 Library General Public
+ License as published by the Free Software Foundation; either
+ version 2 of the License, or (at your option) any later version.
+
+ In addition to the permissions in the GNU Library General Public
+ License, the Free Software Foundation gives you unlimited
+ permission to link the compiled version of this file with other
+ programs, and to distribute those programs without any restriction
+ coming from the use of this file. (The Library General Public
+ License restrictions do apply in other respects; for example, they
+ cover modification of the file, and distribution when not linked
+ into another program.)
+
+ The GNU C Library is distributed in the hope that it will be
+ useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+ of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#if defined __GNUC__ && __GNUC__ >= 2
+
+#undef _LIBC
+#include <libio.h>
+
+/* This records which stdio is linked against in the application. */
+const void *const _IO_stdin_used = _IO_stdin;
+
+#endif