From: Nick Clifton Date: Wed, 26 Mar 2014 16:16:20 +0000 (+0000) Subject: This fixes a problem for 64-bit Cygwin, where building some packages can X-Git-Tag: gdb-7.8-release~721 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=55bfc9ac025c1c9cd1ad5422829b3dc70f357a79;p=external%2Fbinutils.git This fixes a problem for 64-bit Cygwin, where building some packages can produce spurious errors about truncated relocations. The relocations are only truncated because they are being made against sections which are going to be discarded so that base address is zero instead of the expected 64-bit base value. * cofflink.c (_bfd_coff_generic_relocate_section): Skip relocations in discarded sections. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index aaba406..f2b5f9c 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2014-03-26 Nick Clifton + + * cofflink.c (_bfd_coff_generic_relocate_section): Skip + relocations in discarded sections. + 2014-03-26 Tristan Gingold * mach-o.c (bfd_mach_o_convert_architecture): Add diff --git a/bfd/cofflink.c b/bfd/cofflink.c index 75ef7af..bfb1ebb 100644 --- a/bfd/cofflink.c +++ b/bfd/cofflink.c @@ -3059,6 +3059,11 @@ _bfd_coff_generic_relocate_section (bfd *output_bfd, else { sec = sections[symndx]; + + /* If the output section has been discarded then ignore this reloc. */ + if (sec->output_section->vma == 0) + continue; + val = (sec->output_section->vma + sec->output_offset + sym->n_value);