* som.h (som_exec_data): New field "version_id".
authorJeff Law <law@redhat.com>
Fri, 5 Oct 2001 21:55:12 +0000 (21:55 +0000)
committerJeff Law <law@redhat.com>
Fri, 5 Oct 2001 21:55:12 +0000 (21:55 +0000)
        * som.c (som_object_setup): Record the version_id if it
        exists.
        (som_prep_headers): Do not initialize version_id here.
        (som_finish_writing): Initialize version_id here.

bfd/ChangeLog
bfd/som.c
bfd/som.h

index d637d48bf4c4430f67455c3d33d9bbe71ec87901..01412b689e5a713e4904c68e43d332453b4d1067 100644 (file)
@@ -1,4 +1,12 @@
-2001-10-05  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
+2001-10-05  Jeff Law <law@redhat.com>
+
+       * som.h (som_exec_data): New field "version_id".
+       * som.c (som_object_setup): Record the version_id if it
+       exists.
+       (som_prep_headers): Do not initialize version_id here.
+       (som_finish_writing): Initialize version_id here.
+
+2000-10-05  Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
 
        * elf32-mips.c (elf_mips_howto_table): Fix some relocation howtos
        according to the MIPS/SGI ELF64 ABI Draft.
index 0f1fc09e851270a0be7f6fd8b715fc6af9aa3677..95735f5955acb579cc72421ee29fc71093c65f23 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;
 
@@ -2320,9 +2322,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.  */
@@ -3688,6 +3687,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
index 5f0d1839deaf2929389f84bb934fc1e062fb1c26..158c96f918ece3cedccb2851a825e2531525ce8d 100644 (file)
--- a/bfd/som.h
+++ b/bfd/som.h
@@ -94,6 +94,10 @@ struct som_exec_data
        null pointer dereferencing is allowed and the like.  */
     long exec_flags;
 
+    /* We must preserve the version identifier too.  Some versions
+       of the HP linker do not grok NEW_VERSION_ID for reasons unknown.  */
+    unsigned int version_id;
+
     /* Add more stuff here as needed.  Good examples of information
        we might want to pass would be presumed_dp, entry_* and maybe
        others from the file header.  */
This page took 0.034815 seconds and 4 git commands to generate.