summaryrefslogtreecommitdiff
path: root/bfd/cofflink.c
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2002-07-08 05:34:08 +0000
committerMark Mitchell <mark@codesourcery.com>2002-07-08 05:34:08 +0000
commitc3a829731cdf9a6218a79cbe560c4ee56e2eacb1 (patch)
tree0f1aa88321033c2b2dfe2422c048c1b6cd23e3a0 /bfd/cofflink.c
parent22e3507646ad9128ec8544807f7080c92ceeab15 (diff)
downloadbinutils-redhat-c3a829731cdf9a6218a79cbe560c4ee56e2eacb1.tar.gz
* cofflink.c (_bfd_coff_final_link): On PE COFF systems, take into
account the impact of relocation count overflow when computing section offsets. * coffcode.h (coff_write_relocs): Use obj_pe when deciding whether or not to apply the PE COFF reloc overflow handling. Fix a fencepost error in deciding whether or not to use that technique.
Diffstat (limited to 'bfd/cofflink.c')
-rw-r--r--bfd/cofflink.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/bfd/cofflink.c b/bfd/cofflink.c
index 32200a83a6..eb9388fc71 100644
--- a/bfd/cofflink.c
+++ b/bfd/cofflink.c
@@ -757,6 +757,10 @@ _bfd_coff_final_link (abfd, info)
o->flags |= SEC_RELOC;
o->rel_filepos = rel_filepos;
rel_filepos += o->reloc_count * relsz;
+ /* In PE COFF, if there are at least 0xffff relocations an
+ extra relocation will be written out to encode the count. */
+ if (obj_pe (abfd) && o->reloc_count >= 0xffff)
+ rel_filepos += relsz;
}
if (bfd_coff_long_section_names (abfd)