Skip to content

Commit

Permalink
remove init / fini
Browse files Browse the repository at this point in the history
Signed-off-by: Rian Quinn <rianquinn@gmail.com>
  • Loading branch information
rianquinn committed Mar 12, 2018
1 parent 14ab428 commit a8d6a0f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 56 deletions.
24 changes: 0 additions & 24 deletions newlib/libc/misc/fini.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <sys/types.h>

#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
32 changes: 0 additions & 32 deletions newlib/libc/misc/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <sys/types.h>

#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

0 comments on commit a8d6a0f

Please sign in to comment.