public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] libgloss: or1k: If available call the init for init_array
@ 2017-02-13 8:19 Corinna Vinschen
0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2017-02-13 8:19 UTC (permalink / raw)
To: newlib-cvs
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=ff7b7b8945b8ca356710abe67a867ed6fb81f74a
commit ff7b7b8945b8ca356710abe67a867ed6fb81f74a
Author: Stafford Horne <shorne@gmail.com>
Date: Mon Feb 6 23:38:39 2017 +0900
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.
Diff:
---
libgloss/or1k/crt0.S | 6 ++++++
1 file changed, 6 insertions(+)
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__
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-02-13 8:19 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-13 8:19 [newlib-cygwin] libgloss: or1k: If available call the init for init_array Corinna Vinschen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).