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."
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: sources. redhat. com/cgi- bin/cvsweb. cgi/src/ bfd/elf32- m68k.c. diff?= 3Dsrc&r1= 3D1.70& r2=3D1. 71
>> 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://
cvsroot=
>
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 src/bfd/ elf32-m68k. c,v adjust_ dynamic_ symbol (info, h) link_hash_ flags & ELF_LINK_ HASH_NEEDS_ PLT) !=3D 0) link_hash_ flags & ELF_LINK_ HASH_DEF_ DYNAMIC) =3D=3D 0 link_hash_ flags & ELF_LINK_ HASH_REF_ DYNAMIC) =3D=3D 0 hash_undefweak) ) adjust_ dynamic_ symbol (info, h) link_hash_ flags & ELF_LINK_ HASH_NEEDS_ PLT) !=3D 0= elf_link_ hash_flags &=3D ~ELF_LINK_ HASH_NEEDS_ PLT;
=3D=3D=
=3D=3D=
=3D=3D=
RCS file: /cvs/src/
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_
if (h->type =3D=3D STT_FUNC
|| (h->elf_
{
- if (! info->shared
- && (h->elf_
- && (h->elf_
+ 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_
/* 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_
{
/* 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_
);
+ 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->
- 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."