Committed, libgloss: hook up cris-elf to the initfini-array support.
After a binutils change "a while ago" (2015-12) to default to --enable-initfini-array, i.e. to merge .ctors and .dtors into .init_array and .fini_array, this is needed for cdtors to run at all. Based on what goes on in arm/ and aarch64/. Tested for cris-elf by running the gcc testsuite. By the way, the configure test doesn't detect this change, so the HAVE_INITFINI_ARRAY ifdeffery is somewhat redundant. Still, the change is tested to be safe with older binutils too. libgloss/ * cris/crt0.S, cris/lcrt0.c: Include newlib.h. [HAVE_INITFINI_ARRAY] (_init): Define to __libc_init_array. [HAVE_INITFINI_ARRAY] (_fini): Ditto __libc_fini_array.
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
/* Support for cris*-axis-linux-gnu and src/sim/cris simulator.
|
||||
Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 Axis Communications.
|
||||
Copyright (C) 2000-2005, 2017 Axis Communications.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
@ -27,6 +27,12 @@
|
||||
POSSIBILITY OF SUCH DAMAGE. */
|
||||
|
||||
#include "linunistd.h"
|
||||
#include "newlib.h"
|
||||
|
||||
#ifdef HAVE_INITFINI_ARRAY
|
||||
#define _init __libc_init_array
|
||||
#define _fini __libc_fini_array
|
||||
#endif
|
||||
|
||||
extern void exit (int) __attribute ((__noreturn__));
|
||||
|
||||
|
Reference in New Issue
Block a user