ChangeLog rotatation and copyright year update
[deliverable/binutils-gdb.git] / bfd / elf32-frv.c
index c2b74c640b2740d5ce472de60b1e790264bdbb0e..ca0f78d008e8807fc456f62a1c90adab633e736c 100644 (file)
@@ -1,6 +1,5 @@
 /* FRV-specific support for 32-bit ELF.
-   Copyright 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
-   Free Software Foundation, Inc.
+   Copyright (C) 2002-2015 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -797,8 +796,8 @@ static reloc_howto_type elf32_frv_rel_tlsoff_howto =
 
 
 \f
-extern const bfd_target bfd_elf32_frvfdpic_vec;
-#define IS_FDPIC(bfd) ((bfd)->xvec == &bfd_elf32_frvfdpic_vec)
+extern const bfd_target frv_elf32_fdpic_vec;
+#define IS_FDPIC(bfd) ((bfd)->xvec == &frv_elf32_fdpic_vec)
 
 /* An extension of the elf hash table data structure, containing some
    additional FRV-specific data.  */
@@ -952,7 +951,7 @@ frvfdpic_elf_link_hash_table_create (bfd *abfd)
   struct frvfdpic_elf_link_hash_table *ret;
   bfd_size_type amt = sizeof (struct frvfdpic_elf_link_hash_table);
 
-  ret = bfd_zalloc (abfd, amt);
+  ret = bfd_zmalloc (amt);
   if (ret == NULL)
     return NULL;
 
@@ -2558,6 +2557,11 @@ frv_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED,
       break;
 
     default:
+      if (r_type >= (unsigned int) R_FRV_max)
+       {
+         _bfd_error_handler (_("%A: invalid FRV reloc number: %d"), abfd, r_type);
+         r_type = 0;
+       }
       cache_ptr->howto = & elf32_frv_howto_table [r_type];
       break;
     }
@@ -2735,13 +2739,13 @@ elf32_frv_relocate_section (bfd *output_bfd ATTRIBUTE_UNUSED,
        }
       else
        {
-         bfd_boolean warned;
+         bfd_boolean warned, ignored;
          bfd_boolean unresolved_reloc;
 
          RELOC_FOR_GLOBAL_SYMBOL (info, input_bfd, input_section, rel,
                                   r_symndx, symtab_hdr, sym_hashes,
                                   h, sec, relocation,
-                                  unresolved_reloc, warned);
+                                  unresolved_reloc, warned, ignored);
          osec = sec;
          name = h->root.root.string;
        }
@@ -5507,7 +5511,7 @@ elf32_frvfdpic_always_size_sections (bfd *output_bfd,
 static bfd_boolean
 _frvfdpic_check_discarded_relocs (bfd *abfd, asection *sec,
                                  struct bfd_link_info *info,
-                                 
+
                                  bfd_boolean *changed)
 {
   Elf_Internal_Shdr *symtab_hdr;
@@ -6046,6 +6050,10 @@ elf32_frv_check_relocs (bfd *abfd,
          while (h->root.type == bfd_link_hash_indirect
                 || h->root.type == bfd_link_hash_warning)
            h = (struct elf_link_hash_entry *) h->root.u.i.link;
+
+         /* PR15323, ref flags aren't set for references in the same
+            object.  */
+         h->root.non_ir_ref = 1;
        }
 
       switch (ELF32_R_TYPE (rel->r_info))
@@ -6309,27 +6317,6 @@ frv_elf_set_private_flags (bfd *abfd, flagword flags)
   return TRUE;
 }
 
-/* Copy backend specific data from one object module to another.  */
-
-static bfd_boolean
-frv_elf_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
-{
-  if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
-      || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
-    return TRUE;
-
-  BFD_ASSERT (!elf_flags_init (obfd)
-             || elf_elfheader (obfd)->e_flags == elf_elfheader (ibfd)->e_flags);
-
-  elf_elfheader (obfd)->e_flags = elf_elfheader (ibfd)->e_flags;
-  elf_flags_init (obfd) = TRUE;
-
-  /* Copy object attributes.  */
-  _bfd_elf_copy_obj_attributes (ibfd, obfd);
-
-  return TRUE;
-}
-
 /* Return true if the architecture described by elf header flag
    EXTENSION is an extension of the architecture described by BASE.  */
 
@@ -6357,23 +6344,6 @@ frv_elf_arch_extension_p (flagword base, flagword extension)
   return FALSE;
 }
 
-static bfd_boolean
-elf32_frvfdpic_copy_private_bfd_data (bfd *ibfd, bfd *obfd)
-{
-  if (bfd_get_flavour (ibfd) != bfd_target_elf_flavour
-      || bfd_get_flavour (obfd) != bfd_target_elf_flavour)
-    return TRUE;
-
-  if (! frv_elf_copy_private_bfd_data (ibfd, obfd))
-    return FALSE;
-
-  if (! elf_tdata (ibfd) || ! elf_tdata (ibfd)->phdr
-      || ! elf_tdata (obfd) || ! elf_tdata (obfd)->phdr)
-    return TRUE;
-
-  return TRUE;
-}
-
 /* Merge backend specific data from an object file to the output
    object file when linking.  */
 
