From patchwork Sun Aug 2 15:05:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 1339946 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=k5FnPLom; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BKPV53HtTz9sR4 for ; Mon, 3 Aug 2020 01:06:05 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 788DB81D71; Sun, 2 Aug 2020 17:06:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="k5FnPLom"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B783A81D6D; Sun, 2 Aug 2020 17:05:59 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1B5E781817 for ; Sun, 2 Aug 2020 17:05:57 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=marek.vasut@gmail.com Received: by mail-wr1-x443.google.com with SMTP id b6so31918693wrs.11 for ; Sun, 02 Aug 2020 08:05:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=aY8KKrwLKMpZeUTTDgw8sJDswSSpFYUyIuZvwZ3f2lY=; b=k5FnPLomcObx/4b+pCobtC99uj2po/xoak8LCpTewBDdPPO9L+7b2Pz/EofbpoLtum SljG8L6tFovNL5EKyLPe1idNiZQ1LfPY3kBuM+0ssx4Fl2pV3Q4RgJETOKCY1REOeTCm qEWdok5RupzLHVLcRGcTCzGrGHSN0DQT5Nc7BRt+x/1mPr5iXo692Mu23X3UKluUPQUp sZFMzRWvxMU1bqDuVR50aEzrXQGGzotf3OWcOJRsbrLoLZppQ4wxwDjwMJENHq42Lt60 R7oaXywMZczQXKuZnxnOwgG3nlluWdk+ZpiVntOKQpZQwC1+GfUCqSeUQx+tBE22iayk N8Og== 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:mime-version :content-transfer-encoding; bh=aY8KKrwLKMpZeUTTDgw8sJDswSSpFYUyIuZvwZ3f2lY=; b=L+Oq4gqCmCEfIYCEukQdhjAbdF3wcG7NPQiXG+17WgmUd77xd8q09cCrHIcAnFlGhq 6AzSZQROhdCyHXcRZ6IytviDyWcv2VF4IuODWL6fbhwQK6WKnDJTXaxaA7dXXu14/3io H1j3dzAnHDWXyToyh9XUf2bcnE45At3iOPGXI0u6J54Mykkk4Foziuct/pgyph5b2f+Y GR5CkDH4VPzypedjhEKEEQjAZvRDu37iRZC+HpHBNtgpbuKgxjZMG9GMw8IFgnImZmtP TsEm/w3ItWimCll3TSGTIN3vA+uKfyt9jXTrYWWm9BmBNczTufY+Vg0RBBif1GNrvyJQ mQrw== X-Gm-Message-State: AOAM531K1H9yD2bIIzeBnNnKjTIOdTEyylXBPLVqnTh254iK5w//jxl2 zAhFvXYEPeRP7hIXE01Aql23bCOWYvE= X-Google-Smtp-Source: ABdhPJx7n4l5MWFPHQAW6xunIQopQGQSvcWn6RFygaRgOCUghAe2vHlxoiuBS+/6EMFE0J8gU9GRlA== X-Received: by 2002:a5d:5681:: with SMTP id f1mr10815492wrv.192.1596380756365; Sun, 02 Aug 2020 08:05:56 -0700 (PDT) Received: from desktop.lan (ip-86-49-101-166.net.upcbroadband.cz. [86.49.101.166]) by smtp.gmail.com with ESMTPSA id e5sm21414320wrc.37.2020.08.02.08.05.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Aug 2020 08:05:55 -0700 (PDT) From: Marek Vasut X-Google-Original-From: Marek Vasut To: u-boot@lists.denx.de Cc: Marek Vasut , Nobuhiro Iwamatsu Subject: [PATCH 1/3] sh: Set gd->malloc_base if MALLOC_F_LEN is set Date: Sun, 2 Aug 2020 17:05:49 +0200 Message-Id: <20200802150551.114604-1-marek.vasut+renesas@gmail.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean The gd->malloc_base must be set before the C runtime if the MALLOC_F_LEN is non-zero, otherwise we hit assertion in dlmalloc.c initf_malloc(). So set it. Signed-off-by: Marek Vasut Cc: Nobuhiro Iwamatsu --- arch/sh/lib/start.S | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/sh/lib/start.S b/arch/sh/lib/start.S index f9f26d3779..d6342a16da 100644 --- a/arch/sh/lib/start.S +++ b/arch/sh/lib/start.S @@ -53,7 +53,10 @@ _start: mov.l ._gd_init, r13 /* global data */ mov.l ._stack_init, r15 /* stack */ - +#if CONFIG_VAL(SYS_MALLOC_F_LEN) + mov.l ._gd_malloc_base, r14 + mov.l r15, @r14 +#endif mov.l ._sh_generic_init, r0 jsr @r0 mov #0, r4 @@ -70,5 +73,6 @@ loop: ._bss_start: .long bss_start ._bss_end: .long bss_end ._gd_init: .long (_start - GENERATED_GBL_DATA_SIZE) +._gd_malloc_base: .long (_start - GENERATED_GBL_DATA_SIZE + GD_MALLOC_BASE) ._stack_init: .long (_start - GENERATED_GBL_DATA_SIZE - CONFIG_SYS_MALLOC_LEN - 16) ._sh_generic_init: .long board_init_f