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
commitc98661d1fb63f45e652ae0a427c5cdb71ea9f9d4 (patch)
tree8824461a87e73b6728935f6422b56aea04a788ac /bfd/cofflink.c
parent8d3aee37c74352fc5ecb73dd8927b46a729195aa (diff)
downloadgdb-c98661d1fb63f45e652ae0a427c5cdb71ea9f9d4.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 32200a83a63..eb9388fc71e 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)