public inbox for linux-m68k@lists.linux-m68k.org
 help / color / mirror / Atom feed
* [PATCH] m68knommu: align BSS section to 4-byte boundaries
@ 2020-10-12  4:34 Greg Ungerer
  2020-10-12 13:34 ` Philippe De Muyter
  0 siblings, 1 reply; 3+ messages in thread
From: Greg Ungerer @ 2020-10-12  4:34 UTC (permalink / raw)
  To: linux-m68k; +Cc: Greg Ungerer

The kernel start up code for all of the nommu m68k types expects the
BSS section to be on a 4-byte boundary, and to be a whole number of 32bit
words. The BSS initialization loop sets 32bit sized quantities and has
no provision for odd or unaligned accesses.

Although this has always been the case, in practice the BSS was typically
aligned and sized this way. The problem was first observed after commit
7273ad2b08f8 ("kbuild: link lib-y objects to vmlinux forcibly when
CONFIG_MODULES=y"). Some kernel builds, depending on exact configuration,
then tended to generate even sized BSS sections - which is valid on m68k -
but our BSS init code could not handle properly.

The simplest and smallest solution is to align the BSS appropriately.

Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
---
 arch/m68k/kernel/vmlinux-nommu.lds | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/m68k/kernel/vmlinux-nommu.lds b/arch/m68k/kernel/vmlinux-nommu.lds
index 7b975420c3d9..730bb653f9c1 100644
--- a/arch/m68k/kernel/vmlinux-nommu.lds
+++ b/arch/m68k/kernel/vmlinux-nommu.lds
@@ -82,7 +82,7 @@ SECTIONS {
 		__init_end = .;
 	}
 
-	BSS_SECTION(0, 0, 0)
+	BSS_SECTION(4, 0, 4)
 
 	_end = .;
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-10-12 14:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-12  4:34 [PATCH] m68knommu: align BSS section to 4-byte boundaries Greg Ungerer
2020-10-12 13:34 ` Philippe De Muyter
2020-10-12 14:00   ` Greg Ungerer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox