aboutsummaryrefslogtreecommitdiff
path: root/bfd/sunos.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1995-09-25 16:45:16 +0000
committerIan Lance Taylor <ian@airs.com>1995-09-25 16:45:16 +0000
commit641ac26a0638837b53896d6733adf0708c8d089a (patch)
treedd4b32acd16cd255e1b37f00f3fba46a04fb9686 /bfd/sunos.c
parent1f5397cad33b02b508c7d1cf4b0793d56b623b1a (diff)
downloadgdb-641ac26a0638837b53896d6733adf0708c8d089a.zip
gdb-641ac26a0638837b53896d6733adf0708c8d089a.tar.gz
gdb-641ac26a0638837b53896d6733adf0708c8d089a.tar.bz2
* sunos.c (sunos_read_dynamic_info): Adjust offsets in an NMAGIC
file. From Peter DeWolf <pld@amt.tay1.dec.com>.
Diffstat (limited to 'bfd/sunos.c')
-rw-r--r--bfd/sunos.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/bfd/sunos.c b/bfd/sunos.c
index c2cf453..f5e2bc8 100644
--- a/bfd/sunos.c
+++ b/bfd/sunos.c
@@ -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)