aboutsummaryrefslogtreecommitdiff
path: root/gold
diff options
context:
space:
mode:
authorDoug Kwan <dougkwan@google.com>2010-11-18 23:25:08 +0000
committerDoug Kwan <dougkwan@google.com>2010-11-18 23:25:08 +0000
commit0ad220c95233297ad49f23f3d116f91f7e36a39f (patch)
tree0c33b4324ae440ea6e0647743721b3ec12bc19da /gold
parent60a60dd984b265429d18f70f36c0d0dc6e9e876f (diff)
downloadgdb-0ad220c95233297ad49f23f3d116f91f7e36a39f.zip
gdb-0ad220c95233297ad49f23f3d116f91f7e36a39f.tar.gz
gdb-0ad220c95233297ad49f23f3d116f91f7e36a39f.tar.bz2
2010-11-18 Doug Kwan <dougkwan@google.com>
* expression.cc (BINARY_EXPRESSION): Initialize left_alignment and right_alignment to be zero. Store result alignment only if it is greater than existing alignment.
Diffstat (limited to 'gold')
-rw-r--r--gold/ChangeLog6
-rw-r--r--gold/expression.cc12
2 files changed, 13 insertions, 5 deletions
diff --git a/gold/ChangeLog b/gold/ChangeLog
index 97e6e28..29a3438 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,9 @@
+2010-11-18 Doug Kwan <dougkwan@google.com>
+
+ * expression.cc (BINARY_EXPRESSION): Initialize left_alignment
+ and right_alignment to be zero. Store result alignment only if it is
+ greater than existing alignment.
+
2010-11-16 Cary Coutant <ccoutant@google.com>
PR gold/12220
diff --git a/gold/expression.cc b/gold/expression.cc
index 5441f7e..e527b5e 100644
--- a/gold/expression.cc
+++ b/gold/expression.cc
@@ -399,18 +399,19 @@ class Binary_expression : public Expression
value(const Expression_eval_info* eei) \
{ \
Output_section* left_section; \
- uint64_t left_alignment; \
+ uint64_t left_alignment = 0; \
uint64_t left = this->left_value(eei, &left_section, \
&left_alignment); \
Output_section* right_section; \
- uint64_t right_alignment; \
+ uint64_t right_alignment = 0; \
uint64_t right = this->right_value(eei, &right_section, \
&right_alignment); \
if (KEEP_RIGHT && left_section == NULL && right_section != NULL) \
{ \
if (eei->result_section_pointer != NULL) \
*eei->result_section_pointer = right_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; \
} \
else if (KEEP_LEFT \
@@ -419,8 +420,9 @@ class Binary_expression : public Expression
{ \
if (eei->result_section_pointer != NULL) \
*eei->result_section_pointer = left_section; \
- if (eei->result_alignment_pointer != NULL) \
- *eei->result_alignment_pointer = right_alignment; \
+ if (eei->result_alignment_pointer != NULL \
+ && left_alignment > *eei->result_alignment_pointer) \
+ *eei->result_alignment_pointer = left_alignment; \
} \
else if ((WARN || left_section != right_section) \
&& (left_section != NULL || right_section != NULL) \