skiboot ftbfs in eoan

Bug #1833237 reported by Matthias Klose
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
binutils
Fix Released
Medium
binutils (Ubuntu)
Fix Released
High
Unassigned
Eoan
Fix Released
High
Unassigned
skiboot (Ubuntu)
Invalid
High
Unassigned
Eoan
Invalid
High
Unassigned

Bug Description

skiboot ftbfs in eoan

https://launchpad.net/ubuntu/+archive/test-rebuild-20190614/+build/17038512/+files/buildlog_ubuntu-eoan-amd64.skiboot_6.2-1_BUILDING.txt.gz

powerpc64-linux-gnu-gcc -I/<<PKGBUILDDIR>>/include -Iinclude -MMD -include /<<PKGBUILDDIR>>/include/config.h -I/<<PKGBUILDDIR>>/libfdt -I/<<PKGBUILDDIR>>/libflash -I/<<PKGBUILDDIR>>/libxz -I/<<PKGBUILDDIR>>/libc/include -I/<<PKGBUILDDIR>> -I/<<PKGBUILDDIR>>/libpore -D__SKIBOOT__ -nostdinc -isystem /usr/lib/gcc-cross/powerpc64-linux-gnu/8/include -DBITS_PER_LONG=64 -DHAVE_BIG_ENDIAN -ffreestanding -DHAS_STACK_PROT -D__ASSEMBLY__ -mbig-endian -m64 -mabi=elfv1 -c asm/dummy_map.S -o asm/dummy_map.o
powerpc64-linux-gnu-gcc -I/<<PKGBUILDDIR>>/include -Iinclude -MMD -include /<<PKGBUILDDIR>>/include/config.h -I/<<PKGBUILDDIR>>/libfdt -I/<<PKGBUILDDIR>>/libflash -I/<<PKGBUILDDIR>>/libxz -I/<<PKGBUILDDIR>>/libc/include -I/<<PKGBUILDDIR>> -I/<<PKGBUILDDIR>>/libpore -D__SKIBOOT__ -nostdinc -isystem /usr/lib/gcc-cross/powerpc64-linux-gnu/8/include -DBITS_PER_LONG=64 -DHAVE_BIG_ENDIAN -ffreestanding -DHAS_STACK_PROT -P -E skiboot.lds.S -o skiboot.lds
powerpc64-linux-gnu-ld -EB -m elf64ppc --no-multi-toc -N --build-id=none --whole-archive -static -nostdlib -pie -Ttext-segment=0x0 --oformat=elf64-powerpc -o skiboot.tmp.elf -T skiboot.lds skiboot.tmp.a asm/dummy_map.o
powerpc64-linux-gnu-ld: BFD (GNU Binutils for Ubuntu) 2.32.51.20190614 internal error, aborting at ../../bfd/elf64-ppc.c:15381 in ppc64_elf_relocate_section

powerpc64-linux-gnu-ld: Please report this bug.

make[2]: *** [/<<PKGBUILDDIR>>/Makefile.main:262: skiboot.tmp.elf] Error 1
make[2]: Leaving directory '/<<PKGBUILDDIR>>'
make[1]: *** [debian/rules:19: override_dh_auto_build-indep] Error 2

Matthias Klose (doko)
tags: added: ftbfs rls-ee-incoming
Changed in binutils (Ubuntu):
status: New → Confirmed
Changed in skiboot (Ubuntu):
status: New → Confirmed
Changed in binutils (Ubuntu):
importance: Undecided → High
Changed in skiboot (Ubuntu):
importance: Undecided → High
Revision history for this message
In , Matthias Klose (doko) wrote :

This was seen building skiboot 6.2 for powerpc64-linux-gnu using binutils trunk 20190614.

(gdb) run
Starting program: /usr/bin/powerpc64-linux-gnu-ld -EB -m elf64ppc --no-multi-toc -N --build-id=none --whole-archive -static -nostdlib -pie -Ttext-segment=0x0 --oformat=elf64-powerpc -o skiboot.tmp.elf -T skiboot.lds skiboot.tmp.a asm/dummy_map.o

Breakpoint 1, _bfd_error_handler (fmt=0x7ffff7f6b480 "BFD %s internal error, aborting at %s:%d in %s\n")
    at ../../bfd/bfd.c:1174
1174 ../../bfd/bfd.c: No such file or directory.
(gdb) bt
#0 _bfd_error_handler (fmt=0x7ffff7f6b480 "BFD %s internal error, aborting at %s:%d in %s\n")
    at ../../bfd/bfd.c:1174
