Blame SOURCES/binutils-2.23.52.0.1-check-regular-ifunc-refs.patch

f55871
*** ../binutils-2.23.52.0.1.orig/bfd/elf-ifunc.c	2013-04-17 15:53:49.662586029 +0100
f55871
--- bfd/elf-ifunc.c	2013-04-17 15:55:55.269589511 +0100
f55871
*************** _bfd_elf_allocate_ifunc_dyn_relocs (stru
f55871
*** 187,209 ****
f55871
  
f55871
    htab = elf_hash_table (info);
f55871
  
f55871
    /* Support garbage collection against STT_GNU_IFUNC symbols.  */
f55871
    if (h->plt.refcount <= 0 && h->got.refcount <= 0)
f55871
      {
f55871
-       /* When building shared library, we need to handle the case
f55871
-          where it is marked with regular reference, but not non-GOT
f55871
- 	 reference.  It may happen if we didn't see STT_GNU_IFUNC
f55871
- 	 symbol at the time when checking relocations.  */
f55871
-       if (info->shared
f55871
- 	  && !h->non_got_ref
f55871
- 	  && h->ref_regular)
f55871
- 	for (p = *head; p != NULL; p = p->next)
f55871
- 	  if (p->count)
f55871
- 	    {
f55871
- 	      h->non_got_ref = 1;
f55871
- 	      goto keep;
f55871
- 	    }
f55871
- 
f55871
        h->got = htab->init_got_offset;
f55871
        h->plt = htab->init_plt_offset;
f55871
        *head = NULL;
f55871
--- 187,206 ----
f55871
  
f55871
    htab = elf_hash_table (info);
f55871
  
f55871
+   /* When building a shared library, we need to handle the case where it is
f55871
+      marked with a regular reference, but not a non-GOT reference since the
f55871
+      non-GOT reference bit may not be set here.  */
f55871
+   if (info->shared && !h->non_got_ref && h->ref_regular)
f55871
+     for (p = *head; p != NULL; p = p->next)
f55871
+       if (p->count)
f55871
+ 	{
f55871
+ 	  h->non_got_ref = 1;
f55871
+ 	  goto keep;
f55871
+ 	}
f55871
+ 
f55871
    /* Support garbage collection against STT_GNU_IFUNC symbols.  */
f55871
    if (h->plt.refcount <= 0 && h->got.refcount <= 0)
f55871
      {
f55871
        h->got = htab->init_got_offset;
f55871
        h->plt = htab->init_plt_offset;
f55871
        *head = NULL;