Add copyright notices
[deliverable/binutils-gdb.git] / bfd / elf64-x86-64.c
index 9edc5aea3bc42bf0b93fdeec1b99b2e1f923c176..d58384ff7e8efb9968c5726da6c327fd1b8344fe 100644 (file)
@@ -449,7 +449,7 @@ elf_x86_64_write_core_note (bfd *abfd, char *buf, int *bufsiz,
        }
       else
        {
-         prpsinfo_t data;
+         prpsinfo64_t data;
          memset (&data, 0, sizeof (data));
          strncpy (data.pr_fname, fname, sizeof (data.pr_fname));
          strncpy (data.pr_psargs, psargs, sizeof (data.pr_psargs));
@@ -490,7 +490,7 @@ elf_x86_64_write_core_note (bfd *abfd, char *buf, int *bufsiz,
        }
       else
        {
-         prstatus_t prstat;
+         prstatus64_t prstat;
          memset (&prstat, 0, sizeof (prstat));
          prstat.pr_pid = pid;
          prstat.pr_cursig = cursig;
@@ -2595,9 +2595,10 @@ elf_x86_64_convert_mov_to_lea (bfd *abfd, asection *sec,
   if (!is_elf_hash_table (link_info->hash))
     return FALSE;
 
-  /* Nothing to do if there are no codes or no relocations.  */
+  /* Nothing to do if there are no codes, no relocations or no output.  */
   if ((sec->flags & (SEC_CODE | SEC_RELOC)) != (SEC_CODE | SEC_RELOC)
-      || sec->reloc_count == 0)
+      || sec->reloc_count == 0
+      || discarded_section (sec))
     return TRUE;
 
   symtab_hdr = &elf_tdata (abfd)->symtab_hdr;
@@ -2672,7 +2673,7 @@ elf_x86_64_convert_mov_to_lea (bfd *abfd, asection *sec,
         address.  */
       if (h->def_regular
          && h->type != STT_GNU_IFUNC
-         && strcmp (h->root.root.string, "_DYNAMIC") != 0
+         && h != htab->elf.hdynamic
          && SYMBOL_REFERENCES_LOCAL (link_info, h)
          && bfd_get_8 (input_bfd,
                        contents + irel->r_offset - 2) == 0x8b)
@@ -2916,15 +2917,10 @@ elf_x86_64_size_dynamic_sections (bfd *output_bfd,
 
   if (htab->elf.sgotplt)
     {
-      struct elf_link_hash_entry *got;
-      got = elf_link_hash_lookup (elf_hash_table (info),
-                                 "_GLOBAL_OFFSET_TABLE_",
-                                 FALSE, FALSE, FALSE);
-
       /* Don't allocate .got.plt section if there are no GOT nor PLT
         entries and there is no refeence to _GLOBAL_OFFSET_TABLE_.  */
-      if ((got == NULL
-          || !got->ref_regular_nonweak)
+      if ((htab->elf.hgot == NULL
+          || !htab->elf.hgot->ref_regular_nonweak)
          && (htab->elf.sgotplt->size
              == get_elf_backend_data (output_bfd)->got_header_size)
          && (htab->elf.splt == NULL
@@ -4466,7 +4462,7 @@ elf_x86_64_finish_dynamic_symbol (bfd *output_bfd,
          || plt == NULL
          || gotplt == NULL
          || relplt == NULL)
-       return FALSE;
+       abort ();
 
       /* Get the index in the procedure linkage table which
         corresponds to this symbol.  This is the index of this symbol
This page took 0.025914 seconds and 4 git commands to generate.