Skip to content

Commit dadc4a1

Browse files
npigginmpe
authored andcommitted
powerpc/64: Fix placement of .text to be immediately following .head.text
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 57f2664 ("powerpc: Use gas sections for arranging exception vectors") and was caught with the scripted head section checker (not yet merged). Fixes: 57f2664 ("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>
1 parent 409bf7f commit dadc4a1

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

arch/powerpc/kernel/vmlinux.lds.S

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,17 @@ SECTIONS
9494
* detected, and will result in a crash at boot due to offsets being
9595
* wrong.
9696
*/
97+
#ifdef CONFIG_PPC64
98+
/*
99+
* BLOCK(0) overrides the default output section alignment because
100+
* this needs to start right after .head.text in order for fixed
101+
* section placement to work.
102+
*/
103+
.text BLOCK(0) : AT(ADDR(.text) - LOAD_OFFSET) {
104+
#else
97105
.text : AT(ADDR(.text) - LOAD_OFFSET) {
98106
ALIGN_FUNCTION();
107+
#endif
99108
/* careful! __ftr_alt_* sections need to be close to .text */
100109
*(.text .fixup __ftr_alt_* .ref.text)
101110
SCHED_TEXT

0 commit comments

Comments
 (0)