Comment 18 for bug 9465

Revision history for this message
Debian Bug Importer (debzilla) wrote :

Message-ID: <email address hidden>
Date: Thu, 25 Nov 2004 01:20:13 +0100
From: Andreas Schwab <email address hidden>
To: Matthias Klose <email address hidden>
Cc: <email address hidden>
Subject: Re: Bug#278388: [PR 18189] [3.3 regression] __fixunsdfdi problem on
 m68k

Matthias Klose <email address hidden> writes:

> Andreas Schwab writes:
>> This is a bug in binutils 2.15 that's already fixed in CVS HEAD.
>
> Andreas, please could you confirm this patch from upstream:
>
> http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/bfd/elf32-m68k.c.diff?=
cvsroot=3Dsrc&r1=3D1.70&r2=3D1.71
>

This works for me:

Index: elf32-m68k.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/src/src/bfd/elf32-m68k.c,v
retrieving revision 1.61.6.1
diff -u -a -p -a -u -p -r1.61.6.1 elf32-m68k.c
--- elf32-m68k.c 8 Apr 2004 12:41:42 -0000 1.61.6.1
+++ elf32-m68k.c 25 Nov 2004 00:15:53 -0000
@@ -940,9 +940,10 @@ elf_m68k_adjust_dynamic_symbol (info, h)
   if (h->type =3D=3D STT_FUNC
       || (h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) !=3D 0)
     {
- if (! info->shared
- && (h->elf_link_hash_flags & ELF_LINK_HASH_DEF_DYNAMIC) =3D=3D 0
- && (h->elf_link_hash_flags & ELF_LINK_HASH_REF_DYNAMIC) =3D=3D 0
+ if ((h->plt.refcount <=3D 0
+ || SYMBOL_CALLS_LOCAL (info, h)
+ || (ELF_ST_VISIBILITY (h->other) !=3D STV_DEFAULT
+ && h->root.type =3D=3D bfd_link_hash_undefweak))
    /* We must always create the plt entry if it was referenced
       by a PLTxxO relocation. In this case we already recorded
       it as a dynamic symbol. */
@@ -950,19 +951,11 @@ elf_m68k_adjust_dynamic_symbol (info, h)
  {
    /* This case can occur if we saw a PLTxx reloc in an input
       file, but the symbol was never referred to by a dynamic
- object. In such a case, we don't actually need to build
- a procedure linkage table, and we can just do a PCxx
- reloc instead. */
- BFD_ASSERT ((h->elf_link_hash_flags & ELF_LINK_HASH_NEEDS_PLT) !=3D 0=
);
+ object, or if all references were garbage collected. In
+ such a case, we don't actually need to build a procedure
+ linkage table, and we can just do a PCxx reloc instead. */
    h->plt.offset =3D (bfd_vma) -1;
- return TRUE;
- }
-
- /* GC may have rendered this entry unused. */
- if (h->plt.refcount <=3D 0)
- {
    h->elf_link_hash_flags &=3D ~ELF_LINK_HASH_NEEDS_PLT;
- h->plt.offset =3D (bfd_vma) -1;
    return TRUE;
  }
=20

Andreas.

--=20
Andreas Schwab, SuSE Labs, <email address hidden>
SuSE Linux Products GmbH, Maxfeldstra=DFe 5, 90409 N=FCrnberg, Germany
Key fingerprint =3D 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."