MIPS/BFD: Fix section symbol name fetching in relocation
[deliverable/binutils-gdb.git] / bfd / coff64-rs6000.c
index b1968ce7b1f59bb2d6432985f13168d61e242172..7b5bb2460f729307aecfd0f73a30b78039a8f7db 100644 (file)
@@ -1,5 +1,5 @@
 /* BFD back-end for IBM RS/6000 "XCOFF64" files.
-   Copyright (C) 2000-2014 Free Software Foundation, Inc.
+   Copyright (C) 2000-2016 Free Software Foundation, Inc.
    Written Clinton Popetz.
    Contributed by Cygnus Support.
 
@@ -87,7 +87,8 @@ static void _bfd_xcoff64_swap_lineno_in
 static unsigned int _bfd_xcoff64_swap_lineno_out
   (bfd *, void *, void *);
 static bfd_boolean _bfd_xcoff64_put_symbol_name
-  (bfd *, struct bfd_strtab_hash *, struct internal_syment *, const char *);
+  (struct bfd_link_info *, struct bfd_strtab_hash *,
+   struct internal_syment *, const char *);
 static bfd_boolean _bfd_xcoff64_put_ldsymbol_name
   (bfd *, struct xcoff_loader_info *, struct internal_ldsym *, const char *);
 static void _bfd_xcoff64_swap_sym_in
@@ -321,7 +322,7 @@ _bfd_xcoff64_swap_sym_in (bfd *abfd, void *ext1, void *in1)
   in->_n._n_n._n_zeroes = 0;
   in->_n._n_n._n_offset = H_GET_32 (abfd, ext->e_offset);
   in->n_value = H_GET_64 (abfd, ext->e_value);
-  in->n_scnum = H_GET_16 (abfd, ext->e_scnum);
+  in->n_scnum = (short) H_GET_16 (abfd, ext->e_scnum);
   in->n_type = H_GET_16 (abfd, ext->e_type);
   in->n_sclass = H_GET_8 (abfd, ext->e_sclass);
   in->n_numaux = H_GET_8 (abfd, ext->e_numaux);
@@ -518,18 +519,15 @@ _bfd_xcoff64_swap_aux_out (bfd *abfd, void *inp, int type, int in_class,
 }
 
 static bfd_boolean
-_bfd_xcoff64_put_symbol_name (bfd *abfd, struct bfd_strtab_hash *strtab,
+_bfd_xcoff64_put_symbol_name (struct bfd_link_info *info,
+                             struct bfd_strtab_hash *strtab,
                               struct internal_syment *sym,
                               const char *name)
 {
   bfd_boolean hash;
   bfd_size_type indx;
 
-  hash = TRUE;
-
-  if ((abfd->flags & BFD_TRADITIONAL_FORMAT) != 0)
-    hash = FALSE;
-
+  hash = !info->traditional_format;
   indx = _bfd_stringtab_add (strtab, name, hash, FALSE);
 
   if (indx == (bfd_size_type) -1)
@@ -1277,7 +1275,7 @@ xcoff64_ppc_relocate_section (bfd *output_bfd,
                }
              else
                {
-                 BFD_ASSERT (info->relocatable
+                 BFD_ASSERT (bfd_link_relocatable (info)
                              || (h->flags & XCOFF_DEF_DYNAMIC) != 0
                              || (h->flags & XCOFF_IMPORT) != 0);
                }
@@ -2712,11 +2710,11 @@ const bfd_target rs6000_xcoff64_vec =
     coff_make_empty_symbol,
     coff_print_symbol,
     coff_get_symbol_info,
+    coff_get_symbol_version_string,
     _bfd_xcoff_is_local_label_name,
     coff_bfd_is_target_special_symbol,
     coff_get_lineno,
     coff_find_nearest_line,
-    _bfd_generic_find_nearest_line_discriminator,
     coff_find_line,
     coff_find_inliner_info,
     coff_bfd_make_debug_symbol,
@@ -2743,6 +2741,7 @@ const bfd_target rs6000_xcoff64_vec =
     _bfd_generic_copy_link_hash_symbol_type,
     _bfd_xcoff_bfd_final_link,
     _bfd_generic_link_split_section,
+    _bfd_generic_link_check_relocs,
     bfd_generic_gc_sections,
     bfd_generic_lookup_section_flags,
     bfd_generic_merge_sections,
@@ -2970,11 +2969,11 @@ const bfd_target rs6000_xcoff64_aix_vec =
     coff_make_empty_symbol,
     coff_print_symbol,
     coff_get_symbol_info,
+    coff_get_symbol_version_string,
     _bfd_xcoff_is_local_label_name,
     coff_bfd_is_target_special_symbol,
     coff_get_lineno,
     coff_find_nearest_line,
-    _bfd_generic_find_nearest_line_discriminator,
     coff_find_line,
     coff_find_inliner_info,
     coff_bfd_make_debug_symbol,
@@ -3001,6 +3000,7 @@ const bfd_target rs6000_xcoff64_aix_vec =
     _bfd_generic_copy_link_hash_symbol_type,
     _bfd_xcoff_bfd_final_link,
     _bfd_generic_link_split_section,
+    _bfd_generic_link_check_relocs,
     bfd_generic_gc_sections,
     bfd_generic_lookup_section_flags,
     bfd_generic_merge_sections,
This page took 0.026982 seconds and 4 git commands to generate.