Adds the new Fields and Operand types for the new instructions in Armv8.4-a.
[deliverable/binutils-gdb.git] / bfd / aout-tic30.c
index 30900ba388b9f00252651a68d12afbbb23bd407d..068428c103faeba748d9bc3cac99d53c8a484899 100644 (file)
@@ -1,7 +1,5 @@
 /* BFD back-end for TMS320C30 a.out binaries.
-   Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2009,
-   2010, 2011
-   Free Software Foundation, Inc.
+   Copyright (C) 1998-2017 Free Software Foundation, Inc.
    Contributed by Steven Haworth (steve@pm.cse.rmit.edu.au)
 
    This file is part of BFD, the Binary File Descriptor library.
@@ -189,7 +187,7 @@ tic30_aout_fix_16 (bfd *abfd,
   bfd_vma relocation;
 
   /* Make sure that the symbol's section is defined.  */
-  if (symbol->section == &bfd_und_section && (symbol->flags & BSF_WEAK) == 0)
+  if (bfd_is_und_section (symbol->section) && (symbol->flags & BSF_WEAK) == 0)
     return output_bfd ? bfd_reloc_ok : bfd_reloc_undefined;
   /* Get the size of the input section and turn it into the TMS320C30
      32-bit address format.  */
@@ -214,7 +212,7 @@ tic30_aout_fix_32 (bfd *abfd,
   bfd_vma relocation;
 
   /* Make sure that the symbol's section is defined.  */
-  if (symbol->section == &bfd_und_section && (symbol->flags & BSF_WEAK) == 0)
+  if (bfd_is_und_section (symbol->section) && (symbol->flags & BSF_WEAK) == 0)
     return output_bfd ? bfd_reloc_ok : bfd_reloc_undefined;
   /* Get the size of the input section and turn it into the TMS320C30
      32-bit address format.  */
@@ -341,32 +339,32 @@ tic30_aout_callback (bfd *abfd)
   unsigned long arch_align;
 
   /* Calculate the file positions of the parts of a newly read aout header.  */
-  obj_textsec (abfd)->size = N_TXTSIZE (*execp);
+  obj_textsec (abfd)->size = N_TXTSIZE (execp);
 
   /* The virtual memory addresses of the sections.  */
-  obj_textsec (abfd)->vma = N_TXTADDR (*execp);
-  obj_datasec (abfd)->vma = N_DATADDR (*execp);
-  obj_bsssec (abfd)->vma = N_BSSADDR (*execp);
+  obj_textsec (abfd)->vma = N_TXTADDR (execp);
+  obj_datasec (abfd)->vma = N_DATADDR (execp);
+  obj_bsssec (abfd)->vma = N_BSSADDR (execp);
 
   obj_textsec (abfd)->lma = obj_textsec (abfd)->vma;
   obj_datasec (abfd)->lma = obj_datasec (abfd)->vma;
   obj_bsssec (abfd)->lma = obj_bsssec (abfd)->vma;
 
   /* The file offsets of the sections.  */
-  obj_textsec (abfd)->filepos = N_TXTOFF (*execp);
-  obj_datasec (abfd)->filepos = N_DATOFF (*execp);
+  obj_textsec (abfd)->filepos = N_TXTOFF (execp);
+  obj_datasec (abfd)->filepos = N_DATOFF (execp);
 
   /* The file offsets of the relocation info.  */
-  obj_textsec (abfd)->rel_filepos = N_TRELOFF (*execp);
-  obj_datasec (abfd)->rel_filepos = N_DRELOFF (*execp);
+  obj_textsec (abfd)->rel_filepos = N_TRELOFF (execp);
+  obj_datasec (abfd)->rel_filepos = N_DRELOFF (execp);
 
   /* The file offsets of the string table and symbol table.  */
-  obj_sym_filepos (abfd) = N_SYMOFF (*execp);
-  obj_str_filepos (abfd) = N_STROFF (*execp);
+  obj_sym_filepos (abfd) = N_SYMOFF (execp);
+  obj_str_filepos (abfd) = N_STROFF (execp);
 
   /* Determine the architecture and machine type of the object file.  */
 #ifdef SET_ARCH_MACH
-  SET_ARCH_MACH (abfd, *execp);
+  SET_ARCH_MACH (abfd, execp);
 #else
   bfd_default_set_arch_mach (abfd, DEFAULT_ARCH, 0L);
 #endif
@@ -570,10 +568,10 @@ tic30_aout_object_p (bfd *abfd)
   exec.a_info = H_GET_32 (abfd, exec_bytes.e_info);
 #endif /* SWAP_MAGIC */
 
-  if (N_BADMAG (exec))
+  if (N_BADMAG (&exec))
     return 0;
 #ifdef MACHTYPE_OK
-  if (!(MACHTYPE_OK (N_MACHTYPE (exec))))
+  if (!(MACHTYPE_OK (N_MACHTYPE (&exec))))
     return 0;
 #endif
 
@@ -638,11 +636,8 @@ tic30_aout_write_object_contents (bfd *abfd)
   obj_reloc_entry_size (abfd) = RELOC_STD_SIZE;
 
   {
-    bfd_size_type text_size;   /* Dummy vars.  */
-    file_ptr text_end;
-
     if (adata (abfd).magic == undecided_magic)
-      NAME (aout, adjust_sizes_and_vmas) (abfd, &text_size, &text_end);
+      NAME (aout, adjust_sizes_and_vmas) (abfd);
 
     execp->a_syms = bfd_get_symcount (abfd) * EXTERNAL_NLIST_SIZE;
     execp->a_entry = bfd_get_start_address (abfd);
@@ -666,19 +661,19 @@ tic30_aout_write_object_contents (bfd *abfd)
     if (bfd_get_outsymbols (abfd) != (asymbol **) NULL
        && bfd_get_symcount (abfd) != 0)
       {
-       if (bfd_seek (abfd, (file_ptr) (N_SYMOFF (*execp)), SEEK_SET) != 0)
+       if (bfd_seek (abfd, (file_ptr) (N_SYMOFF (execp)), SEEK_SET) != 0)
          return FALSE;
 
        if (!NAME (aout, write_syms) (abfd))
          return FALSE;
       }
 
-    if (bfd_seek (abfd, (file_ptr) (N_TRELOFF (*execp)), SEEK_SET) != 0)
+    if (bfd_seek (abfd, (file_ptr) (N_TRELOFF (execp)), SEEK_SET) != 0)
       return FALSE;
     if (!NAME (aout, squirt_out_relocs) (abfd, obj_textsec (abfd)))
       return FALSE;
 
-    if (bfd_seek (abfd, (file_ptr) (N_DRELOFF (*execp)), SEEK_SET) != 0)
+    if (bfd_seek (abfd, (file_ptr) (N_DRELOFF (execp)), SEEK_SET) != 0)
       return FALSE;
     if (!NAME (aout, squirt_out_relocs) (abfd, obj_datasec (abfd)))
       return FALSE;
@@ -701,7 +696,7 @@ MY_final_link_callback (bfd *abfd,
 
   *ptreloff = obj_datasec (abfd)->filepos + execp->a_data;
   *pdreloff = *ptreloff + execp->a_trsize;
-  *psymoff = *pdreloff + execp->a_drsize;;
+  *psymoff = *pdreloff + execp->a_drsize;
 }
 
 #endif
@@ -833,7 +828,7 @@ tic30_aout_set_arch_mach (bfd *abfd,
   _bfd_archive_bsd_construct_extended_name_table
 #endif
 #ifndef        MY_write_armap
-#define        MY_write_armap                  bsd_write_armap
+#define        MY_write_armap                  _bfd_bsd_write_armap
 #endif
 #ifndef MY_read_ar_hdr
 #define MY_read_ar_hdr                 _bfd_generic_read_ar_hdr
@@ -910,6 +905,9 @@ tic30_aout_set_arch_mach (bfd *abfd,
 #ifndef MY_canonicalize_reloc
 #define MY_canonicalize_reloc NAME (aout, canonicalize_reloc)
 #endif
+#ifndef MY_set_reloc
+#define MY_set_reloc _bfd_generic_set_reloc
+#endif
 #ifndef MY_make_empty_symbol
 #define MY_make_empty_symbol NAME (aout, make_empty_symbol)
 #endif
@@ -919,6 +917,10 @@ tic30_aout_set_arch_mach (bfd *abfd,
 #ifndef MY_get_symbol_info
 #define MY_get_symbol_info NAME (aout, get_symbol_info)
 #endif
+#ifndef MY_get_symbol_version_string
+#define MY_get_symbol_version_string \
+  _bfd_nosymbols_get_symbol_version_string
+#endif
 #ifndef MY_get_lineno
 #define MY_get_lineno NAME (aout, get_lineno)
 #endif
@@ -928,6 +930,9 @@ tic30_aout_set_arch_mach (bfd *abfd,
 #ifndef MY_find_nearest_line
 #define MY_find_nearest_line NAME (aout, find_nearest_line)
 #endif
+#ifndef MY_find_line
+#define MY_find_line _bfd_nosymbols_find_line
+#endif
 #ifndef MY_find_inliner_info
 #define MY_find_inliner_info _bfd_nosymbols_find_inliner_info
 #endif
@@ -944,6 +949,9 @@ tic30_aout_set_arch_mach (bfd *abfd,
 #ifndef MY_bfd_gc_sections
 #define MY_bfd_gc_sections bfd_generic_gc_sections
 #endif
+#ifndef MY_bfd_lookup_section_flags
+#define MY_bfd_lookup_section_flags bfd_generic_lookup_section_flags
+#endif
 #ifndef MY_bfd_merge_sections
 #define MY_bfd_merge_sections bfd_generic_merge_sections
 #endif
@@ -960,6 +968,9 @@ tic30_aout_set_arch_mach (bfd *abfd,
 #ifndef MY_bfd_define_common_symbol
 #define MY_bfd_define_common_symbol bfd_generic_define_common_symbol
 #endif
+#ifndef MY_bfd_define_start_stop
+#define MY_bfd_define_start_stop bfd_generic_define_start_stop
+#endif
 #ifndef MY_bfd_reloc_type_lookup
 #define MY_bfd_reloc_type_lookup tic30_aout_reloc_type_lookup
 #endif
@@ -978,9 +989,6 @@ tic30_aout_set_arch_mach (bfd *abfd,
 #ifndef MY_bfd_link_hash_table_create
 #define MY_bfd_link_hash_table_create NAME (aout, link_hash_table_create)
 #endif
-#ifndef MY_bfd_link_hash_table_free
-#define MY_bfd_link_hash_table_free _bfd_generic_link_hash_table_free
-#endif
 #ifndef MY_bfd_link_add_symbols
 #define MY_bfd_link_add_symbols NAME (aout, link_add_symbols)
 #endif
@@ -995,6 +1003,10 @@ tic30_aout_set_arch_mach (bfd *abfd,
 #define MY_bfd_link_split_section  _bfd_generic_link_split_section
 #endif
 
+#ifndef MY_bfd_link_check_relocs
+#define MY_bfd_link_check_relocs   _bfd_generic_link_check_relocs
+#endif
+
 #ifndef MY_bfd_copy_private_bfd_data
 #define MY_bfd_copy_private_bfd_data _bfd_generic_bfd_copy_private_bfd_data
 #endif
This page took 0.026801 seconds and 4 git commands to generate.