Bug 906273

Summary: ld fails with "dynreloc miscount" and "can not edit opd: Bad value" errors
Product: [Fedora] Fedora Reporter: Jonas Maebe <jonas.maebe>
Component: binutilsAssignee: Nick Clifton <nickc>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: 18CC: amodra, jakub, nickc
Target Milestone: ---   
Target Release: ---   
Hardware: ppc64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-04 10:45:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Archive containing files to reproduce the problem none

Description Jonas Maebe 2013-01-31 10:44:05 UTC
Created attachment 690842 [details]
Archive containing files to reproduce the problem

Description of problem:

When compiling any program using the the Free Pascal Compiler svn trunk version, the resulting program fails to link with the following errors from ld:

/usr/bin/ld: dynreloc miscount for system.o, section .opd
/usr/bin/ld: can not edit opd: Bad value


Version-Release number of selected component (if applicable):

GNU ld version 2.23.51.0.1-3.fc18 20120806


How reproducible:

Always


Steps to Reproduce:
1. Unpack the provided archive and change into the dynrelocmiscount directory
2. Execute ./ppas.sh

  
Actual results:

Linking tt
/usr/bin/ld: dynreloc miscount for system.o, section .opd
/usr/bin/ld: can not edit opd: Bad value
An error occurred while linking tt


Expected results:

ld links the program successfully. The resulting program won't print anything when executed, it's a dummy.


Additional info:

The test was executed on gcc110.fsffrance.org. Everything worked fine before that machine was upgraded from FC16 to FC18.

Comment 1 Jonas Maebe 2013-01-31 10:46:08 UTC
I forgot to mention that everything still work fine when the code is compiled with FPC 2.6.0. The main difference between the two compiler versions is that FPC svn trunk generates code that is similar to what gcc does when -ffunction-sections -fdata-sections are specified, while 2.6.0 puts everything in a single text/data section.

Comment 2 Nick Clifton 2013-01-31 15:52:02 UTC
Hi Jonas,

  As a workaround you can just link without --gc-sections specified on the linker command line.

  I have produced a possible patch to fix this problem, but not being a PowerPC64 expert I have forwarded it to the ppc maintainers for review and possible alteration:

http://sourceware.org/ml/binutils/2013-01/msg00486.html

  I will update the Fedora linker once I have received feedback from them.

Cheers
  Nick

Comment 3 Jonas Maebe 2013-01-31 16:57:29 UTC
Thanks a lot for the quick feedback, workaround and proposed patch! Since there's a workaround, please feel free to reduce the priority to "medium" (it seems I can't do that).

Comment 5 Jonas Maebe 2013-02-02 10:11:30 UTC
Thanks!

Comment 6 Nick Clifton 2013-02-04 10:45:23 UTC
I have checked in a patch and created binutils-2.23.51.0.1-7.fc18.  I will not bother updating rawhide because the same patch is in the FSF sources which will be imported into rawhide in a couple of weeks.

Cheers
  Nick

Comment 7 Jonas Maebe 2013-02-04 10:54:00 UTC
Awesome!