From patchwork Wed Sep 10 19:06:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 286 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757531202; bh=HDkiJuaMGipFlDPZBCIoOtI7abOOKmK85PpVKQ025lg=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=LJlN1lhirQGZYt8KOqZoLPxunQ0RotGEJTKn+9sMvbnJ4vJ4swtIxo8ganUmO3ebC Dzylcug4g6xCTBtAt0j2SDW07A4W9lnSQ5V3a80dV5HotEm5G814DAS3YRqYC01UJU SQ5y3TweLWT5yp3L2SQO0RCHYaE9JTYvxSMfgJQu4WlXuI8zKdS8ZbZ5bnNM6zcJIe V8Ny2dIL7HfDtRd2zPKwnrS9NwtGClDGPGEJ76EFW75QQYeWr5F09svPF58UjtUGKy 4UGU6hK6mS4NkJCvNbOHxJLyexDELiwB7sS01/y/3rJfiUyjKY+OnSCeBhV7P87IIy fA90uWD8OQZWg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B537267ABE for ; Wed, 10 Sep 2025 13:06:42 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id CXSHDycQkx8D for ; Wed, 10 Sep 2025 13:06:42 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757531202; bh=HDkiJuaMGipFlDPZBCIoOtI7abOOKmK85PpVKQ025lg=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=LJlN1lhirQGZYt8KOqZoLPxunQ0RotGEJTKn+9sMvbnJ4vJ4swtIxo8ganUmO3ebC Dzylcug4g6xCTBtAt0j2SDW07A4W9lnSQ5V3a80dV5HotEm5G814DAS3YRqYC01UJU SQ5y3TweLWT5yp3L2SQO0RCHYaE9JTYvxSMfgJQu4WlXuI8zKdS8ZbZ5bnNM6zcJIe V8Ny2dIL7HfDtRd2zPKwnrS9NwtGClDGPGEJ76EFW75QQYeWr5F09svPF58UjtUGKy 4UGU6hK6mS4NkJCvNbOHxJLyexDELiwB7sS01/y/3rJfiUyjKY+OnSCeBhV7P87IIy fA90uWD8OQZWg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A25D467A2E for ; Wed, 10 Sep 2025 13:06:42 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757531200; bh=bl2oDgxlocmIyKqIo5rmMTrBdpvD/p1un10rYVlm2EE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YvKDxgdMg1Xt2DeF2B2pa0aYRqOo2Rq5u3Uhrw6mwObNRZrb1vseQQUExdu6fdUg2 EwQ187mInoLvsFXaBc5kmM4Ve6Qx8t66UWBKs5bq/MW5PQOsWokRjOB+cyEgFTdCeI /E4uQ9wuc/G08INjgDp6KjkBeN7T03pnmYsCH0UVvZDF3oSZQcd1oM6FqTsr+3uv1/ 0qSp07gxQbUDx+vBVzYdAo1mY/DRizzU+F5oiMzzmMso6j64+lzo1C5Jwefax2MFBJ u0Hsf8rLxtKo4SnRG249F73DLZNhH2jZmWlIqgWW6e42v/IvdX8D1lMPn2ssLBB4+6 3sve76tuCa8Rg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3C16E67AB1; Wed, 10 Sep 2025 13:06:40 -0600 (MDT) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id GYlmA-ziqRQm; Wed, 10 Sep 2025 13:06:40 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1757531199; bh=r0SElFp24u3pOW4XuRuwCkzIuZM3NEOILgyqWF2bR/0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PuXyfTlHfyK03yfzzfcSOgsh8SjEVgVOSPfOa/CYL9+Wx5IJfgrK0QszJo7p/26q6 qoWMLrlTZ9CzsYkAnqm/ycUoiat4I/apP39GeSaHECaPm0P1XIyTnu6SqOwpn4sTMM FWPsKamJKzc26SOB4BsKrGQ484OfP8p9bsYsDG6LvEpptm6iNPrxveVlNeCemvRjV/ QpuU72fjIDKB96/M2ElY10TLRAm3V5NyMyqo/ncYNFvWUOngCnc8LAk+b3k1EgAzIY GwGuV646YvHuyM23+Xbqc+R9RYF/3qEgPw+DGZfQiIpnEItihKGZ3op+u25l8ayko2 CZi5H2M9bs+LQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 19B886794C; Wed, 10 Sep 2025 13:06:39 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 10 Sep 2025 13:06:17 -0600 Message-ID: <20250910190619.2507730-2-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250910190619.2507730-1-sjg@u-boot.org> References: <20250910190619.2507730-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: DUEZTHT6NQMRGPDHEABCYVIQPLDC2GIJ X-Message-ID-Hash: DUEZTHT6NQMRGPDHEABCYVIQPLDC2GIJ X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 2/2] sandbox: Use a mon_len of 0 with the library List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass In the case of the shared/static libraries, the _end and _init symbols are not necessarily provided since the linker script is provided by the program which links against the U-Boot library. In some cases the memory size can show up as less than available memory, but enough that there is insufficient memory for U-Boot to start. It seems better to just set the mon_len to 0 for the library. Signed-off-by: Simon Glass --- common/board_f.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/board_f.c b/common/board_f.c index e23134a8403..40fe3aeb481 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -273,7 +273,7 @@ static int setup_mon_len(void) #elif defined(__ARM__) || defined(__MICROBLAZE__) gd->mon_len = (ulong)__bss_end - (ulong)_start; #elif defined(CONFIG_SANDBOX) && !defined(__riscv) - gd->mon_len = (ulong)_end - (ulong)_init; + gd->mon_len = gd_ulib() ? 0 : (ulong)_end - (ulong)_init; #elif defined(CONFIG_SANDBOX) /* gcc does not provide _init in crti.o on RISC-V */ gd->mon_len = 0;