[Bug gold/20878] gold powerpc64 le linux fails to link large Linux kernel
https://sourceware.org/bugzilla/show_bug.cgi?id=20878 npiggin at gmail dot com changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|--- |FIXED --- Comment #7 from npiggin at gmail dot com --- Fixed -- 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
[Bug gold/20878] gold powerpc64 le linux fails to link large Linux kernel
https://sourceware.org/bugzilla/show_bug.cgi?id=20878 --- Comment #6 from npiggin at gmail dot com --- This commit fixes the bug for me. Thank you. -- 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
[Bug gold/20522] linking powerpc64le Linux kernel with --emit-relocs causes internal error in set_info_section, at output.h:3386
https://sourceware.org/bugzilla/show_bug.cgi?id=20522 --- Comment #4 from npiggin at gmail dot com --- Confirmed again, the internal error only occurs when linking with *(.rela*), and not with *(.rela.dyn). It would be nice to turn this into a useful error message, but importance could be reduced. -- 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
[Bug gold/20878] gold powerpc64 le linux fails to link large Linux kernel
https://sourceware.org/bugzilla/show_bug.cgi?id=20878 --- Comment #3 from npiggin at gmail dot com --- The files are too large to attach here. I've uploaded to: fs.ozlabs.ibm.com/~npiggin/binutils-pr20878.tar.xz (IBM-internal, apologies to others) You'll want to unpack that inside a new directory. Then within that directory run: ld -EL -m elf64lppc -Bstatic --build-id -X -o vmlinux -T ./arch/powerpc/kernel/vmlinux.lds --whole-archive built-in.o .tmp_kallsyms4.o -- 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
[Bug gold/20878] gold powerpc64 le linux fails to link large pie Linux kernel
https://sourceware.org/bugzilla/show_bug.cgi?id=20878 npiggin at gmail dot com changed: What|Removed |Added CC||amodra at gmail dot com -- 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
[Bug gold/20878] New: gold powerpc64 le linux fails to link large pie Linux kernel
https://sourceware.org/bugzilla/show_bug.cgi?id=20878 Bug ID: 20878 Summary: gold powerpc64 le linux fails to link large pie Linux kernel 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: --- powerpc64le Linux kernel configured with all options and CONFIG_RELOCATABLE fails at the final link: $ ~/src/binutils-gdb/gold/ld-new -EL -m elf64lppc -pie --build-id -X -o vmlinux -T ./arch/powerpc/kernel/vmlinux.lds --whole-archive built-in.o .tmp_kallsyms3.o ld-new: stub group size is too large; retrying with 0x150 ld-new: stub group size is too large; retrying with 0xfc built-in.o(arch/powerpc/kernel/setup-common.o):setup-common.c:function setup_arch: error: relocation overflow try relinking with a smaller --stub-group-size built-in.o(arch/powerpc/kernel/setup-common.o):setup-common.c:function setup_arch: error: relocation overflow try relinking with a smaller --stub-group-size ld.bfd succeeds: $ ~/src/binutils-gdb/ld/ld-new -EL -m elf64lppc -pie --orphan-handling=warn --build-id -X -o vmlinux -T ./arch/powerpc/kernel/vmlinux.lds --whole-archive built-in.o .tmp_kallsyms3.o --stats ld-new: linker stubs in 7 groups ld-new: branch 1132 ld-new: toc adjust 0 ld-new: long branch 7180 ld-new: long toc adj 0 ld-new: plt call 0 ld-new: plt call toc 0 ld-new: global entry 0 ld-new: total time in link: 7.04 ld-new: data size 549404672 $ ls -l vmlinux -rwxr-xr-x 1 npiggin npiggin 176679472 Nov 28 23:21 vmlinux -- 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
[Bug gold/20767] empty archive input causes "internal error in target, at ../../gold/parameters.h:105"
https://sourceware.org/bugzilla/show_bug.cgi?id=20767 npiggin at gmail dot com changed: What|Removed |Added CC||ccoutant at gmail dot com -- 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
[Bug gold/20767] New: empty archive input causes "internal error in target, at ../../gold/parameters.h:105"
https://sourceware.org/bugzilla/show_bug.cgi?id=20767 Bug ID: 20767 Summary: empty archive input causes "internal error in target, at ../../gold/parameters.h:105" 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: --- echo "EXTERN(test)" > test.lds ar rcsD test.o ld.gold -r -o test2.o -T test.lds test.o This causes ld.gold: internal error in target, at ../../gold/parameters.h:105 ld.bfd succeeds. The Linux kernel 4.9 build is using this pattern now. It would be good to be compatible with ld.bfd. -- 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
[Bug gold/20749] New: gold does not support --orphan-handling
https://sourceware.org/bugzilla/show_bug.cgi?id=20749 Bug ID: 20749 Summary: gold does not support --orphan-handling Product: binutils Version: 2.28 (HEAD) Status: UNCONFIRMED Severity: enhancement Priority: P2 Component: gold Assignee: ccoutant at gmail dot com Reporter: npiggin at gmail dot com CC: ian at airs dot com Target Milestone: --- -- 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
[Bug gold/20522] linking powerpc64le Linux kernel with --emit-relocs causes internal error in set_info_section, at output.h:3386
https://sourceware.org/bugzilla/show_bug.cgi?id=20522 --- Comment #3 from npiggin at gmail dot com --- Revisiting this issue, the "internal error" does go away when modifying the linker script as you suggest. -- 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
[Bug gold/20523] powerpc64le kernel build with additional cross section references fails
https://sourceware.org/bugzilla/show_bug.cgi?id=20523 npiggin at gmail dot com changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|--- |FIXED --- Comment #6 from npiggin at gmail dot com --- This has solved the build failure. Thank you. -- 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
[Bug gold/20523] powerpc64le kernel build with additional cross section references fails
https://sourceware.org/bugzilla/show_bug.cgi?id=20523 --- Comment #3 from npiggin at gmail dot com --- Apologies, it needs this hunk as well. diff --git a/arch/powerpc/include/asm/feature-fixups.h b/arch/powerpc/include/asm/feature-fixups.h index 9a67a38..f7796b3 100644 --- a/arch/powerpc/include/asm/feature-fixups.h +++ b/arch/powerpc/include/asm/feature-fixups.h @@ -33,7 +33,7 @@ #define FTR_SECTION_ELSE_NESTED(label) \ label##2: \ - .pushsection __ftr_alt_##label,"a"; \ + .pushsection __ftr_alt_##label,"ax";\ .align 2; \ label##3: -- 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
[Bug gold/20522] linking powerpc64le Linux kernel with --emit-relocs causes internal error in set_info_section, at output.h:3386
https://sourceware.org/bugzilla/show_bug.cgi?id=20522 --- Comment #2 from npiggin at gmail dot com --- Okay, it looks like it would be cleaner if I change the script to use *(.rela.dyn) when I introduce --emit-relocs to the build. As you say, ld is not moving the rela sections anyway. I don't think we need to be concerned with -z nocombreloc. That said, gold is still failing with the same error when using "*(.rela.dyn)" -- 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
[Bug ld/20519] "PowerPC64, Don't copy weak symbol dyn_relocs to weakdef." causes abort at elf64-ppc.c:14898
https://sourceware.org/bugzilla/show_bug.cgi?id=20519 --- Comment #5 from npiggin at gmail dot com --- Yes this works now, thank you. -- 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
[Bug gold/20523] powerpc64le kernel build with additional cross section references fails
https://sourceware.org/bugzilla/show_bug.cgi?id=20523 npiggin at gmail dot com changed: What|Removed |Added Target||powerpc64le-unknown-linux-g ||nu Host||powerpc64le-unknown-linux-g ||nu --- Comment #1 from npiggin at gmail dot com --- Tested with 980aa3e6dfeb0f018915f65be4b2987667f31fe9 -- 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
[Bug gold/20523] New: powerpc64le kernel build with additional cross section references fails
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
[Bug gold/20522] New: linking powerpc64le Linux kernel with --emit-relocs causes internal error in set_info_section, at output.h:3386
https://sourceware.org/bugzilla/show_bug.cgi?id=20522 Bug ID: 20522 Summary: linking powerpc64le Linux kernel with --emit-relocs causes internal error in set_info_section, at output.h:3386 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: --- I have a requirement to build the kernel with --emit-relocs, in order to do some post-link fixups of runtime alternate code patches. Taking a vanilla kernel and adding --emit-relocs to the final link ld-new -EL -m elf64lppc -pie --emit-relocs --build-id -o vmlinux -T ./arch/powerpc/kernel/vmlinux.lds arch/powerpc/kernel/head_64.o arch/powerpc/kernel/entry_64.o arch/powerpc/kernel/fpu.o init/built-in.o --start-group usr/built-in.o arch/powerpc/kernel/built-in.o arch/powerpc/mm/built-in.o arch/powerpc/lib/built-in.o arch/powerpc/sysdev/built-in.o arch/powerpc/platforms/built-in.o arch/powerpc/math-emu/built-in.o arch/powerpc/crypto/built-in.o arch/powerpc/net/built-in.o kernel/built-in.o certs/built-in.o mm/built-in.o fs/built-in.o ipc/built-in.o security/built-in.o crypto/built-in.o block/built-in.o lib/lib.a lib/built-in.o drivers/built-in.o sound/built-in.o firmware/built-in.o net/built-in.o virt/built-in.o --end-group Gives this internal error ld-new: internal error in set_info_section, at output.h:3386 Tested with binutils 980aa3e6dfeb0f018915f65be4b2987667f31fe9 -- 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
[Bug ld/20519] "PowerPC64, Don't copy weak symbol dyn_relocs to weakdef." causes abort at elf64-ppc.c:14898
https://sourceware.org/bugzilla/show_bug.cgi?id=20519 --- Comment #2 from npiggin at gmail dot com --- Confirmed this does not require any kernel modifications, a large kernel, or --gc-sections or --emit-relocs etc. Standard upstream Linux kernel with minimal config reproduces the error. -- 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
[Bug ld/20519] "PowerPC64, Don't copy weak symbol dyn_relocs to weakdef." causes abort at elf64-ppc.c:14898
https://sourceware.org/bugzilla/show_bug.cgi?id=20519 --- Comment #1 from npiggin at gmail dot com --- Confirmed to fail with head of tree as of Aug 26, commit 980aa3e6dfeb0f018915f65be4b2987667f31fe9 -- 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
[Bug ld/20519] New: "PowerPC64, Don't copy weak symbol dyn_relocs to weakdef." causes abort at elf64-ppc.c:14898
https://sourceware.org/bugzilla/show_bug.cgi?id=20519 Bug ID: 20519 Summary: "PowerPC64, Don't copy weak symbol dyn_relocs to weakdef." causes abort at elf64-ppc.c:14898 Product: binutils Version: 2.28 (HEAD) Status: UNCONFIRMED Severity: normal Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: npiggin at gmail dot com CC: amodra at gmail dot com Target Milestone: --- Host: powerpc64le-unknown-linux-gnu Target: powerpc64le-unknown-linux-gnu With a powerpc64le allyesconfig build of the Linux kernel, using thin archives and --gc-sections, I see ld failing: npiggin@p84-npiggin:~/src/linux$ time ../binutils/binutils-gdb/ld/ld-new -EL -m elf64lppc -pie --emit-relocs --build-id --gc-sections -X -o vmlinux -T ./arch/powerpc/kernel/vmlinux.lds --whole-archive built-in.o .tmp_kallsyms3.o ../binutils/binutils-gdb/ld/ld-new: BFD (GNU Binutils) 2.27.51.20160819 internal error, aborting at elf64-ppc.c:14898 in ppc64_elf_relocate_section Bisected to d311bc8bf85f8358df21301fe8a357aa1212f80c This build requires some out of tree patches to the kernel, so I can test patches and report back, or for IBMers I can give a login to my VM if that would help. -- 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
[Bug ld/20428] ld powerpc64le NULL deref in ppc_get_stub_entry when linking code in not-executable sections
https://sourceware.org/bugzilla/show_bug.cgi?id=20428 --- Comment #1 from npiggin at gmail dot com --- For better or worse, Linux kernel wants to do this in order to run a test case for non-executable mapping of data. Other architectures seem to work, and gold with powerpc64le works with my simple test case. -- 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
[Bug ld/20428] ld powerpc64le NULL deref in ppc_get_stub_entry when linking code in not-executable sections
https://sourceware.org/bugzilla/show_bug.cgi?id=20428 npiggin at gmail dot com changed: What|Removed |Added CC||amodra at gmail dot com -- 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
[Bug ld/20428] ld powerpc64le NULL deref in ppc_get_stub_entry when linking code in not-executable sections
https://sourceware.org/bugzilla/show_bug.cgi?id=20428 npiggin at gmail dot com changed: What|Removed |Added Target||powerpc64le-unknown-linux-g ||nu Host||powerpc64le-unknown-linux-g ||nu -- 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
[Bug ld/20428] New: ld powerpc64le NULL deref in ppc_get_stub_entry when linking code in not-executable sections
https://sourceware.org/bugzilla/show_bug.cgi?id=20428 Bug ID: 20428 Summary: ld powerpc64le NULL deref in ppc_get_stub_entry when linking code in not-executable sections Product: binutils Version: 2.28 (HEAD) Status: UNCONFIRMED Severity: normal Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: npiggin at gmail dot com Target Milestone: --- This bug happens with git master commit 80b476c2bf85be6676cc6b55dab232730e124147, also with the 2.26.51 build. Host and target are powerpc64le If we have foo.S: .section ".rodata","a" .global foo foo: bne main And link it with main function in another section, then the linker crashes. gdb (from the same source build) reports: Starting program: /home/npiggin/src/binutils/binutils-gdb/ld/ld-new -o test main.o test.o /home/npiggin/src/binutils/binutils-gdb/ld/ld-new: warning: cannot find entry symbol _start; defaulting to 10b0 Program received signal SIGSEGV, Segmentation fault. 0x100822a8 in ppc_get_stub_entry (input_section=0x102734c0, htab=0x10249c30, rel=0x3fffe9a0, h=0x1024a658, sym_sec=0x10273390) at elf64-ppc.c:4510 4510 && h->u.stub_cache->h == h (gdb) list 4505 more than one stub used to reach say, printf, and we need to 4506 distinguish between them. */ 4507 group = htab->sec_info[input_section->id].u.group; 4508 4509 if (h != NULL && h->u.stub_cache != NULL 4510 && h->u.stub_cache->h == h 4511 && h->u.stub_cache->group == group) 4512{ 4513 stub_entry = h->u.stub_cache; 4514} (gdb) bt #0 0x100822a8 in ppc_get_stub_entry (input_section=0x102734c0, htab=0x10249c30, rel=0x3fffe9a0, h=0x1024a658, sym_sec=0x10273390) at elf64-ppc.c:4510 #1 ppc64_elf_relocate_section (output_bfd=0x102478a0, info=0x1022a150 , input_bfd=0x10271e60, input_section=0x102734c0, contents=0x102751f0 "", relocs=0x10275cd0, local_syms=0x1028d0a0, local_sections=0x1028d3e0) at elf64-ppc.c:14013 #2 0x100b8d3c in elf_link_input_bfd (flinfo=0x3fffed68, input_bfd=0x10271e60) at elflink.c:10367 #3 0x100ba8fc in bfd_elf_final_link (abfd=0x102478a0, info=0x1022a150 ) at elflink.c:11677 #4 0x10022d40 in ldwrite () at ldwrite.c:577 #5 0x10004490 in main (argc=5, argv=0x3518) at ./ldmain.c:431 However looking at the disassembly, gdb seems to be getting this wrong. h->u.stub_cache is NULL, but we seem to actually be crashing on line 4519 because group is also NULL. If branches remain within local section, the result links okay, so it's crashing trying to generate linker stub in non-executable section. The stub turns out to be unneeded after linking is complete, so it would be nice if we could allow this case. -- 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