]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
powerpc/64: Fix placement of .text to be immediately following .head.text
authorNicholas Piggin <npiggin@gmail.com>
Sat, 26 Nov 2016 03:20:31 +0000 (14:20 +1100)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 1 Dec 2016 11:26:31 +0000 (22:26 +1100)
Do not introduce any additional alignment. Placement of text section
will be set by fixed section macros. Without this, output section
alignment defaults to 4096, which makes BookE text section start at
0x1000 when it is expected to start at 0x100.

This was introduced by commit 57f266497d81 ("powerpc: Use gas sections
for arranging exception vectors") and was caught with the scripted head
section checker (not yet merged).

Fixes: 57f266497d81 ("powerpc: Use gas sections for arranging exception vectors")
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/kernel/vmlinux.lds.S

index 8295f51c1a5f9023022273d6e19b9e2a46ae4451..7394b770ae1f6b2402ef2b04fe23e92eae2c7ee2 100644 (file)
@@ -94,8 +94,17 @@ SECTIONS
         * detected, and will result in a crash at boot due to offsets being
         * wrong.
         */
+#ifdef CONFIG_PPC64
+       /*
+        * BLOCK(0) overrides the default output section alignment because
+        * this needs to start right after .head.text in order for fixed
+        * section placement to work.
+        */
+       .text BLOCK(0) : AT(ADDR(.text) - LOAD_OFFSET) {
+#else
        .text : AT(ADDR(.text) - LOAD_OFFSET) {
                ALIGN_FUNCTION();
+#endif
                /* careful! __ftr_alt_* sections need to be close to .text */
                *(.text .fixup __ftr_alt_* .ref.text)
                SCHED_TEXT