Browse Source

powerpc: Align TOC to 256 bytes

Recent toolchains force the TOC to be 256 byte aligned. We need
to enforce this alignment in our linker script, otherwise pointers
to our TOC variables (__toc_start, __prom_init_toc_start) could
be incorrect.

If they are bad, we die a few hundred instructions into boot.

Cc: stable@vger.kernel.org
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Anton Blanchard 10 năm trước cách đây
mục cha
commit
5e95235ccd
1 tập tin đã thay đổi với 1 bổ sung0 xóa
  1. 1 0
      arch/powerpc/kernel/vmlinux.lds.S

+ 1 - 0
arch/powerpc/kernel/vmlinux.lds.S

@@ -213,6 +213,7 @@ SECTIONS
 		*(.opd)
 		*(.opd)
 	}
 	}
 
 
+	. = ALIGN(256);
 	.got : AT(ADDR(.got) - LOAD_OFFSET) {
 	.got : AT(ADDR(.got) - LOAD_OFFSET) {
 		__toc_start = .;
 		__toc_start = .;
 #ifndef CONFIG_RELOCATABLE
 #ifndef CONFIG_RELOCATABLE