* sunos.c (sunos_read_dynamic_info): Adjust offsets in an NMAGIC
authorIan Lance Taylor <ian@airs.com>
Mon, 25 Sep 1995 16:45:16 +0000 (16:45 +0000)
committerIan Lance Taylor <ian@airs.com>
Mon, 25 Sep 1995 16:45:16 +0000 (16:45 +0000)
file.  From Peter DeWolf <pld@amt.tay1.dec.com>.

bfd/ChangeLog
bfd/sunos.c

index 86e0bd32a739423de6e48665b7f321d88dc2653d..d810d836e5f64e6d04ff2edb6eabcd63c3b005f9 100644 (file)
@@ -1,5 +1,8 @@
 Mon Sep 25 11:48:02 1995  Ian Lance Taylor  <ian@cygnus.com>
 
+       * sunos.c (sunos_read_dynamic_info): Adjust offsets in an NMAGIC
+       file.  From Peter DeWolf <pld@amt.tay1.dec.com>.
+
        * init.c (initialized): Remove static variable.
        (bfd_init): Don't bother setting initialized.
        (bfd_check_init): Remove.
index c2cf4537fd323a5a1d6a3652164f5b5394953917..f5e2bc814fc1de4d622150d120194c533a944e38 100644 (file)
@@ -204,6 +204,20 @@ sunos_read_dynamic_info (abfd)
   info->dyninfo.ld_text = GET_WORD (abfd, linkinfo.ld_text);
   info->dyninfo.ld_plt_sz = GET_WORD (abfd, linkinfo.ld_plt_sz);
 
+  /* Reportedly the addresses need to be offset by the size of the
+     exec header in an NMAGIC file.  */
+  if (adata (abfd).magic == n_magic)
+    {
+      unsigned long exec_bytes_size = adata (abfd).exec_bytes_size;
+
+      info->dyninfo.ld_need += exec_bytes_size;
+      info->dyninfo.ld_rules += exec_bytes_size;
+      info->dyninfo.ld_rel += exec_bytes_size;
+      info->dyninfo.ld_hash += exec_bytes_size;
+      info->dyninfo.ld_stab += exec_bytes_size;
+      info->dyninfo.ld_symbols += exec_bytes_size;
+    }
+
   /* The only way to get the size of the symbol information appears to
      be to determine the distance between it and the string table.  */
   info->dynsym_count = ((info->dyninfo.ld_symbols - info->dyninfo.ld_stab)