Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be unavailable on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 728201 - stubs don't match calculated size, /usr/bin/ld: can not build stubs: Invalid operation
Summary: stubs don't match calculated size, /usr/bin/ld: can not build stubs: Invalid ...
Alias: None
Product: Fedora
Classification: Fedora
Component: binutils
Version: 16
Hardware: powerpc
OS: Unspecified
Target Milestone: ---
Assignee: Nick Clifton
QA Contact: Fedora Extras Quality Assurance
Depends On:
TreeView+ depends on / blocked
Reported: 2011-08-04 11:18 UTC by Karsten Hopp
Modified: 2011-12-21 17:01 UTC (History)
4 users (show)

Fixed In Version: binutils-
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2011-12-21 17:01:00 UTC
Type: ---

Attachments (Terms of Use)

Description Karsten Hopp 2011-08-04 11:18:42 UTC
Description of problem:
several packages fail to build on ppc with this error:
stubs don't match calculated size
/usr/bin/ld: can not build stubs: Invalid operation
collect2: ld returned 1 exit status


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

How reproducible:

Steps to Reproduce:
1. ppc-koji build --scratch f16 llvm-2.9-2.fc16.src.rpm

This is blocking builds of many other packages ;-(

Comment 1 Jakub Jelinek 2011-08-04 16:56:06 UTC
Perhaps http://sources.redhat.com/ml/binutils/2011-08/msg00011.html ? 
And/or it might be related to the local ppc64 change in our gcc (for many years now):
+/* If the linker supports overlapping .opd entries and we know this function
+   doesn't ever use r11 passed to it, we can overlap the fd_aux function
+   descriptor field with next function descriptor's fd_func field.  */
+# define OVERLAPPING_OPD (cfun->static_chain_decl == NULL)
@@ -25938,7 +25925,8 @@ rs6000_elf_declare_function_name (FILE *
       ASM_OUTPUT_LABEL (file, name);
       fputs (DOUBLE_INT_ASM_OP, file);
       rs6000_output_function_entry (file, name);
-      fputs (",.TOC.@tocbase,0\n\t.previous\n", file);
+      fprintf (file, ",.TOC.@tocbase%s\n\t.previous\n",
+              OVERLAPPING_OPD ? "" : ",0");
       if (DOT_SYMBOLS)
          fputs ("\t.size\t", file);
where we emit just 16 byte .opd entries instead of 24 bytes if we can ignore the r11 value in the function.

Comment 2 Peter Bergner 2011-08-05 15:18:34 UTC
Alan, do you have any ideas what might be wrong here?

Comment 3 Alan Modra 2011-08-05 16:44:03 UTC
Peter, Jakub quizzed me earlier today on this bug.  I replied that the opd squashing won't affect stub sizing as far as I can see.  I'm guessing that binutils- has my 2011-07-14 change included, which had a bug in stub sizing, fixed here:

2011-08-02  Alan Modra  <amodra@gmail.com>

	* elf64-ppc.c (build_plt_stub): Correct emitted relocs when no
	(ppc_build_one_stub): Adjust get_relocs call to suit..
	(ppc_size_one_stub): ..and reloc sizing.  Correct plt size corner case.

Comment 4 Peter Bergner 2011-08-05 17:15:37 UTC
Ah, I guess I misunderstood what Jakub was saying.  I thought Jakub was pointing at your patch as the culprit and not as a potential fix.  Ok, so it seems fedora just needs to grab your latest fix and we should be good.  Thanks.

Comment 5 Fedora Update System 2011-12-14 12:09:11 UTC
binutils- has been submitted as an update for Fedora 16.

Comment 6 Fedora Update System 2011-12-14 23:33:26 UTC
Package binutils-
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing binutils-'
as soon as you are able to.
Please go to the following url:
then log in and leave karma (feedback).

Comment 7 Fedora Update System 2011-12-21 17:01:00 UTC
binutils- has been pushed to the Fedora 16 stable repository.  If problems still persist, please make note of it in this bug report.

Note You need to log in before you can comment on or make changes to this bug.