From: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
To: Artur Rojek <contact@artur-rojek.eu>,
Yoshinori Sato <ysato@users.sourceforge.jp>,
Rich Felker <dalias@libc.org>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
Thomas Gleixner <tglx@linutronix.de>,
Uros Bizjak <ubizjak@gmail.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>,
"D . Jeff Dionne" <jeff@coresemi.io>,
Rob Landley <rob@landley.net>,
linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] sh: align .bss section padding to 8-byte boundary
Date: Sat, 05 Apr 2025 19:38:53 +0200 [thread overview]
Message-ID: <a3faf6820b43cca25c3384d0248f494be7312598.camel@physik.fu-berlin.de> (raw)
In-Reply-To: <20250216175545.35079-2-contact@artur-rojek.eu>
Hi Artur,
On Sun, 2025-02-16 at 18:55 +0100, Artur Rojek wrote:
> J2 based devices expect to find a devicetree blob at the end of the bss
> section. As of a77725a9a3c5, libfdt enforces 8-byte alignment for the
> dtb, causing J2 devices to fail early in sh_fdt_init.
>
> As J2 loader firmware calculates the dtb location based on the kernel
> image .bss section size, rather than the __bss_stop symbol offset, the
> required alignment can't be enforced with BSS_SECTION(0, PAGE_SIZE, 8).
> Instead, inline modified version of the above macro, which grows .bss
> by the required size.
>
> While this change affects all existing SH boards, it should be benign on
> platforms which don't need this alignment.
>
> Signed-off-by: Artur Rojek <contact@artur-rojek.eu>
> ---
> arch/sh/kernel/vmlinux.lds.S | 15 ++++++++++++++-
> 1 file changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/arch/sh/kernel/vmlinux.lds.S b/arch/sh/kernel/vmlinux.lds.S
> index 9644fe187a3f..008c30289eaa 100644
> --- a/arch/sh/kernel/vmlinux.lds.S
> +++ b/arch/sh/kernel/vmlinux.lds.S
> @@ -71,7 +71,20 @@ SECTIONS
>
> . = ALIGN(PAGE_SIZE);
> __init_end = .;
> - BSS_SECTION(0, PAGE_SIZE, 4)
> + __bss_start = .;
> + SBSS(0)
> + . = ALIGN(PAGE_SIZE);
> + .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
> + BSS_FIRST_SECTIONS
> + . = ALIGN(PAGE_SIZE);
> + *(.bss..page_aligned)
> + . = ALIGN(PAGE_SIZE);
> + *(.dynbss)
> + *(BSS_MAIN)
> + *(COMMON)
> + . = ALIGN(8);
> + }
> + __bss_stop = .;
> _end = . ;
>
> STABS_DEBUG
I'll pick this up for now since Uros has confirmed that the compiler
won't just use SBSS without breaking the ABI, so I think to use this
fix for now.
If it breaks in the future, we can change it again.
Reviewed-by: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Adrian
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
next prev parent reply other threads:[~2025-04-05 17:39 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-16 17:55 [PATCH 0/2] J2 Turtle Board fixes Artur Rojek
2025-02-16 17:55 ` [PATCH 1/2] sh: align .bss section padding to 8-byte boundary Artur Rojek
2025-02-18 12:41 ` Rob Landley
2025-03-11 17:28 ` John Paul Adrian Glaubitz
2025-03-11 23:40 ` Artur Rojek
2025-03-12 8:06 ` Geert Uytterhoeven
2025-03-13 10:36 ` John Paul Adrian Glaubitz
2025-03-12 8:21 ` John Paul Adrian Glaubitz
2025-03-12 8:32 ` Uros Bizjak
2025-03-12 8:44 ` John Paul Adrian Glaubitz
2025-03-12 9:47 ` Geert Uytterhoeven
2025-03-12 9:55 ` Uros Bizjak
2025-03-13 9:38 ` David Laight
2025-04-05 17:38 ` John Paul Adrian Glaubitz [this message]
2025-02-16 17:55 ` [PATCH 2/2] irqchip: clocksource: fix jcore-pit irq request Artur Rojek
2025-02-17 7:14 ` Uros Bizjak
2025-02-18 12:43 ` Rob Landley
2025-02-19 14:43 ` Daniel Lezcano
2025-02-19 14:50 ` Geert Uytterhoeven
2025-02-19 14:52 ` Daniel Lezcano
2025-02-27 7:52 ` [PATCH 0/2] J2 Turtle Board fixes John Paul Adrian Glaubitz
2025-02-28 3:03 ` Rob Landley
2025-02-28 8:34 ` John Paul Adrian Glaubitz
2025-02-28 22:19 ` Rob Landley
2025-02-28 22:34 ` John Paul Adrian Glaubitz
2025-03-01 3:20 ` Rob Landley
2025-04-08 15:23 ` John Paul Adrian Glaubitz
2025-04-11 11:25 ` Rob Landley
2025-06-09 10:01 ` John Paul Adrian Glaubitz
2025-06-10 20:22 ` Rob Landley
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=a3faf6820b43cca25c3384d0248f494be7312598.camel@physik.fu-berlin.de \
--to=glaubitz@physik.fu-berlin.de \
--cc=contact@artur-rojek.eu \
--cc=dalias@libc.org \
--cc=daniel.lezcano@linaro.org \
--cc=geert+renesas@glider.be \
--cc=jeff@coresemi.io \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sh@vger.kernel.org \
--cc=rob@landley.net \
--cc=tglx@linutronix.de \
--cc=ubizjak@gmail.com \
--cc=ysato@users.sourceforge.jp \
/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 NNTP newsgroup(s).