From a8d6a0f9a88d3c324b341d25a5a9ac3d477ed3d3 Mon Sep 17 00:00:00 2001 From: Rian Quinn Date: Mon, 12 Mar 2018 15:47:32 -0600 Subject: [PATCH] remove init / fini Signed-off-by: Rian Quinn --- newlib/libc/misc/fini.c | 24 ------------------------ newlib/libc/misc/init.c | 32 -------------------------------- 2 files changed, 56 deletions(-) diff --git a/newlib/libc/misc/fini.c b/newlib/libc/misc/fini.c index ab4203b..2094650 100644 --- a/newlib/libc/misc/fini.c +++ b/newlib/libc/misc/fini.c @@ -9,27 +9,3 @@ * This file is distributed WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ - -/* Handle ELF .{pre_init,init,fini}_array sections. */ -#include - -#ifdef HAVE_INITFINI_ARRAY -extern void (*__fini_array_start []) (void) __attribute__((weak)); -extern void (*__fini_array_end []) (void) __attribute__((weak)); - -extern void _fini (void); - -/* Run all the cleanup routines. */ -void -__libc_fini_array (void) -{ - size_t count; - size_t i; - - count = __fini_array_end - __fini_array_start; - for (i = count; i > 0; i--) - __fini_array_start[i-1] (); - - _fini (); -} -#endif diff --git a/newlib/libc/misc/init.c b/newlib/libc/misc/init.c index c85d602..d96e360 100644 --- a/newlib/libc/misc/init.c +++ b/newlib/libc/misc/init.c @@ -9,35 +9,3 @@ * This file is distributed WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ - -/* Handle ELF .{pre_init,init,fini}_array sections. */ -#include - -#ifdef HAVE_INITFINI_ARRAY - -/* These magic symbols are provided by the linker. */ -extern void (*__preinit_array_start []) (void) __attribute__((weak)); -extern void (*__preinit_array_end []) (void) __attribute__((weak)); -extern void (*__init_array_start []) (void) __attribute__((weak)); -extern void (*__init_array_end []) (void) __attribute__((weak)); - -extern void _init (void); - -/* Iterate over all the init routines. */ -void -__libc_init_array (void) -{ - size_t count; - size_t i; - - count = __preinit_array_end - __preinit_array_start; - for (i = 0; i < count; i++) - __preinit_array_start[i] (); - - _init (); - - count = __init_array_end - __init_array_start; - for (i = 0; i < count; i++) - __init_array_start[i] (); -} -#endif