PowerPC64 dynreloc miscount failure
Nick Clifton
nickc@redhat.com
Thu Jan 31 15:48:00 GMT 2013
Hi Alan, Hi Geoff,
A Fedora user has reported a bug against the PowerPC64 linker where it
issues a bogus error message about a dynamic reloc miscount failure:
https://bugzilla.redhat.com/show_bug.cgi?id=906273
I believe that the problem occurs because dec_dynrel_count() is not
allowing for global symbols that are defined in garbage collected
sections. Hence a patch like this:
Index: bfd/elf64-ppc.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-ppc.c,v
retrieving revision 1.402
diff -u -3 -p -r1.402 elf64-ppc.c
--- bfd/elf64-ppc.c 31 Jan 2013 06:28:46 -0000 1.402
+++ bfd/elf64-ppc.c 31 Jan 2013 15:44:25 -0000
@@ -7078,6 +7078,13 @@ dec_dynrel_count (bfd_vma r_info,
pp = &p->next;
}
+ /* If the output section has been garbage
+ collected then do not report a miscount. */
+ if (h->root.u.def.section != NULL
+ && h->root.u.def.section->output_section != NULL
+ && h->root.u.def.section->output_section->gc_mark)
+ return TRUE;
+
info->callbacks->einfo (_("%P: dynreloc miscount for %B, section %A\n"),
sec->owner, sec);
bfd_set_error (bfd_error_bad_value);
Solves the problem. At least for the test case provided. I suspect
however that you would prefer a slightly more elegant solution than
this, but please let me know if you think that the patch is OK.
Cheers
Nick
More information about the Binutils
mailing list