x86: Use zero_undefweak in elf_x86_link_hash_entry
[deliverable/binutils-gdb.git] / bfd / elf64-x86-64.c
index fcc7f5574ea7f28ce69032574a832611562d43b3..0b0aa6cb4de419ce7f5c711d3591a12e145a5dc1 100644 (file)
@@ -1958,7 +1958,7 @@ elf_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info,
            return elf_x86_64_need_pic (info, abfd, sec, h, symtab_hdr, isym,
                                        &x86_64_elf_howto_table[r_type]);
          if (eh != NULL)
-           eh->has_got_reloc = 1;
+           eh->zero_undefweak &= 0x2;
          break;
 
        case R_X86_64_GOTTPOFF:
@@ -2066,7 +2066,7 @@ elf_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info,
        case R_X86_64_GOTPC64:
        create_got:
          if (eh != NULL)
-           eh->has_got_reloc = 1;
+           eh->zero_undefweak &= 0x2;
          break;
 
        case R_X86_64_PLT32:
@@ -2083,7 +2083,7 @@ elf_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info,
          if (h == NULL)
            continue;
 
-         eh->has_got_reloc = 1;
+         eh->zero_undefweak &= 0x2;
          h->needs_plt = 1;
          h->plt.refcount += 1;
          break;
@@ -2134,7 +2134,7 @@ elf_x86_64_check_relocs (bfd *abfd, struct bfd_link_info *info,
        case R_X86_64_64:
 pointer:
          if (eh != NULL && (sec->flags & SEC_CODE) != 0)
-           eh->has_non_got_reloc = 1;
+           eh->zero_undefweak |= 0x2;
          /* We are called after all symbols have been resolved.  Only
             relocation against STT_GNU_IFUNC symbol must go through
             PLT.  */
@@ -3939,17 +3939,7 @@ elf_x86_64_finish_dynamic_symbol (bfd *output_bfd,
          relplt = htab->elf.irelplt;
        }
 
-      /* This symbol has an entry in the procedure linkage table.  Set
-        it up.  */
-      if ((h->dynindx == -1
-          && !local_undefweak
-          && !((h->forced_local || bfd_link_executable (info))
-               && h->def_regular
-               && h->type == STT_GNU_IFUNC))
-         || plt == NULL
-         || gotplt == NULL
-         || relplt == NULL)
-       abort ();
+      VERIFY_PLT_ENTRY (info, h, plt, gotplt, relplt, local_undefweak)
 
       /* Get the index in the procedure linkage table which
         corresponds to this symbol.  This is the index of this symbol
@@ -4263,13 +4253,7 @@ do_glob_dat:
       asection *s;
 
       /* This symbol needs a copy reloc.  Set it up.  */
-
-      if (h->dynindx == -1
-         || (h->root.type != bfd_link_hash_defined
-             && h->root.type != bfd_link_hash_defweak)
-         || htab->elf.srelbss == NULL
-         || htab->elf.sreldynrelro == NULL)
-       abort ();
+      VERIFY_COPY_RELOC (h, htab)
 
       rela.r_offset = (h->root.u.def.value
                       + h->root.u.def.section->output_section->vma
This page took 0.029318 seconds and 4 git commands to generate.