This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [gold patch] Start sections at 0 for relocatable links
- From: Ian Lance Taylor <iant at google dot com>
- To: Cary Coutant <ccoutant at google dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Fri, 12 Apr 2013 17:14:20 -0700
- Subject: Re: [gold patch] Start sections at 0 for relocatable links
- References: <CAHACq4otPMjwo2qqB8fvoyamtEr1FKR3heULHyRhGkYmTy-gtA at mail dot gmail dot com>
On Fri, Apr 12, 2013 at 4:42 PM, Cary Coutant <ccoutant@google.com> wrote:
> If an Output_section_definition immediately follows an orphaned
> section of non-zero size in the layout order, that section is assigned
> a starting address based on the length of the last orphaned section.
> This patch fixes this by resetting dot_value to 0 after each orphaned
> section.
>
> Tested on x86_64. OK to apply?
>
> -cary
>
> gold/
> * script-sections.cc (Orphan_output_section): Reset address
> to zero after each orphaned section for relocatable links.
This is kind of weird but I don't think there is a good solution here.
It's strange to use a script with a relocateable link and if you do
use a script its clearly best to not have an orphan section. I
suppose this is OK. I do sort of wonder why GNU ld does, but it's
hard to care very much. Thanks.
Ian