1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

Mon Aug 7 14:04:36 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>

* sysdeps/generic/sysd-stdio.c (__stdio_reopen): Return failure
 	when __stdio_open fails with a code other than ENFILE or EMFILE.

	* csu/initfini.c (SECTION): New macro, different definitions for
 	#ifdef HAVE_ELF and not.
	(_init, _fini): Use that macro.
	* config.make.in (have-initfini): New variable, set by configure.
	* conf/portability.h (NEED_INETADDR, NEED_INETATON): New macros.
This commit is contained in:
Roland McGrath
1995-08-07 18:24:47 +00:00
parent 5e98d83c10
commit 99a9e88e55
5 changed files with 35 additions and 5 deletions

View File

@ -34,12 +34,22 @@ Cambridge, MA 02139, USA. */
#include <stdlib.h>
#ifdef HAVE_ELF
/* These declarations make the functions go in the right sections when
we define them below. GCC syntax does not allow the attribute
specifications to be in the function definitions themselves. */
void _init (void) __attribute__ ((section (".init")));
void _fini (void) __attribute__ ((section (".fini")));
#define SECTION(x) /* Put nothing extra before the defn. */
#else
/* Some non-ELF systems support .init and .fini sections,
but the __attribute__ syntax only works for ELF. */
#define SECTION(x) asm (".section " x);
#endif
/* End the here document containing the initial common code.
Then move the output file crtcommon.tmp to crti.s-new and crtn.s-new. */
asm ("\nEOF_common\n\
@ -48,10 +58,10 @@ cp -f crti.s-new crtn.s-new");
/* Append the .init prologue to crti.s-new. */
asm ("cat >> crti.s-new <<\\EOF.crti.init");
SECTION (".init")
void
_init (void)
{
(void) &_init; /* Don't optimize out the function! */
/* End the here document containing the .init prologue code.
Then fetch the .section directive just written and append that
to crtn.s-new, followed by the function epilogue. */
@ -67,10 +77,10 @@ asm ("\nEOF.crtn.init\
\n\
cat >> crti.s-new <<\\EOF.crti.fini");
SECTION (".fini")
void
_fini (void)
{
(void) &_fini; /* Don't optimize out the function! */
/* End the here document containing the .fini prologue code.
Then fetch the .section directive just written and append that
to crtn.s-new, followed by the function epilogue. */