Remove the call to init_fallthru/fini_fallthru and call _init/_fini

directly for MIPS.  Making these global to keep gcc4 happy broke gcc3.
Shaves a few instructions off this path as well.

Other arches to follow with similar changes.

With much help from Nick Hudson.
This commit is contained in:
simonb 2006-06-30 09:00:46 +00:00
parent 3fb751b1b5
commit 842e180144
2 changed files with 8 additions and 15 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: crti.c,v 1.3 2006/05/19 19:11:12 christos Exp $ */
/* $NetBSD: crti.c,v 1.4 2006/06/30 09:00:46 simonb Exp $ */
/*-
* Copyright (c) 1998, 2001, 2002 The NetBSD Foundation, Inc.
@ -43,6 +43,7 @@
#include "sysident.h"
#include <dot_init.h>
#ifndef MD_DO_NOT_NEED_FALLTHRU
INIT_FALLTHRU_DECL;
FINI_FALLTHRU_DECL;
@ -62,6 +63,7 @@ _fini(void)
FINI_FALLTHRU();
}
#endif /* MD_DO_NOT_NEED_FALLTHRU */
MD_INIT_SECTION_PROLOGUE;
MD_FINI_SECTION_PROLOGUE;

View File

@ -1,4 +1,4 @@
/* $NetBSD: dot_init.h,v 1.5 2006/06/12 22:05:49 mrg Exp $ */
/* $NetBSD: dot_init.h,v 1.6 2006/06/30 09:00:46 simonb Exp $ */
/*-
* Copyright (c) 2001 Ross Harvey
@ -36,17 +36,6 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
/*
* These must be extern to avoid warnings ("declared static but never defined")
* However, only the declaration is extern, the actually __asm() defines them
* as static.
*/
#define INIT_FALLTHRU_DECL void init_fallthru(void)
#define FINI_FALLTHRU_DECL void fini_fallthru(void)
#define INIT_FALLTHRU() init_fallthru()
#define FINI_FALLTHRU() fini_fallthru()
#define ra "$31"
/*
@ -91,8 +80,10 @@
" .set reorder \n"\
".previous")
#define MD_INIT_SECTION_PROLOGUE MD_SECTION_PROLOGUE(.init, init_fallthru)
#define MD_FINI_SECTION_PROLOGUE MD_SECTION_PROLOGUE(.fini, fini_fallthru)
#define MD_INIT_SECTION_PROLOGUE MD_SECTION_PROLOGUE(.init, _init)
#define MD_FINI_SECTION_PROLOGUE MD_SECTION_PROLOGUE(.fini, _fini)
#define MD_INIT_SECTION_EPILOGUE MD_SECTION_EPILOGUE(.init)
#define MD_FINI_SECTION_EPILOGUE MD_SECTION_EPILOGUE(.fini)
#define MD_DO_NOT_NEED_FALLTHRU