This fixes a problem for 64-bit Cygwin, where building some packages can
authorNick Clifton <nickc@redhat.com>
Wed, 26 Mar 2014 16:16:20 +0000 (16:16 +0000)
committerNick Clifton <nickc@redhat.com>
Wed, 26 Mar 2014 16:16:20 +0000 (16:16 +0000)
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.

bfd/ChangeLog
bfd/cofflink.c

index aaba40691eeeaacada4137d702addefc0894d3c6..f2b5f9c4aca13901e1296d504094a37f0c64c167 100644 (file)
@@ -1,3 +1,8 @@
+2014-03-26  Nick Clifton  <nickc@redhat.com>
+
+       * cofflink.c (_bfd_coff_generic_relocate_section): Skip
+       relocations in discarded sections.
+
 2014-03-26  Tristan Gingold  <gingold@adacore.com>
 
        * mach-o.c (bfd_mach_o_convert_architecture): Add
index 75ef7aff29245a3371050736bbd5aabfa87be52a..bfb1ebba01340f998fc051a3c48e9a653e646b09 100644 (file)
@@ -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);