This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: binutils is broken on Linux/alpha.
On Sat, Sep 29, 2001 at 11:34:38AM -0700, H . J . Lu wrote:
> On Sat, Sep 29, 2001 at 10:35:15AM -0700, H . J . Lu wrote:
>
> Hi Alan,
>
> I have verified that your patch
>
> http://sources.redhat.com/ml/binutils/2001-09/msg00487.html
>
> causes the Linux/alpha failures. There may be more broken ELF targets
> because of your change.
>
>
Alan,
This change is wrong or incomplete. You cannot do
- if (dir->got.offset == (bfd_vma) -1)
+ if (dir->got.refcount <= 0)
nor
- dir->plt.offset = ind->plt.offset;
- ind->plt.offset = (bfd_vma) -1;
+ dir->plt.refcount = ind->plt.refcount;
+ ind->plt.refcount = 0;
H.J.
-----
Index: elf.c
===================================================================
RCS file: /cvs/src/src/bfd/elf.c,v
retrieving revision 1.94
retrieving revision 1.95
diff -u -p -r1.94 -r1.95
--- elf.c 2001/09/24 01:38:31 1.94
+++ elf.c 2001/09/29 06:21:58 1.95
@@ -1002,21 +1002,21 @@ _bfd_elf_link_hash_copy_indirect (dir, i
| ELF_LINK_HASH_REF_REGULAR_NONWEAK
| ELF_LINK_NON_GOT_REF));
- /* Copy over the global and procedure linkage table offset entries.
+ /* Copy over the global and procedure linkage table refcount entries.
These may have been already set up by a check_relocs routine. */
- if (dir->got.offset == (bfd_vma) -1)
+ if (dir->got.refcount <= 0)
{
- dir->got.offset = ind->got.offset;
- ind->got.offset = (bfd_vma) -1;
+ dir->got.refcount = ind->got.refcount;
+ ind->got.refcount = 0;
}
- BFD_ASSERT (ind->got.offset == (bfd_vma) -1);
+ BFD_ASSERT (ind->got.refcount <= 0);
- if (dir->plt.offset == (bfd_vma) -1)
+ if (dir->plt.refcount <= 0)
{
- dir->plt.offset = ind->plt.offset;
- ind->plt.offset = (bfd_vma) -1;
+ dir->plt.refcount = ind->plt.refcount;
+ ind->plt.refcount = 0;
}
- BFD_ASSERT (ind->plt.offset == (bfd_vma) -1);
+ BFD_ASSERT (ind->plt.refcount <= 0);
if (dir->dynindx == -1)
{