This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH][GOLD] Fix segment alignment


Hi Ian,

   This patch fixes the alignment problem reported by Markus.  I
looked at declarations of Expression::eval_with_dot() and
Expression::eval_maybe_dot() in script.h.  According to comments in
there, the location *RESULT_ALIGNMENT is written only if the existing
value there is smaller than the alignment of the expression.  So I
think it is incorrect that Binary_<operator>::value() sets
*EEI->RESULT_ALIGNMENT_POINTER unconditionally.  Furthermore, the old
code looks a little suspicious to me, why do we only use
right_alignment? Should the KEEP_LEFT case use left_alignment instead?

  This is tested on x86_64-unknown-linux-gnu.

-Doug

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.

Attachment: patch-align.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]