]> git.baikalelectronics.ru Git - kernel.git/commit
MIPS: vmlinux.lds.S: Fix appended dtb not properly aligned
authorPaul Cercueil <paul@crapouillou.net>
Tue, 16 Mar 2021 15:45:15 +0000 (15:45 +0000)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Tue, 16 Mar 2021 21:53:08 +0000 (22:53 +0100)
commit6bcd645640e89b367b2dbc00058c562862dde3a5
tree33ed4bfd81f4d448a0393543de259770719427a3
parentbeb48dc7c460957da6f9b27fe3fd05f9fb464d68
MIPS: vmlinux.lds.S: Fix appended dtb not properly aligned

Commit 335ab1da1625 ("MIPS: vmlinux.lds.S: align raw appended dtb to 8
bytes") changed the alignment from STRUCT_ALIGNMENT bytes to 8 bytes.

The commit's message makes it sound like it was actually done on
purpose, but this is not the case. The commit was written when raw
appended dtb were not aligned at all. The STRUCT_ALIGN() was added a few
days before, in commit dee496a2cfd0 ("MIPS: boot/compressed: Copy DTB to
aligned address"). The true purpose of the commit was not to align
specifically to 8 bytes, but to make sure that the generated vmlinux'
size was properly padded to the alignment required for DTBs.

While the switch to 8-byte alignment worked for vmlinux-appended dtb
blobs, it broke vmlinuz-appended dtb blobs, as the decompress routine
moves the blob to a STRUCT_ALIGNMENT aligned address.

Fix this by changing the raw appended dtb blob alignment from 8 bytes
back to STRUCT_ALIGNMENT bytes in vmlinux.lds.S.

Fixes: 335ab1da1625 ("MIPS: vmlinux.lds.S: align raw appended dtb to 8 bytes")
Cc: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
arch/mips/kernel/vmlinux.lds.S