summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2008-10-25 09:54:01 +0000
committerNick Clifton <nickc@redhat.com>2008-10-25 09:54:01 +0000
commit0427a07b95c4b07cc8963020c8e3c047d4b1ac79 (patch)
tree56015044faa8f2762deae2c6233f7dda9f6c2e43
parent7d487251164d10872f0e07a3b43f3db5efa1519b (diff)
downloadbinutils-redhat-0427a07b95c4b07cc8963020c8e3c047d4b1ac79.tar.gz
PR 6945
* ldlang.c (lang_size_sections_1): Do not update the VMAs of output sections when performing a relocatable link on COFF objects.
-rw-r--r--ld/ChangeLog7
-rw-r--r--ld/ldlang.c7
2 files changed, 13 insertions, 1 deletions
diff --git a/ld/ChangeLog b/ld/ChangeLog
index ab23982c8b..3fec7a592e 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -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
diff --git a/ld/ldlang.c b/ld/ldlang.c
index 322ce5bc5d..9fd26a99e2 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -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;
}