]> code.ossystems Code Review - meta-freescale.git/commitdiff
linux-qoriq: fix the kernel hang issue with gcc-5.2
authorZhenhua Luo <zhenhua.luo@freescale.com>
Tue, 10 Nov 2015 05:53:48 +0000 (13:53 +0800)
committerOtavio Salvador <otavio@ossystems.com.br>
Tue, 19 Apr 2016 18:03:21 +0000 (15:03 -0300)
Backport a patch to fix the kernel hang issue when the uImage is built
by gcc-5.2.

The details can be found in
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=5e95235

Signed-off-by: Zhenhua Luo <zhenhua.luo@freescale.com>
(backported from meta-fsl-ppc:95d9f9aba81ccdae53011ac8c6fbbc2605b9cedc)
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
recipes-kernel/linux/linux-qoriq/0001-powerpc-Align-TOC-to-256-bytes.patch [new file with mode: 0644]
recipes-kernel/linux/linux-qoriq_3.12.bb

diff --git a/recipes-kernel/linux/linux-qoriq/0001-powerpc-Align-TOC-to-256-bytes.patch b/recipes-kernel/linux/linux-qoriq/0001-powerpc-Align-TOC-to-256-bytes.patch
new file mode 100644 (file)
index 0000000..2131c9d
--- /dev/null
@@ -0,0 +1,37 @@
+From 7d4d16a6ccdd6d965b84284262a67d5b63426d50 Mon Sep 17 00:00:00 2001
+From: Zhenhua Luo <zhenhua.luo@freescale.com>
+Date: Mon, 9 Nov 2015 04:36:29 -0600
+Subject: [PATCH] powerpc: Align TOC to 256 bytes
+
+Recent toolchains(gcc-5.2) 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.
+
+Upstream-Status: Backport
+
+Backport from https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=5e95235
+
+Signed-off-by: Zhenhua Luo <zhenhua.luo@freescale.com>
+---
+ arch/powerpc/kernel/vmlinux.lds.S | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
+index f096e72..3266864 100644
+--- a/arch/powerpc/kernel/vmlinux.lds.S
++++ b/arch/powerpc/kernel/vmlinux.lds.S
+@@ -213,6 +213,8 @@ SECTIONS
+               *(.opd)
+       }
++      . = ALIGN(256);
++
+       .got : AT(ADDR(.got) - LOAD_OFFSET) {
+               __toc_start = .;
+ #ifndef CONFIG_RELOCATABLE
+-- 
+2.3.3
+
index 1d973cde5fe2a9538a23d0178312b92f70bc9bcb..23a2e004b4e1d7490d2c3ecfbf56b56eeeca2b29 100644 (file)
@@ -6,6 +6,7 @@ SRC_URI = "git://git.freescale.com/ppc/sdk/linux.git;nobranch=1 \
     file://0001-ARM-8158-LLVMLinux-use-static-inline-in-ARM-ftrace.patch \
     file://0001-ARM-LLVMLinux-Change-extern-inline-to-static-inline.patch \
     file://0003-use-static-inline-in-ARM-lifeboot.h.patch \
+    file://0001-powerpc-Align-TOC-to-256-bytes.patch \
 "
 
 SRCREV = "f488de6741d5ba805b9fe813d2ddf32368d3a888"