This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: binutils-2.19.90 snapshot is available
On Sat, Sep 12, 2009 at 02:16:48PM +0100, Dave Korn wrote:
>Christopher Faylor wrote:
>
>> I think that the problem is caused by the fix for PR 6945, change 1.296
>> to ldlang.c:
>
> Well spotted, thank you! Let's see if there's another way to fix that
>problem without this undesirable side-effect.
This is a little brute-force but it seems to get closer to desired
behavior:
Index: ldlang.c
===================================================================
RCS file: /cvs/src/src/ld/ldlang.c,v
retrieving revision 1.318
diff -d -u -r1.318 ldlang.c
--- ldlang.c 11 Sep 2009 15:27:35 -0000 1.318
+++ ldlang.c 12 Sep 2009 13:26:37 -0000
@@ -4789,12 +4789,7 @@
os->name, (unsigned long) (newdot - savedot));
}
- /* 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);
+ bfd_set_section_vma (0, os->bfd_section, newdot);
os->bfd_section->output_offset = 0;
}
@@ -4825,6 +4820,13 @@
os->bfd_section->size = TO_SIZE (after - os->bfd_section->vma);
}
+ /* PR 6945: Reset vma 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, 0);
+
/* Set section lma. */
r = os->region;
if (r == NULL)