diff options
Diffstat (limited to 'bfd/elf32-s390.c')
-rw-r--r-- | bfd/elf32-s390.c | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c index 73db3f7..c8f5a8f 100644 --- a/bfd/elf32-s390.c +++ b/bfd/elf32-s390.c @@ -577,10 +577,8 @@ elf_s390_check_relocs (abfd, info, sec, relocs) if (h != NULL) { - if (h->got.refcount == -1) + if (h->got.refcount == 0) { - h->got.refcount = 1; - /* Make sure this symbol is output as a dynamic symbol. */ if (h->dynindx == -1) { @@ -591,8 +589,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs) sgot->_raw_size += 4; srelgot->_raw_size += sizeof (Elf32_External_Rela); } - else - h->got.refcount += 1; + h->got.refcount += 1; } else { @@ -604,16 +601,13 @@ elf_s390_check_relocs (abfd, info, sec, relocs) size = symtab_hdr->sh_info; size *= sizeof (bfd_signed_vma); local_got_refcounts = (bfd_signed_vma *) - bfd_alloc (abfd, size); + bfd_zalloc (abfd, size); if (local_got_refcounts == NULL) return false; elf_local_got_refcounts (abfd) = local_got_refcounts; - memset (local_got_refcounts, -1, (size_t) size); } - if (local_got_refcounts[r_symndx] == -1) + if (local_got_refcounts[r_symndx] == 0) { - local_got_refcounts[r_symndx] = 1; - sgot->_raw_size += 4; if (info->shared) { @@ -623,8 +617,7 @@ elf_s390_check_relocs (abfd, info, sec, relocs) srelgot->_raw_size += sizeof (Elf32_External_Rela); } } - else - local_got_refcounts[r_symndx] += 1; + local_got_refcounts[r_symndx] += 1; } break; @@ -642,13 +635,8 @@ elf_s390_check_relocs (abfd, info, sec, relocs) if (h == NULL) continue; - if (h->plt.refcount == -1) - { - h->plt.refcount = 1; - h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; - } - else - h->plt.refcount += 1; + h->elf_link_hash_flags |= ELF_LINK_HASH_NEEDS_PLT; + h->plt.refcount += 1; break; case R_390_8: @@ -2164,6 +2152,7 @@ elf_s390_reloc_type_class (rela) #define ELF_MAXPAGESIZE 0x1000 #define elf_backend_can_gc_sections 1 +#define elf_backend_can_refcount 1 #define elf_backend_want_got_plt 1 #define elf_backend_plt_readonly 1 #define elf_backend_want_plt_sym 0 |