diff options
author | Jakub Jelinek <jakub@redhat.com> | 2005-11-15 08:22:03 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2005-11-15 08:22:03 +0000 |
commit | 22d7fbdbae4032639461a7a081762a05deee0529 (patch) | |
tree | ff70bd4613f1f05823b2417b2687449d73ac45b0 /csu | |
parent | 1beea155aecf2e7d6bfa1399b7c0f4f53dde408c (diff) | |
download | glibc-22d7fbdbae4032639461a7a081762a05deee0529.tar.gz glibc-22d7fbdbae4032639461a7a081762a05deee0529.tar.xz glibc-22d7fbdbae4032639461a7a081762a05deee0529.zip |
Updated to fedora-glibc-20051115T0809
Diffstat (limited to 'csu')
-rw-r--r-- | csu/Makefile | 17 | ||||
-rw-r--r-- | csu/elf-init.c | 17 | ||||
-rw-r--r-- | csu/munch-tmpl.c | 38 | ||||
-rw-r--r-- | csu/munch.awk | 11 |
4 files changed, 6 insertions, 77 deletions
diff --git a/csu/Makefile b/csu/Makefile index bd82641d41..550dc2983c 100644 --- a/csu/Makefile +++ b/csu/Makefile @@ -39,8 +39,8 @@ omit-deps = $(patsubst %.o,%,$(start-installed-name) g$(start-installed-name) \ b$(start-installed-name) $(csu-dummies) \ S$(start-installed-name)) install-lib = $(start-installed-name) g$(start-installed-name) $(csu-dummies) -distribute = initfini.c gmon-start.c start.c defs.awk munch.awk \ - abi-note.S init.c munch-tmpl.c not-cancel.h +distribute = initfini.c gmon-start.c start.c defs.awk \ + abi-note.S init.c c not-cancel.h generated = version-info.h before-compile = $(objpfx)version-info.h @@ -75,19 +75,6 @@ before-compile += $(objpfx)abi-tag.h generated += abi-tag.h endif -ifneq (yes,$(gnu-ld)) -libc-init = munch-init -$(objpfx)munch-init.c: munch.awk munch-tmpl.c $(+subdir_inits) - $(AWK) -f $< subdirs='$(+init_subdirs)' $(word 2,$^) > $@-t - mv -f $@-t $@ -generated += munch-init.c - -# All initialization source files. -+subdir_inits := $(wildcard $(foreach dir,$(subdirs),$(dir)/init-$(dir).c)) -# All subdirectories containing initialization source files. -+init_subdirs := $(patsubst %/,%,$(dir $(+subdir_inits))) -endif - ifeq ($(have-initfini),yes) CPPFLAGS += -DHAVE_INITFINI diff --git a/csu/elf-init.c b/csu/elf-init.c index 12ae15747c..0ec460b67b 100644 --- a/csu/elf-init.c +++ b/csu/elf-init.c @@ -36,7 +36,7 @@ #include <stddef.h> -#ifdef HAVE_INITFINI_ARRAY + /* These magic symbols are provided by the linker. */ extern void (*__preinit_array_start []) (int, char **, char **) attribute_hidden; @@ -81,11 +81,10 @@ extern void _fini (void); void __libc_csu_init (int argc, char **argv, char **envp) { -#ifdef HAVE_INITFINI_ARRAY /* For dynamically linked executables the preinit array is executed by the dynamic linker (before initializing any shared object. */ -# ifndef LIBC_NONSHARED +#ifndef LIBC_NONSHARED /* For static executables, preinit happens rights before init. */ { const size_t size = __preinit_array_end - __preinit_array_start; @@ -93,19 +92,13 @@ __libc_csu_init (int argc, char **argv, char **envp) for (i = 0; i < size; i++) (*__preinit_array_start [i]) (argc, argv, envp); } -# endif #endif _init (); -#ifdef HAVE_INITFINI_ARRAY - { - const size_t size = __init_array_end - __init_array_start; - size_t i; - for (i = 0; i < size; i++) + const size_t size = __init_array_end - __init_array_start; + for (size_t i = 0; i < size; i++) (*__init_array_start [i]) (argc, argv, envp); - } -#endif } /* This function should not be used anymore. We run the executable's @@ -115,11 +108,9 @@ void __libc_csu_fini (void) { #ifndef LIBC_NONSHARED -# ifdef HAVE_INITFINI_ARRAY size_t i = __fini_array_end - __fini_array_start; while (i-- > 0) (*__fini_array_start [i]) (); -# endif _fini (); #endif diff --git a/csu/munch-tmpl.c b/csu/munch-tmpl.c deleted file mode 100644 index f807cf9a3f..0000000000 --- a/csu/munch-tmpl.c +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright (C) 1991, 1995, 1997, 2000 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 <stdlib.h> - - -EXTERNS - -void -__libc_init (int argc, char **argv, char **envp) -{ - CALLS - -#ifdef HAVE_INITFINI - { - /* These functions are defined in crti.o to run the .init and .fini - sections, which are used for initializers and finalizers. */ - extern void _init (void), _fini (void); - atexit (&_fini); /* Arrange for _fini to run at exit. */ - _init (); - } -#endif -} diff --git a/csu/munch.awk b/csu/munch.awk deleted file mode 100644 index 9ebcff8ecf..0000000000 --- a/csu/munch.awk +++ /dev/null @@ -1,11 +0,0 @@ -BEGIN { special = 0 } - -/EXTERNS/ { ndirs = split(subdirs, dirs) - for (i = 1; i <= ndirs; ++i) - printf "extern void __init_%s (int argc, char **argv, char **envp);\n", dirs[i] - special = 1 } -/CALLS/ { ndirs = split(subdirs, dirs) - for (i = 1; i <= ndirs; ++i) printf " __init_%s (argc, argv, envp);\n", dirs[i] - special = 1 } - -{ if (special == 0) print $0; special = 0 } |