]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - bfd/som.c
Use bfd_get_filename throughout bfd
[thirdparty/binutils-gdb.git] / bfd / som.c
index 9f37b10f96c4efd4c4931bdeb7ee9ce3e67c0dbd..d36d163bb6b11910325c0581d9f1ad28fbab6045 100644 (file)
--- a/bfd/som.c
+++ b/bfd/som.c
@@ -1945,7 +1945,7 @@ som_swap_lst_header_in (struct som_external_lst_header *src,
 /* Perform some initialization for an object.  Save results of this
    initialization in the BFD.  */
 
-static const bfd_target *
+static bfd_cleanup
 som_object_setup (bfd *abfd,
                  struct som_header *file_hdrp,
                  struct som_exec_auxhdr *aux_hdrp,
@@ -2060,7 +2060,7 @@ som_object_setup (bfd *abfd,
                                  + current_offset);
   obj_som_exec_data (abfd)->system_id = file_hdrp->system_id;
 
-  return abfd->xvec;
+  return _bfd_no_cleanup;
 }
 
 /* Convert all of the space and subspace info into BFD sections.  Each space
@@ -2197,6 +2197,9 @@ setup_sections (bfd *abfd,
          som_swap_subspace_dictionary_in (&ext_subspace, &subspace);
 
          /* Setup the subspace name string.  */
+         if (subspace.name >= file_hdr->space_strings_size)
+           goto error_return;
+
          subspace_name = subspace.name + space_strings;
 
          amt = strlen (subspace_name) + 1;
@@ -2386,7 +2389,7 @@ setup_sections (bfd *abfd,
 
 /* Read in a SOM object and make it into a BFD.  */
 
-static const bfd_target *
+static bfd_cleanup
 som_object_p (bfd *abfd)
 {
   struct som_external_header ext_file_hdr;
@@ -6657,7 +6660,7 @@ som_write_armap (bfd *abfd,
   unsigned int module_count;
 
   /* We'll use this for the archive's date and mode later.  */
-  if (stat (abfd->filename, &statbuf) != 0)
+  if (stat (bfd_get_filename (abfd), &statbuf) != 0)
     {
       bfd_set_error (bfd_error_system_call);
       return FALSE;