PR 6945
authorNick Clifton <nickc@redhat.com>
Sat, 25 Oct 2008 09:54:01 +0000 (09:54 +0000)
committerNick Clifton <nickc@redhat.com>
Sat, 25 Oct 2008 09:54:01 +0000 (09:54 +0000)
        * ldlang.c (lang_size_sections_1): Do not update the VMAs of
        output sections when performing a relocatable link on COFF
        objects.

ld/ChangeLog
ld/ldlang.c

index ab23982c8b7f51001ca29b5c1e16a0923db3d438..3fec7a592e8953c4803fcec432d382ba33e0490d 100644 (file)
@@ -1,3 +1,10 @@
+2008-10-25  Nick Clifton  <nickc@redhat.com>
+
+       PR 6945
+       * ldlang.c (lang_size_sections_1): Do not update the VMAs of
+       output sections when performing a relocatable link on COFF
+       objects.
+
 2008-10-22  Nick Clifton  <nickc@redhat.com>
 
        * emultempl/armelf.em (arm_elf_after_open): Move check for using a
index 322ce5bc5d8707e39597fa7e97b3052533f73fcc..9fd26a99e2964ecdd634a02d6dd3de6fb80779c1 100644 (file)
@@ -4626,7 +4626,12 @@ lang_size_sections_1
                             os->name, (unsigned long) (newdot - savedot));
                  }
 
-               bfd_set_section_vma (0, os->bfd_section, newdot);
+               /* PR 6945: Do not update the vma's of output sections
+                  when performing a relocatable link on COFF objects.  */
+               if (! link_info.relocatable
+                   || (bfd_get_flavour (link_info.output_bfd)
+                       != bfd_target_coff_flavour))
+                 bfd_set_section_vma (0, os->bfd_section, newdot);
 
                os->bfd_section->output_offset = 0;
              }