summaryrefslogtreecommitdiff
path: root/bfd/coffcode.h
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/coffcode.h
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/coffcode.h')
-rw-r--r--bfd/coffcode.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/bfd/coffcode.h b/bfd/coffcode.h
index 6040026c9e9..bb777aaaf18 100644
--- a/bfd/coffcode.h
+++ b/bfd/coffcode.h
@@ -2394,7 +2394,7 @@ coff_write_relocs (abfd, first_undef)
return false;
#ifdef COFF_WITH_PE
- if (s->reloc_count > 0xffff)
+ if (obj_pe (abfd) && s->reloc_count >= 0xffff)
{
/* encode real count here as first reloc */
struct internal_reloc n;
@@ -3420,7 +3420,7 @@ coff_write_object_contents (abfd)
{
#ifdef COFF_WITH_PE
/* we store the actual reloc count in the first reloc's addr */
- if (current->reloc_count > 0xffff)
+ if (obj_pe (abfd) && current->reloc_count >= 0xffff)
reloc_count ++;
#endif
reloc_count += current->reloc_count;
@@ -3451,7 +3451,7 @@ coff_write_object_contents (abfd)
reloc_base += current->reloc_count * bfd_coff_relsz (abfd);
#ifdef COFF_WITH_PE
/* extra reloc to hold real count */
- if (current->reloc_count > 0xffff)
+ if (obj_pe (abfd) && current->reloc_count >= 0xffff)
reloc_base += bfd_coff_relsz (abfd);
#endif
}