summaryrefslogtreecommitdiff
path: root/bfd/elflink.h
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
commit0b3660a11ef418050c32664dd4a3d769c3f75887 (patch)
treea7ede1f6d19c8336b6a22ac60caa8564fa563686 /bfd/elflink.h
parent5444e5dd114f1f2b8098c88bdb76a7686af56856 (diff)
downloadgdb-0b3660a11ef418050c32664dd4a3d769c3f75887.tar.gz
* elflink.h (elf_bfd_final_link): Tweak last change.
Diffstat (limited to 'bfd/elflink.h')
-rw-r--r--bfd/elflink.h23
1 files changed, 19 insertions, 4 deletions
diff --git a/bfd/elflink.h b/bfd/elflink.h
index 7bd95d44786..c325c3e9c77 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);
}
}