Bug 21224 - internal error, aborting at ../../bfd/elf64-ppc.c:14952 in ppc64_elf_relocate_section
Summary: internal error, aborting at ../../bfd/elf64-ppc.c:14952 in ppc64_elf_relocate...
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.28
: P2 normal
Target Milestone: ---
Assignee: Alan Modra
URL: https://bugs.debian.org/cgi-bin/bugre...
Keywords:
Depends on:
Blocks:
 
Reported: 2017-03-06 19:46 UTC by John Paul Adrian Glaubitz
Modified: 2017-03-07 04:40 UTC (History)
5 users (show)

See Also:
Host: powerpc64le-*-*
Target:
Build:
Last reconfirmed: 2017-03-06 00:00:00


Attachments
Offending object code and sources for binutils 2.28 crash (ppc64el) (27.54 KB, application/x-compressed-tar)
2017-03-06 19:46 UTC, John Paul Adrian Glaubitz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description John Paul Adrian Glaubitz 2017-03-06 19:46:29 UTC
Created attachment 9874 [details]
Offending object code and sources for binutils 2.28 crash (ppc64el)

Trying to build modem-manager-gui in Debian unstable on ppc64el with binutils 2.28 fails with:

make[2]: Entering directory '/home/glaubitz/modem-manager-gui-0.0.18/src/plugins'
gcc -fPIC `pkg-config --cflags glib-2.0 ofono` -c -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -fdebug-prefix-map=/home/glaubitz/modem-manager-gui-0.0.18=. -specs=/usr/share/dpkg/no-pie-compile.specs -fstack-protector-strong -Wformat -Werror=format-security ofonohistory.c -o ofonohistory.o
gcc -shared `pkg-config --cflags glib-2.0 ofono` -specs=/usr/share/dpkg/no-pie-link.specs -Wl,-z,relro -Wl,-z,now -Wl,--as-needed ofonohistory.o `pkg-config --libs glib-2.0` -lgdbm -lrt -o mmgui-ofono-history.so
/usr/bin/ld: BFD (GNU Binutils for Debian) 2.28 internal error, aborting at ../../bfd/elf64-ppc.c:14952 in ppc64_elf_relocate_section

/usr/bin/ld: Please report this bug.

collect2: error: ld returned 1 exit status
Makefile:15: recipe for target 'ofonohistory' failed
make[2]: *** [ofonohistory] Error 1
make[2]: Leaving directory '/home/glaubitz/modem-manager-gui-0.0.18/src/plugins'
Makefile:8: recipe for target 'modem-manager-gui' failed
make[1]: *** [modem-manager-gui] Error 2
make[1]: Leaving directory '/home/glaubitz/modem-manager-gui-0.0.18'

The offending invocation is:

(sid_ppc64el-dchroot)glaubitz@plummer:~/modem-manager-gui-0.0.18/src/plugins$ gcc -shared `pkg-config --cflags glib-2.0 ofono`  ofonohistory.o `pkg-config --libs glib-2.0` -lgdbm -lrt -o mmgui-ofono-history.so
/usr/bin/ld: BFD (GNU Binutils for Debian) 2.28 internal error, aborting at ../../bfd/elf64-ppc.c:14952 in ppc64_elf_relocate_section

/usr/bin/ld: Please report this bug.

collect2: error: ld returned 1 exit status
(sid_ppc64el-dchroot)glaubitz@plummer:~/modem-manager-gui-0.0.18/src/plugins$

Attaching an archive with the offending object files and sources. Please let me know if you need anything else.
Comment 1 cvs-commit@gcc.gnu.org 2017-03-07 02:28:41 UTC
The master branch has been updated by Alan Modra <amodra@sourceware.org>:

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

commit b1b07054c08eea65ba8d1a9f771796d686f337e5
Author: Alan Modra <amodra@gmail.com>
Date:   Tue Mar 7 11:04:19 2017 +1030

    PowerPC64 abort due to dynamic relocs on hidden undefweak
    
    ppc64_elf_relocate_section lacked a check which meant that it emitted
    dynamic relocs against a hidden undefweak symbol for which no dynamic
    relocs had been allocated.
    
    	PR 21224
    	PR 20519
    	* elf64-ppc.c (ppc64_elf_relocate_section): Add missing
    	dyn_relocs check.
Comment 2 cvs-commit@gcc.gnu.org 2017-03-07 04:33:55 UTC
The binutils-2_28-branch branch has been updated by Alan Modra <amodra@sourceware.org>:

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

commit 0d69827324f704b75ac7e5c2b39219cdd15e790b
Author: Alan Modra <amodra@gmail.com>
Date:   Tue Mar 7 11:04:19 2017 +1030

    PowerPC64 abort due to dynamic relocs on hidden undefweak
    
    ppc64_elf_relocate_section lacked a check which meant that it emitted
    dynamic relocs against a hidden undefweak symbol for which no dynamic
    relocs had been allocated.
    
    	PR 21224
    	PR 20519
    	* elf64-ppc.c (ppc64_elf_relocate_section): Add missing
    	dyn_relocs check.
Comment 3 Alan Modra 2017-03-07 04:40:02 UTC
Fixed, patch pushed to branch too.