提交 3f6c515d 编写于 作者: P Paul Cercueil 提交者: Thomas Bogendoerfer

MIPS: vmlinux.lds.S: Fix appended dtb not properly aligned

Commit 6654111c ("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 7a05293a ("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: 6654111c ("MIPS: vmlinux.lds.S: align raw appended dtb to 8 bytes")
Cc: Bjørn Mork <bjorn@mork.no>
Signed-off-by: NPaul Cercueil <paul@crapouillou.net>
Signed-off-by: NThomas Bogendoerfer <tsbogend@alpha.franken.de>
上级 bd67b711
...@@ -176,7 +176,7 @@ SECTIONS ...@@ -176,7 +176,7 @@ SECTIONS
.fill : { .fill : {
FILL(0); FILL(0);
BYTE(0); BYTE(0);
. = ALIGN(8); STRUCT_ALIGN();
} }
__appended_dtb = .; __appended_dtb = .;
/* leave space for appended DTB */ /* leave space for appended DTB */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册