From d9f5e2bb089a2e6fa42e9f925dbeb8d19114ce98 Mon Sep 17 00:00:00 2001 From: John Reiser Date: Sun, 17 Dec 2006 16:34:21 -0800 Subject: [PATCH] arm-linux.kernel alignment fix --- src/p_vmlinx.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/p_vmlinx.cpp b/src/p_vmlinx.cpp index 4d1d6c02..470ed653 100644 --- a/src/p_vmlinx.cpp +++ b/src/p_vmlinx.cpp @@ -800,7 +800,8 @@ void PackVmlinuxARM::pack(OutputFile *fo) shdro[1].sh_type = Elf32_Shdr::SHT_PROGBITS; shdro[1].sh_flags = Elf32_Shdr::SHF_ALLOC | Elf32_Shdr::SHF_EXECINSTR; shdro[1].sh_offset = fo_off; - shdro[1].sh_size = sizeof(stub_arm_linux_kernel_vmlinux_head) + txt_c_len + lsize; + shdro[1].sh_size = sizeof(stub_arm_linux_kernel_vmlinux_head) + + txt_c_len + (3& -txt_c_len) + lsize; shdro[1].sh_addralign = 1; // First word from vmlinux-head.S @@ -813,7 +814,8 @@ void PackVmlinuxARM::pack(OutputFile *fo) fo_off += sizeof(stub_arm_linux_kernel_vmlinux_head); - fo->write(obuf, ~3& (3+ txt_c_len)); fo_off += ~3& (3+ txt_c_len); + fo->write(obuf, txt_c_len); fo_off += txt_c_len; + tmp_le32 = 0; fo->write(&tmp_le32, 3& -txt_c_len); fo_off += 3& -txt_c_len; fo->write(loader, lsize); fo_off += lsize; #if 0