* coff-arm.c (coff_arm_link_hash_table_create): Use bfd_zmalloc.
[deliverable/binutils-gdb.git] / bfd / elf64-x86-64.c
index c26060600b24cb9124465962a48ced2895b2c215..f709c7a0985524189a31ae062a234dbe103f9f76 100644 (file)
@@ -888,7 +888,7 @@ elf_x86_64_link_hash_table_create (bfd *abfd)
   struct elf_x86_64_link_hash_table *ret;
   bfd_size_type amt = sizeof (struct elf_x86_64_link_hash_table);
 
-  ret = (struct elf_x86_64_link_hash_table *) bfd_malloc (amt);
+  ret = (struct elf_x86_64_link_hash_table *) bfd_zmalloc (amt);
   if (ret == NULL)
     return NULL;
 
@@ -901,18 +901,6 @@ elf_x86_64_link_hash_table_create (bfd *abfd)
       return NULL;
     }
 
-  ret->sdynbss = NULL;
-  ret->srelbss = NULL;
-  ret->plt_eh_frame = NULL;
-  ret->sym_cache.abfd = NULL;
-  ret->tlsdesc_plt = 0;
-  ret->tlsdesc_got = 0;
-  ret->tls_ld_got.refcount = 0;
-  ret->sgotplt_jump_table_size = 0;
-  ret->tls_module_base = NULL;
-  ret->next_jump_slot_index = 0;
-  ret->next_irelative_index = 0;
-
   if (ABI_64_P (abfd))
     {
       ret->r_info = elf64_r_info;
@@ -1424,6 +1412,7 @@ elf_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info,
       struct elf_link_hash_entry *h;
       Elf_Internal_Sym *isym;
       const char *name;
+      bfd_boolean size_reloc;
 
       r_symndx = htab->r_sym (rel->r_info);
       r_type = ELF32_R_TYPE (rel->r_info);
@@ -1708,6 +1697,7 @@ elf_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info,
 
        case R_X86_64_SIZE32:
        case R_X86_64_SIZE64:
+         size_reloc = TRUE;
          goto do_size;
 
        case R_X86_64_32:
@@ -1759,6 +1749,7 @@ pointer:
                h->pointer_equality_needed = 1;
            }
 
+         size_reloc = FALSE;
 do_size:
          /* If we are creating a shared library, and this is a reloc
             against a global symbol, or a non PC relative reloc
@@ -1860,7 +1851,8 @@ do_size:
                }
 
              p->count += 1;
-             if (IS_X86_64_PCREL_TYPE (r_type))
+             /* Count size relocation as PC-relative relocation.  */
+             if (IS_X86_64_PCREL_TYPE (r_type) || size_reloc)
                p->pc_count += 1;
            }
          break;
This page took 0.025421 seconds and 4 git commands to generate.