diff options
author | Alan Modra <amodra@gmail.com> | 2001-09-30 03:03:11 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2001-09-30 03:03:11 +0000 |
commit | 3c3e9281c33c80f7d3b03525088350b545b5051a (patch) | |
tree | 2b4afc0bf541d537cfb1db8b87b4d98a62861817 /bfd/elf.c | |
parent | 7efde2a4dd82ebed11602ba6e0441a49841422c0 (diff) | |
download | gdb-3c3e9281c33c80f7d3b03525088350b545b5051a.zip gdb-3c3e9281c33c80f7d3b03525088350b545b5051a.tar.gz gdb-3c3e9281c33c80f7d3b03525088350b545b5051a.tar.bz2 |
* elf.c (_bfd_elf_link_hash_copy_indirect): Set ind refcounts to
the old dir refcount, so we indirectly set them to init_refcount.
Short-circuit asserts when we've just verified they are true.
Diffstat (limited to 'bfd/elf.c')
-rw-r--r-- | bfd/elf.c | 21 |
1 files changed, 14 insertions, 7 deletions
@@ -992,6 +992,8 @@ void _bfd_elf_link_hash_copy_indirect (dir, ind) struct elf_link_hash_entry *dir, *ind; { + bfd_signed_vma tmp; + /* Copy down any references that we may have already seen to the symbol which just became indirect. */ @@ -1004,19 +1006,23 @@ _bfd_elf_link_hash_copy_indirect (dir, ind) /* 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.refcount <= 0) + tmp = dir->got.refcount; + if (tmp <= 0) { dir->got.refcount = ind->got.refcount; - ind->got.refcount = 0; + ind->got.refcount = tmp; } - BFD_ASSERT (ind->got.refcount <= 0); + else + BFD_ASSERT (ind->got.refcount <= 0); - if (dir->plt.refcount <= 0) + tmp = dir->plt.refcount; + if (tmp <= 0) { dir->plt.refcount = ind->plt.refcount; - ind->plt.refcount = 0; + ind->plt.refcount = tmp; } - BFD_ASSERT (ind->plt.refcount <= 0); + else + BFD_ASSERT (ind->plt.refcount <= 0); if (dir->dynindx == -1) { @@ -1025,7 +1031,8 @@ _bfd_elf_link_hash_copy_indirect (dir, ind) ind->dynindx = -1; ind->dynstr_index = 0; } - BFD_ASSERT (ind->dynindx == -1); + else + BFD_ASSERT (ind->dynindx == -1); } void |