https://sourceware.org/bugzilla/show_bug.cgi?id=20523
Bug ID: 20523 Summary: powerpc64le kernel build with additional cross section references fails Product: binutils Version: 2.28 (HEAD) Status: UNCONFIRMED Severity: normal Priority: P2 Component: gold Assignee: ccoutant at gmail dot com Reporter: npiggin at gmail dot com CC: ian at airs dot com Target Milestone: --- Making a small change to the way Linux is linked, moving some text to a different output section: diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S index c157b8d..03178df 100644 --- a/arch/powerpc/kernel/vmlinux.lds.S +++ b/arch/powerpc/kernel/vmlinux.lds.S @@ -49,8 +49,7 @@ SECTIONS ALIGN_FUNCTION(); HEAD_TEXT _text = .; - /* careful! __ftr_alt_* sections need to be close to .text */ - *(.text .text.* .fixup __ftr_alt_* .ref.text) + *(.text .text.* .fixup .ref.text) SCHED_TEXT LOCK_TEXT KPROBES_TEXT @@ -63,7 +62,6 @@ SECTIONS *(.got2) __got2_end = .; #endif /* CONFIG_PPC32 */ - } :kernel . = ALIGN(PAGE_SIZE); @@ -92,6 +90,10 @@ SECTIONS __init_begin = .; INIT_TEXT_SECTION(PAGE_SIZE) :kernel + .__ftr_alternates.text : AT(ADDR(.__ftr_alternates.text) - LOAD_OFFSET) { + *(__ftr_alt*); + } + /* .exit.text is discarded at runtime, not link time, * to deal with references from __bug_table */ Results in gold failing to link the kernel ../binutils/binutils-gdb/gold/ld-new: stub group size is too large; retrying with 22020096 ../binutils/binutils-gdb/gold/ld-new: stub group size is too large; retrying with 16515072 arch/powerpc/kernel/head_64.o(__ftr_alt_97+0x40): error: relocation overflow try relinking with a smaller --stub-group-size arch/powerpc/kernel/head_64.o(__ftr_alt_97+0x7c): error: relocation overflow try relinking with a smaller --stub-group-size arch/powerpc/kernel/head_64.o(__ftr_alt_97+0xbc): error: relocation overflow try relinking with a smaller --stub-group-size arch/powerpc/lib/built-in.o(__ftr_alt_97+0x8): error: relocation overflow try relinking with a smaller --stub-group-size Where some of the instructions in __ftr_alt* have conditional branches back to .text that will be out of range and require a trampoline: 40: 00 00 82 41 beq 40 <__ftr_alt_97+0x40> Linking with ld.bfd succeeds. The "careful!" comment in the linker script is related to these relocations but should not cause this failure (runtime code patching in the kernel cannot cope with __ftr_alt patch code using branch trampolines). -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils