public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Dimitar Dimitrov <dimitar@dinux.eu>
To: binutils@sourceware.org
Cc: Dimitar Dimitrov <dimitar@dinux.eu>
Subject: [PATCH] ld: pru: Increase the default memory region sizes
Date: Tue, 21 May 2024 20:07:36 +0300	[thread overview]
Message-ID: <20240521170736.470577-1-dimitar@dinux.eu> (raw)

The default memory region sizes for PRU were set somewhat arbitrarily to
the sizes of the most popular BeagleBone board with AM33x SoC.  But the
PRU toolchain documentation has always instructed to use SoC-specific
spec files to override the defaults and set the correct memory sizes [1].

The small default memory sizes can cause IMEM memory region overflow
even for simple printf("Hello world") programs, as usually done by
Autotools checks.  The stdio is simply too big to fit in 8K
instruction memory.  This can confuse the check and lead to wrong
feature selection during configure [2].

Fix by bumping the default DMEM and IMEM memory sizes.

There is no need to backport this patch.  Issue was caught with a
feature-rich newlib build used for daily CI.  The release builds of the
PRU toolchain use stripped newlib configuration, which does not overflow
the IMEM region, even for 8K.

Ok for master?

[1] https://github.com/dinuxbg/gnuprumcu
[2] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115158

Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
---
 ld/emulparams/pruelf.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ld/emulparams/pruelf.sh b/ld/emulparams/pruelf.sh
index 48e9a3a3bea..7ed5d33bcb6 100644
--- a/ld/emulparams/pruelf.sh
+++ b/ld/emulparams/pruelf.sh
@@ -11,9 +11,9 @@ COMMONPAGESIZE="CONSTANT (COMMONPAGESIZE)"
 EMBEDDED=yes
 
 TEXT_ORIGIN=0x20000000
-TEXT_LENGTH=8K
+TEXT_LENGTH=256K
 DATA_ORIGIN=0x0
-DATA_LENGTH=8K
+DATA_LENGTH=256K
 
 ENTRY=_start
 EXTRA_EM_FILE=pruelf
-- 
2.45.0


             reply	other threads:[~2024-05-21 17:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-21 17:07 Dimitar Dimitrov [this message]
2024-05-28 15:21 ` Nick Clifton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240521170736.470577-1-dimitar@dinux.eu \
    --to=dimitar@dinux.eu \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).