#1 0x00007ffff7ebc6c4 in _bfd_abort (file=file@entry=0x7ffff7f7e071 "../../bfd/elf64-ppc.c",
    line=line@entry=15381,
    fn=fn@entry=0x7ffff7f81480 <__PRETTY_FUNCTION__.18116> "ppc64_elf_relocate_section")
    at ../../bfd/bfd.c:1440
#2 0x00007ffff7ee1e70 in ppc64_elf_relocate_section (output_bfd=output_bfd@entry=0x55555570b4c0,
    info=<optimized out>, input_bfd=input_bfd@entry=0x555555740d00,
    input_section=input_section@entry=0x555555742270, contents=<optimized out>,
    relocs=relocs@entry=0x555555744ca8, local_syms=<optimized out>, local_sections=<optimized out>)
    at ../../bfd/elf64-ppc.c:15381
#3 0x00007ffff7f133e1 in elf_link_input_bfd (flinfo=flinfo@entry=0x7fffffffe0e0,
    input_bfd=input_bfd@entry=0x555555740d00) at ../../bfd/elflink.c:10887
#4 0x00007ffff7f14eef in bfd_elf_final_link (abfd=<optimized out>, info=<optimized out>)
    at ../../bfd/elflink.c:12215
#5 0x0000555555578e0f in ldwrite () at ../../ld/ldwrite.c:581
#6 0x0000555555561514 in main (argc=<optimized out>, argv=<optimized out>) at ../../ld/ldmain.c:457

Revision history for this message
In , Matthias Klose (doko) wrote :

Created attachment 11848
test case

Changed in binutils:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
In , Alan Modra (amodra-gmail) wrote :

This is due to a horrible linker script breaking a new GOT indirect to GOT relative optimisation (git commit 066f4018ae78).

ld does a preliminary layout to see whether various optimisations can be done. In this case the preliminary layout indicates that code using a GOT indirect address can be replaced with code calculating a GOT relative address (saving a GOT entry and load from memory). The trouble is that skiboot.lds puts a bunch of dynamic sections between .got and the address in question. Those dynamic sections are not filled out for the preliminary layout, nor can they be since one of the aims of the ppc64 linker optimisation is to reduce dynamic relocations. With the dynamic sections adding over 150kb, the optimisation is no longer valid but ld has already removed the GOT entry.

Changed in binutils:
status: Confirmed → In Progress
Steve Langasek (vorlon)
tags: removed: rls-ee-incoming
tags: added: id-5d0ba2fcdd3f47767d5ae86d
Revision history for this message
In , Cvs-commit (cvs-commit) wrote :

The master branch has been updated by Alan Modra <email address hidden>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=bb22a41815facfaa3de621aad5d055eb8e477082

commit bb22a41815facfaa3de621aad5d055eb8e477082
Author: Alan Modra <email address hidden>
Date: Sun Jun 23 12:28:39 2019 +0930

    PR24704, Internal error building skiboot for powerpc64-linux-gnu

    While the skiboot linker script bears some culpability in this PR,
    it's also true that the GOT indirect to GOT relative optimisation for
    16-bit offsets isn't safe. At least, it isn't safe to remove the GOT
    entry based on distance between the GOT pointer and symbol calculated
    from the preliminary layout. So this patch removes that optimisation,
    and reduces the range allowed for 32-bit and 34-bit offsets.

     PR 24704
    bfd/
     * elf64-ppc.c (R_PPC64_GOT16_DS): Don't set has_gotrel.
     (ppc64_elf_edit_toc): Don't remove R_PPC64_GOT16_DS got entries.
     Reduce range of offsets allowed for other GOT relocs.
    ld/
     * testsuite/ld-powerpc/elfv2exe.d: Update.
     * testsuite/ld-powerpc/elfv2so.d: Update.

Revision history for this message
In , Alan Modra (amodra-gmail) wrote :

Fixed.

Changed in binutils:
status: In Progress → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package binutils - 2.32.51.20190702-1ubuntu1

---------------
binutils (2.32.51.20190702-1ubuntu1) eoan; urgency=medium

  * Snapshot, taken from the trunk (20190702).

binutils (2.32.51.20190702-1) experimental; urgency=medium

  * Snapshot, taken from the trunk (20190702).
  * Apply proposed patch for PR ld/24753.

binutils (2.32.51.20190701-1ubuntu1) eoan; urgency=medium

  * Snapshot, taken from the trunk (20190701).

binutils (2.32.51.20190701-1) experimental; urgency=medium

  * Snapshot, taken from the trunk (20190701).

 -- Matthias Klose <email address hidden> Tue, 02 Jul 2019 12:48:46 +0200

Changed in binutils (Ubuntu Eoan):
status: Confirmed → Fix Released
Matthias Klose (doko)
Changed in skiboot (Ubuntu Eoan):
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.