This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH][GOLD] Fix segment alignment
- From: Ian Lance Taylor <iant at google dot com>
- To: Doug Kwan (éæå) <dougkwan at google dot com>
- Cc: binutils <binutils at sourceware dot org>, Markus Trippelsdorf <markus at trippelsdorf dot de>
- Date: Thu, 18 Nov 2010 14:53:11 -0800
- Subject: Re: [PATCH][GOLD] Fix segment alignment
- References: <AANLkTikJKzLZnGOyK_ZYEoO6iATOmP4ewx6+6DvGR75G@mail.gmail.com>
"Doug Kwan (éæå)" <dougkwan@google.com> writes:
> 2010-11-18 Doug Kwan <dougkwan@google.com>
>
> * expression.cc (BINARY_EXPRESSION): Initalize left_alignment
> and right_alignment to be zero. Store result alignment only if it is
> greater than existing alignment.
> @@ -419,7 +420,8 @@ class Binary_expression : public Express
> { \
> if (eei->result_section_pointer != NULL) \
> *eei->result_section_pointer = left_section; \
> - if (eei->result_alignment_pointer != NULL) \
> + if (eei->result_alignment_pointer != NULL \
> + && right_alignment > *eei->result_alignment_pointer) \
> *eei->result_alignment_pointer = right_alignment; \
> } \
Hmmm, this is clearly a bug in my code. This should be left_alignment
rather than right_alignment.
This is OK with that change.
Thanks for tracking this down.
Ian