aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>1999-08-10 06:22:57 +0000
committerMark Mitchell <mark@codesourcery.com>1999-08-10 06:22:57 +0000
commitce00621771a4c519982489247bb7479b9b975334 (patch)
treee26f4f481218295c834a5be1b972ae548af63669
parentb037af20d66096fe71aa65e45c01677cbdf3e79a (diff)
downloadgdb-ce00621771a4c519982489247bb7479b9b975334.zip
gdb-ce00621771a4c519982489247bb7479b9b975334.tar.gz
gdb-ce00621771a4c519982489247bb7479b9b975334.tar.bz2
* elflink.h (elf_bfd_final_link): Tweak last change.
-rw-r--r--bfd/ChangeLog4
-rw-r--r--bfd/elflink.h23
2 files changed, 23 insertions, 4 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index a01598c..f3eb41e 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,7 @@
+Tue Aug 10 00:21:08 1999 Mark P. Mitchell <mark@codesourcery.com>
+
+ * elflink.h (elf_bfd_final_link): Tweak last change.
+
1999-08-09 Mark Mitchell <mark@codesourcery.com>
* elflink.h (elf_link_size_reloc_section): Use the counts in the
diff --git a/bfd/elflink.h b/bfd/elflink.h
index 7bd95d4..c325c3e 100644
--- a/bfd/elflink.h
+++ b/bfd/elflink.h
@@ -4016,12 +4016,27 @@ elf_bfd_final_link (abfd, info)
= elf_section_data (o);
struct bfd_elf_section_data *esdo
= elf_section_data (output_section);
+ unsigned int *rel_count;
+ unsigned int *rel_count2;
- esdo->rel_count += (esdi->rel_hdr.sh_size
- / esdi->rel_hdr.sh_entsize);
+ /* We must be careful to add the relocation froms the
+ input section to the right output count. */
+ if (esdi->rel_hdr.sh_entsize == esdo->rel_hdr.sh_entsize)
+ {
+ rel_count = &esdo->rel_count;
+ rel_count2 = &esdo->rel_count2;
+ }
+ else
+ {
+ rel_count = &esdo->rel_count2;
+ rel_count2 = &esdo->rel_count;
+ }
+
+ *rel_count += (esdi->rel_hdr.sh_size
+ / esdi->rel_hdr.sh_entsize);
if (esdi->rel_hdr2)
- esdo->rel_count2 += (esdi->rel_hdr2->sh_size
- / esdi->rel_hdr2->sh_entsize);
+ *rel_count2 += (esdi->rel_hdr2->sh_size
+ / esdi->rel_hdr2->sh_entsize);
}
}