mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rosen Penev <rosenp@gmail.com>
To: linux-mips@vger.kernel.org
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	Nathan Chancellor <nathan@kernel.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Bill Wendling <morbo@google.com>,
	Justin Stitt <justinstitt@google.com>,
	linux-kernel@vger.kernel.org (open list),
	llvm@lists.linux.dev (open list:CLANG/LLVM BUILD
	SUPPORT:Keyword:\b(?i:clang|llvm)\b)
Subject: [PATCH] MIPS: boot: compressed: place .rodata.* and discard .MIPS.abiflags
Date: Fri,  9 Oct 2026 16:28:57 -0700	[thread overview]
Message-ID: <20261009232857.655265-1-rosenp@gmail.com> (raw)

The decompressor linker script only collects .rodata. Clang emits the
decompressor's strings in .rodata.str1.1 and also produces a
.MIPS.abiflags section. GNU ld places such orphans next to similar
sections, but ld.lld puts them after .bss:

  [ 5] .bss            NOBITS   809246c0 5346b8 402010
  [ 6] .MIPS.abiflags  ...      80d266d0 9366d0 000018
  [ 7] .rodata.str1.1  PROGBITS 80d266e8 9366e8 000164

This pulls the 4 MB of .bss (mostly the boot heap) into the file and
leaves the strings beyond _end. For BCM47XX vmlinuz grows from 5.4 MB
to 9.6 MB.

Collect .rodata.* with .rodata, and discard .MIPS.abiflags and
.gnu.attributes as arch/mips/kernel/vmlinux.lds.S does.

Assisted-by: LLM
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
 arch/mips/boot/compressed/ld.script | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/mips/boot/compressed/ld.script b/arch/mips/boot/compressed/ld.script
index 0ebb667274d6..c45be18c6f0d 100644
--- a/arch/mips/boot/compressed/ld.script
+++ b/arch/mips/boot/compressed/ld.script
@@ -17,7 +17,7 @@ SECTIONS
 	/* . = VMLINUZ_LOAD_ADDRESS; */
 	.text : {
 		*(.text)
-		*(.rodata)
+		*(.rodata .rodata.*)
 	}: text
 	/* End of text section */
 
@@ -50,7 +50,9 @@ SECTIONS
 
 	/* Sections to be discarded */
 	/DISCARD/ : {
+		*(.MIPS.abiflags)
 		*(.MIPS.options)
+		*(.gnu.attributes)
 		*(.options)
 		*(.pdr)
 		*(.reginfo)
-- 
2.56.0


                 reply	other threads:[~2026-10-09 23:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20261009232857.655265-1-rosenp@gmail.com \
    --to=rosenp@gmail.com \
    --cc=justinstitt@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=morbo@google.com \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=tsbogend@alpha.franken.de \
    /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

all inboxes | Powered by JetHome®