This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[Patch][Gold] Fix for ternary operator within linker scripts
- From: Miguel Saldivar <saldivarcher at gmail dot com>
- To: binutils at sourceware dot org
- Date: Sun, 10 Nov 2019 00:04:25 -0800
- Subject: [Patch][Gold] Fix for ternary operator within linker scripts
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(-)
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,
--
2.23.0