Bug 20472 - [2.27 Regression] glibc-2.24 fails to build with the 2.7 branch on powerpc64-linux-gnu
Summary: [2.27 Regression] glibc-2.24 fails to build with the 2.7 branch on powerpc64-...
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: ld (show other bugs)
Version: 2.27
: P2 normal
Target Milestone: ---
Assignee: Alan Modra
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-15 20:52 UTC by Matthias Klose
Modified: 2016-08-19 06:10 UTC (History)
1 user (show)

See Also:
Host:
Target: powerpc64-linux-gnu
Build:
Last reconfirmed:


Attachments
test case (1.72 KB, application/gzip)
2016-08-15 21:00 UTC, Matthias Klose
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Klose 2016-08-15 20:52:49 UTC
with today's 2.27 branch, glibc-2.24 fails to build on powerpc-linux-gnu, worked with the 2.27 release. The only powerpc related change is:

2016-08-11  Alan Modra  <amodra@gmail.com>

       * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Don't exit with
       non_got_ref true in any case where we could have generated dynbss
       copies but decide not to do so.

The failure is

BFD (GNU Binutils for Debian) 2.27 internal error, aborting at ../../bfd/elf64-ppc.c:14834 in ppc64_elf_relocate_section
/usr/bin/ld: Please report this bug.
collect2: error: ld returned 1 exit status

I don't have more information yet.
Comment 1 Matthias Klose 2016-08-15 21:00:21 UTC
Created attachment 9436 [details]
test case

test case, taken from https://bugs.debian.org/834445
Comment 2 Alan Modra 2016-08-16 00:10:27 UTC
Confirmed.  I was concerned enough about this change to build both gcc and glibc on powerpc64 and powerpc64le, as I've been bitten with this sort of change before.  However the machine I used to build the powerpc64 glibc was running an old kernel, so the testsuite gave lots of "FATAL: kernel too old" messages and I obviously didn't check the testsuite output carefully enough.  My glibc build had the same failure..
Comment 3 cvs-commit@gcc.gnu.org 2016-08-19 01:47:12 UTC
The master branch has been updated by Alan Modra <amodra@sourceware.org>:

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

commit 8a2058b5e3318a337a6fecd61b91349d1131758e
Author: Alan Modra <amodra@gmail.com>
Date:   Fri Aug 19 11:06:41 2016 +0930

    PR 20472, PowerPC64 ifunc confusion
    
    This patch fixes quite a lot of confusion in allocate_dynrelocs over
    ifuncs.  Function descriptors make ELFv1 quite different to ELFv2.
    
    	PR 20472
    	* elf64-ppc.c (ppc64_elf_before_check_relocs): Tweak abiversion test.
    	(readonly_dynrelocs): Comment fix.
    	(global_entry_stub): New function.
    	(ppc64_elf_adjust_dynamic_symbol): Tweak abiversion test.  Match
    	ELFv2 code deciding on dynamic relocs vs. global entry stubs to
    	that in size_global_entry_stubs, handling ifunc too.  Delete dead
    	weak sym code.
    	(allocate_dynrelocs): Ensure dyn_relocs field is cleared when no
    	dyn_relocs are needed.  Correct handling of ifunc dyn_relocs.
    	Tidy ELIMINATE_COPY_RELOCS code, only setting dynindx for
    	undefweak syms.  Expand and correct comments.
    	(size_global_entry_stubs): Ensure symbol is defined.
    	(ppc64_elf_relocate_section): Match condition under which
    	dyn_relocs are emitted to that in allocate_dynrelocs.
Comment 4 cvs-commit@gcc.gnu.org 2016-08-19 03:25:14 UTC
The binutils-2_27-branch branch has been updated by Alan Modra <amodra@sourceware.org>:

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

commit 7f27ccfcd5b86a6517a5c01d1cc29e87ac39c13c
Author: Alan Modra <amodra@gmail.com>
Date:   Fri Aug 19 11:06:41 2016 +0930

    PR 20472, PowerPC64 ifunc confusion
    
    This patch fixes quite a lot of confusion in allocate_dynrelocs over
    ifuncs.  Function descriptors make ELFv1 quite different to ELFv2.
    
    	PR 20472
    	* elf64-ppc.c (ppc64_elf_before_check_relocs): Tweak abiversion test.
    	(readonly_dynrelocs): Comment fix.
    	(global_entry_stub): New function.
    	(ppc64_elf_adjust_dynamic_symbol): Tweak abiversion test.  Match
    	ELFv2 code deciding on dynamic relocs vs. global entry stubs to
    	that in size_global_entry_stubs, handling ifunc too.  Delete dead
    	weak sym code.
    	(allocate_dynrelocs): Ensure dyn_relocs field is cleared when no
    	dyn_relocs are needed.  Correct handling of ifunc dyn_relocs.
    	Tidy ELIMINATE_COPY_RELOCS code, only setting dynindx for
    	undefweak syms.  Expand and correct comments.
    	(size_global_entry_stubs): Ensure symbol is defined.
    	(ppc64_elf_relocate_section): Match condition under which
    	dyn_relocs are emitted to that in allocate_dynrelocs.
Comment 5 Alan Modra 2016-08-19 06:10:02 UTC
Fixed