diff options
author | Stafford Horne <shorne@gmail.com> | 2017-02-06 23:38:39 +0900 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2017-02-13 09:16:51 +0100 |
commit | ff7b7b8945b8ca356710abe67a867ed6fb81f74a (patch) | |
tree | 619ebec81f962cb0a4da522417b68aeae60a6c3d /libgloss/or1k | |
parent | d1caad439334b29983c0bb3a9222f2eeb60a25a8 (diff) | |
download | newlib-ff7b7b8945b8ca356710abe67a867ed6fb81f74a.zip newlib-ff7b7b8945b8ca356710abe67a867ed6fb81f74a.tar.gz newlib-ff7b7b8945b8ca356710abe67a867ed6fb81f74a.tar.bz2 |
libgloss: or1k: If available call the init for init_array
There was an issue revealed in gdb testing where C++ virtual tables
were not getting properly initialized. This seems to be due to the
c++ global constructors moving from ctors to init_array.
This fix makes sure we call the proper method for initializing the
constructors in all places.
Diffstat (limited to 'libgloss/or1k')
-rw-r--r-- | libgloss/or1k/crt0.S | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libgloss/or1k/crt0.S b/libgloss/or1k/crt0.S index 84adba1..03d7323 100644 --- a/libgloss/or1k/crt0.S +++ b/libgloss/or1k/crt0.S @@ -36,6 +36,7 @@ the obvious things.. */ /* -------------------------------------------------------------------------- */ +#include "newlib.h" #include "include/or1k-asm.h" #include "include/or1k-sprs.h" @@ -96,6 +97,11 @@ _or1k_exception_stack_size: .word EXCEPTION_STACK_SIZE */ /* -------------------------------------------------------------------------- */ +#ifdef HAVE_INITFINI_ARRAY +#define _init __libc_init_array +#define _fini __libc_fini_array +#endif + #define GPR_BUF_OFFSET(x) (x << 2) #ifndef __OR1K_MULTICORE__ |