From: Helge Deller <deller@gmx.de>
To: mcgrof@kernel.org, jeyu@kernel.org,
linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-parisc@vger.kernel.org
Subject: [PATCH 1/2] modules: Ensure natural alignment for .altinstructions and __bug_table sections
Date: Mon, 27 Jun 2022 21:05:50 +0200 [thread overview]
Message-ID: <20220627190551.517561-1-deller@gmx.de> (raw)
In the kernel image vmlinux.lds.S linker scripts the .altinstructions
and __bug_table sections are 32- or 64-bit aligned because they hold 32-
and/or 64-bit values.
But for modules the module.lds.S linker script doesn't define a default
alignment yet, so the linker chooses the default byte-alignment, which
then leads to unnecessary unaligned memory accesses at runtime.
This patch adds the missing alignments.
Signed-off-by: Helge Deller <deller@gmx.de>
---
scripts/module.lds.S | 2 ++
1 file changed, 2 insertions(+)
diff --git a/scripts/module.lds.S b/scripts/module.lds.S
index 1d0e1e4dc3d2..3a3aa2354ed8 100644
--- a/scripts/module.lds.S
+++ b/scripts/module.lds.S
@@ -27,6 +27,8 @@ SECTIONS {
.ctors 0 : ALIGN(8) { *(SORT(.ctors.*)) *(.ctors) }
.init_array 0 : ALIGN(8) { *(SORT(.init_array.*)) *(.init_array) }
+ .altinstructions 0 : ALIGN(8) { KEEP(*(.altinstructions)) }
+ __bug_table 0 : ALIGN(8) { KEEP(*(__bug_table)) }
__jump_table 0 : ALIGN(8) { KEEP(*(__jump_table)) }
__patchable_function_entries : { *(__patchable_function_entries) }
--
2.35.3
next reply other threads:[~2022-06-27 19:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-27 19:05 Helge Deller [this message]
2022-06-27 19:05 ` [PATCH 2/2] MAINTAINERS: Update file list for module maintainers Helge Deller
2022-07-11 19:04 ` Luis Chamberlain
2022-07-01 18:02 ` [PATCH 1/2] modules: Ensure natural alignment for .altinstructions and __bug_table sections Luis Chamberlain
2022-07-01 18:22 ` Helge Deller
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=20220627190551.517561-1-deller@gmx.de \
--to=deller@gmx.de \
--cc=jeyu@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-modules@vger.kernel.org \
--cc=linux-parisc@vger.kernel.org \
--cc=mcgrof@kernel.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
all inboxes | Powered by JetHome®