aboutsummaryrefslogtreecommitdiff
path: root/bfd/peXXigen.c
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2003-10-07 08:49:11 +0000
committerNathan Sidwell <nathan@codesourcery.com>2003-10-07 08:49:11 +0000
commitcd339148dea20e4fffc4a184329a978c7894a9e5 (patch)
treea34c3c9a5252190f26d3098f074f6ac7b9f2d4a1 /bfd/peXXigen.c
parent2f9626f3fd613ff1f0356f426d8b3b30e8acf766 (diff)
downloadfsf-binutils-gdb-cd339148dea20e4fffc4a184329a978c7894a9e5.zip
fsf-binutils-gdb-cd339148dea20e4fffc4a184329a978c7894a9e5.tar.gz
fsf-binutils-gdb-cd339148dea20e4fffc4a184329a978c7894a9e5.tar.bz2
* coffcode.h (coff_set_alignment_hook): With PE_COFF reloc
overflow, set reloc start position to after the count reloc. Subtract one from num relocs. Give error on 0xffff relocs and no overflow. * cofflink.c (_bfd_coff_final_link): Deal with PE_COFF reloc overflow. * peXXigen.c (_bfd_XXi_swap_scnhdr_out): Do overflow if >= 0xffff.
Diffstat (limited to 'bfd/peXXigen.c')
-rw-r--r--bfd/peXXigen.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/bfd/peXXigen.c b/bfd/peXXigen.c
index 7f1a6a3..ea98bef 100644
--- a/bfd/peXXigen.c
+++ b/bfd/peXXigen.c
@@ -990,7 +990,11 @@ _bfd_XXi_swap_scnhdr_out (abfd, in, out)
ret = 0;
}
- if (scnhdr_int->s_nreloc <= 0xffff)
+ /* Although we could encode 0xffff relocs here, we do not, to be
+ consistent with other parts of bfd. Also it lets us warn, as
+ we should never see 0xffff here w/o having the overflow flag
+ set. */
+ if (scnhdr_int->s_nreloc < 0xffff)
H_PUT_16 (abfd, scnhdr_int->s_nreloc, scnhdr_ext->s_nreloc);
else
{