[Gold] Fix for ternary operator within linker scripts

Message ID CA+pbi+5VxCLR1FPcvi0oJkgSnMn6w26KBx-FQyhvSWvEWqfzGw@mail.gmail.com
State New
Headers show
Series
  • [Gold] Fix for ternary operator within linker scripts
Related show

Commit Message

Miguel Saldivar Nov. 10, 2019, 8:04 a.m.
Hello,

This is a fix for: https://sourceware.org/bugzilla/show_bug.cgi?id=24996

The issue was that `arg1_` was being used, rather than the corresponding
member variable.

Thanks,
Miguel Saldivar

From 434e3bf224ef3b8df03f2876a7fc92d88cd0ec3f Mon Sep 17 00:00:00 2001
From: Miguel Saldivar <saldivarcher@gmail.com>

Date: Sat, 9 Nov 2019 23:44:14 -0800
Subject: [PATCH] Fix for ternary operator within linker scripts

        * gold/expression.cc (Trinary_expression::arg2_value): Use correct
integer
        expression when calling "eval_maybe_dot" method.
        (Trinary_expression::arg3_value): Likewise.
---
 gold/ChangeLog     | 5 +++++
 gold/expression.cc | 4 ++--
 2 files changed, 7 insertions(+), 2 deletions(-)

 --
2.23.0

Comments

Alan Modra Nov. 11, 2019, 12:31 a.m. | #1
On Sun, Nov 10, 2019 at 12:04:25AM -0800, Miguel Saldivar wrote:
> Hello,

> 

> This is a fix for: https://sourceware.org/bugzilla/show_bug.cgi?id=24996

> 

> The issue was that `arg1_` was being used, rather than the corresponding

> member variable.


Committed, thanks.  For any future patches please configure your email
client to not modify whitespace or wrap lines as that means patches
can't be applied easily.  Alternatively send patches as attachments.

-- 
Alan Modra
Australia Development Lab, IBM

Patch

diff --git a/gold/ChangeLog b/gold/ChangeLog
index c2acb20a74..9cbda85718 100644
--- a/gold/ChangeLog
+++ b/gold/ChangeLog
@@ -1,3 +1,8 @@ 
+2019-11-09  Miguel Saldivar <saldivarcher@gmail.com>
+       * expression.cc (Trinary_expression::arg2_value): Use correct
integer
+       expression when calling "eval_maybe_dot" method.
+       (Trinary_expression::arg3_value): Likewise.
+
 2019-09-28  Alan Modra  <amodra@gmail.com>

        PR 16794
diff --git a/gold/expression.cc b/gold/expression.cc
index 2471e25a2a..f4bdf2a096 100644
--- a/gold/expression.cc
+++ b/gold/expression.cc
@@ -596,7 +596,7 @@  class Trinary_expression : public Expression
             Output_section** section_pointer,
             uint64_t* alignment_pointer) const
   {
-    return this->arg1_->eval_maybe_dot(eei->symtab, eei->layout,
+    return this->arg2_->eval_maybe_dot(eei->symtab, eei->layout,
                                       eei->check_assertions,
                                       eei->is_dot_available,
                                       eei->dot_value,
@@ -615,7 +615,7 @@  class Trinary_expression : public Expression
             Output_section** section_pointer,
             uint64_t* alignment_pointer) const
   {
-    return this->arg1_->eval_maybe_dot(eei->symtab, eei->layout,
+    return this->arg3_->eval_maybe_dot(eei->symtab, eei->layout,
                                       eei->check_assertions,
                                       eei->is_dot_available,
                                       eei->dot_value,