Bug 15355

Summary: ppc64 linker script failure
Product: binutils Reporter: Anton Blanchard <anton>
Component: goldAssignee: Alan Modra <amodra>
Status: RESOLVED FIXED    
Severity: normal CC: alex_y_xu, amodra, ccoutant
Priority: P2    
Version: 2.24   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:
Attachments: ppc64 kernel linker script
Trivial source code to link

Description Anton Blanchard 2013-04-10 07:55:46 UTC
Created attachment 6973 [details]
ppc64 kernel linker script

I see the following failure when building a ppc64 Linux kernel with gold:

# gcc -c foo.c
# ld -m elf64ppc -Bstatic -T vmlinux.lds foo.o

ld: internal error in segment_precedes, at layout.cc:3183
Comment 1 Anton Blanchard 2013-04-10 07:56:18 UTC
Created attachment 6974 [details]
Trivial source code to link
Comment 2 Alan Modra 2013-04-11 01:45:31 UTC
This is due to the linker script specifying two PT_NOTE segments, something that gold seems to think should not be allowed.
Comment 3 Sourceware Commits 2013-04-21 23:21:58 UTC
CVSROOT:	/cvs/src
Module name:	src
Changes by:	amodra@sourceware.org	2013-04-21 23:21:56

Modified files:
	gold           : ChangeLog layout.cc 

Log message:
	PR gold/15355
	* layout.cc (Layout::segment_precedes): Allow more than one
	segment with the same type and flags.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/ChangeLog.diff?cvsroot=src&r1=1.1068&r2=1.1069
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gold/layout.cc.diff?cvsroot=src&r1=1.249&r2=1.250
Comment 4 Alan Modra 2013-04-22 03:26:21 UTC
Fixed
Comment 5 Cary Coutant 2014-03-28 19:03:44 UTC
*** Bug 16389 has been marked as a duplicate of this bug. ***