From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 44320 invoked by alias); 6 Feb 2017 14:39:02 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Received: (qmail 44257 invoked by uid 89); 6 Feb 2017 14:39:02 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,KAM_ASCII_DIVIDERS,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 spammy=966, sk:__libc_ X-HELO: mail-pg0-f68.google.com Received: from mail-pg0-f68.google.com (HELO mail-pg0-f68.google.com) (74.125.83.68) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 06 Feb 2017 14:39:00 +0000 Received: by mail-pg0-f68.google.com with SMTP id 75so9262537pgf.3 for ; Mon, 06 Feb 2017 06:39:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=ubhUcnOAmpRdE4ADyjqHV4xhOyepBeykqVNAdOMawSk=; b=C0Zwhm2H+yraXQ+m44ZAezZ/VfvXUwn3yp5h0EzqFFoyqesUuccJd3mBxV/yLNoo9u SISf0Sz4ej/OqR8ZI+QUoA0m59VipAPXs5/KRxmvpeQT8g4Eu9hqEViCPalt238CE0gc BSo6Ucvg318fNLcJXA4R9oRsc3iavsPleIkfWE3alZ027RJN34K2irbG2n0B+Msay2pz U191OXhupTySyxWK2Zx65ylmcYGFu2E4QLWPbLEo68s8C0CYge+Lf8BFkvSRZPwjCjZ6 rnqedstJLkYvOIdvSZQZpuAFUbU81z+LGRFLXZ9TmSemzw/hYcRtY4h1v4EcqMqHr8iB 6UKQ== X-Gm-Message-State: AIkVDXIrhCAh8XUyQRvIHwuwmvClcOITZSJ8cArO/Lje2lLPF90Smzf1/GS4m6AXPx0DHg== X-Received: by 10.99.172.2 with SMTP id v2mr13670779pge.100.1486391939249; Mon, 06 Feb 2017 06:38:59 -0800 (PST) Received: from localhost (z192.124-44-186.ppp.wakwak.ne.jp. [124.44.186.192]) by smtp.gmail.com with ESMTPSA id v186sm3247766pgv.44.2017.02.06.06.38.58 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 Feb 2017 06:38:58 -0800 (PST) From: Stafford Horne To: newlib@sourceware.org Cc: openrisc@lists.librecores.org, stefan.wallentowitz@posteo.de, Stafford Horne Subject: [PATCH 2/3] libgloss: or1k: If available call the init for init_array Date: Mon, 06 Feb 2017 14:39:00 -0000 Message-Id: <0c64720c78e17dc41fab6f2a80b6e101e78e459a.1486391219.git.shorne@gmail.com> In-Reply-To: References: In-Reply-To: References: X-SW-Source: 2017/txt/msg00130.txt.bz2 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. --- 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__ -- 2.9.3