summaryrefslogtreecommitdiff
path: root/bfd/som.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2001-10-05 21:55:12 +0000
committerJeff Law <law@redhat.com>2001-10-05 21:55:12 +0000
commitaf2c7cab644eece324e86bf3ed8d9c7b2bffdb91 (patch)
tree0dd88715412e2c428f1dc3dcdc8fcce855ac8d59 /bfd/som.c
parenta91e38b6d23cd4d7e6dc301e641b500b2455a19e (diff)
downloadgdb-af2c7cab644eece324e86bf3ed8d9c7b2bffdb91.tar.gz
* 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.
Diffstat (limited to 'bfd/som.c')
-rw-r--r--bfd/som.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/bfd/som.c b/bfd/som.c
index 0f1fc09e851..95735f5955a 100644
--- 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