* doc/c-arm.texi: Add new fpe options to list of supported flags.
[deliverable/binutils-gdb.git] / bfd / som.c
index 0f1fc09e851270a0be7f6fd8b715fc6af9aa3677..cf4af77229ed76133f98471d53690b02e3084704 100644 (file)
--- a/bfd/som.c
+++ b/bfd/som.c
@@ -1814,6 +1814,8 @@ som_object_setup (abfd, file_hdrp, aux_hdrp, current_offset)
       obj_som_exec_data (abfd)->exec_flags = aux_hdrp->exec_flags;
     }
 
+  obj_som_exec_data (abfd)->version_id = file_hdrp->version_id;
+
   bfd_default_set_arch_mach (abfd, bfd_arch_hppa, pa10);
   bfd_get_symcount (abfd) = file_hdrp->symbol_total;
 
@@ -1849,7 +1851,8 @@ setup_sections (abfd, file_hdr, current_offset)
   char *space_strings;
   unsigned int space_index, i;
   unsigned int total_subspaces = 0;
-  asection **subspace_sections, *section;
+  asection **subspace_sections = NULL;
+  asection *section;
   bfd_size_type amt;
 
   /* First, read in space names.  */
@@ -2320,9 +2323,6 @@ som_prep_headers (abfd)
   else
     file_hdr->a_magic = RELOC_MAGIC;
 
-  /* Only new format SOM is supported.  */
-  file_hdr->version_id = NEW_VERSION_ID;
-
   /* These fields are optional, and embedding timestamps is not always
      a wise thing to do, it makes comparing objects during a multi-stage
      bootstrap difficult.  */
@@ -2961,7 +2961,7 @@ som_write_fixups (abfd, current_offset, total_reloc_sizep)
                  break;
 
                case R_END_TRY:
-                 /* The end of a exception handling region.  The reloc's
+                 /* The end of an exception handling region.  The reloc's
                     addend contains the offset of the exception handling
                     code.  */
                  if (bfd_reloc->addend == 0)
@@ -3688,6 +3688,14 @@ som_finish_writing (abfd)
   unsigned int total_reloc_size;
   bfd_size_type amt;
 
+  /* We must set up the version identifier here as objcopy/strip copy
+     private BFD data too late for us to handle this in som_begin_writing.  */
+  if (obj_som_exec_data (abfd)
+      && obj_som_exec_data (abfd)->version_id)
+    obj_som_file_hdr (abfd)->version_id = obj_som_exec_data (abfd)->version_id;
+  else
+    obj_som_file_hdr (abfd)->version_id = NEW_VERSION_ID;
+
   /* Next is the symbol table.  These are fixed length records.
 
      Count the number of symbols to determine how much room is needed
This page took 0.024369 seconds and 4 git commands to generate.