@@ -6744,12 +6714,12 @@ elf32_frv_grok_prstatus (bfd *abfd, Elf_Internal_Note *note)
          hardcoded offsets and sizes listed below (and contained within
         this lexical block) refer to fields in the target's elf_prstatus
         struct.  */
-      case 268:        
+      case 268:
        /* `pr_cursig' is at offset 12.  */
-       elf_tdata (abfd)->core_signal = bfd_get_16 (abfd, note->descdata + 12);
+       elf_tdata (abfd)->core->signal = bfd_get_16 (abfd, note->descdata + 12);
 
        /* `pr_pid' is at offset 24.  */
-       elf_tdata (abfd)->core_lwpid = bfd_get_32 (abfd, note->descdata + 24);
+       elf_tdata (abfd)->core->lwpid = bfd_get_32 (abfd, note->descdata + 24);
 
        /* `pr_reg' is at offset 72.  */
        offset = 72;
@@ -6760,7 +6730,7 @@ elf32_frv_grok_prstatus (bfd *abfd, Elf_Internal_Note *note)
           and `pr_interp_fdpic_loadmap', both of which (by design)
           immediately follow `pr_reg'.  This will allow these fields to
           be viewed by GDB as registers.
-          
+
           `pr_reg' is 184 bytes long.  `pr_exec_fdpic_loadmap' and
           `pr_interp_fdpic_loadmap' are 4 bytes each.  */
        raw_size = 184 + 4 + 4;
@@ -6785,11 +6755,11 @@ elf32_frv_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
       case 124:
 
        /* `pr_fname' is found at offset 28 and is 16 bytes long.  */
-       elf_tdata (abfd)->core_program
+       elf_tdata (abfd)->core->program
          = _bfd_elfcore_strndup (abfd, note->descdata + 28, 16);
 
        /* `pr_psargs' is found at offset 44 and is 80 bytes long.  */
-       elf_tdata (abfd)->core_command
+       elf_tdata (abfd)->core->command
          = _bfd_elfcore_strndup (abfd, note->descdata + 44, 80);
     }
 
@@ -6798,7 +6768,7 @@ elf32_frv_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
      implementations, so strip it off if it exists.  */
 
   {
-    char *command = elf_tdata (abfd)->core_command;
+    char *command = elf_tdata (abfd)->core->command;
     int n = strlen (command);
 
     if (0 < n && command[n - 1] == ' ')
@@ -6812,7 +6782,7 @@ elf32_frv_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
 #define ELF_MACHINE_CODE       EM_CYGNUS_FRV
 #define ELF_MAXPAGESIZE                0x1000
 
-#define TARGET_BIG_SYM          bfd_elf32_frv_vec
+#define TARGET_BIG_SYM          frv_elf32_vec
 #define TARGET_BIG_NAME                "elf32-frv"
 
 #define elf_info_to_howto                      frv_info_to_howto_rela
@@ -6829,7 +6799,6 @@ elf32_frv_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
 #define bfd_elf32_bfd_reloc_type_lookup                frv_reloc_type_lookup
 #define bfd_elf32_bfd_reloc_name_lookup        frv_reloc_name_lookup
 #define bfd_elf32_bfd_set_private_flags                frv_elf_set_private_flags
-#define bfd_elf32_bfd_copy_private_bfd_data    frv_elf_copy_private_bfd_data
 #define bfd_elf32_bfd_merge_private_bfd_data   frv_elf_merge_private_bfd_data
 #define bfd_elf32_bfd_print_private_bfd_data   frv_elf_print_private_bfd_data
 
@@ -6852,7 +6821,7 @@ elf32_frv_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
 #define ELF_MAXPAGESIZE                0x4000
 
 #undef TARGET_BIG_SYM
-#define TARGET_BIG_SYM          bfd_elf32_frvfdpic_vec
+#define TARGET_BIG_SYM          frv_elf32_fdpic_vec
 #undef TARGET_BIG_NAME
 #define TARGET_BIG_NAME                "elf32-frvfdpic"
 #undef elf32_bed
@@ -6867,9 +6836,6 @@ elf32_frv_grok_psinfo (bfd *abfd, Elf_Internal_Note *note)
 #undef elf_backend_always_size_sections
 #define elf_backend_always_size_sections \
                elf32_frvfdpic_always_size_sections
-#undef bfd_elf32_bfd_copy_private_bfd_data
-#define bfd_elf32_bfd_copy_private_bfd_data \
-               elf32_frvfdpic_copy_private_bfd_data
 
 #undef elf_backend_create_dynamic_sections
 #define elf_backend_create_dynamic_sections \
This page took 0.026385 seconds and 4 git commands to generate.