summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThan McIntosh <thanm@google.com>2015-10-16 13:44:18 (GMT)
committerThan McIntosh <thanm@google.com>2015-10-16 13:44:18 (GMT)
commitb51d5d619a9fcf799bf90c4b16bb74d6caf00ff1 (patch)
tree4ccfc3839d66f65fd725298386d0ce4f57ec2874
parent21947aa23cb8a568fc4a7cd2755227230e9fc4e1 (diff)
downloadtoolchain_binutils-b51d5d619a9fcf799bf90c4b16bb74d6caf00ff1.zip
toolchain_binutils-b51d5d619a9fcf799bf90c4b16bb74d6caf00ff1.tar.gz
toolchain_binutils-b51d5d619a9fcf799bf90c4b16bb74d6caf00ff1.tar.bz2
Fix gold build error at -O0.
Cherrypick of upstream commit 5d7908e0880030628536a0266968a15922574735 Author: Cary Coutant <ccoutant@gmail.com> Date: Thu Jun 11 13:19:38 2015 -0700 Fix gold build error at -O0. In aarch64.cc, Erratum_stub::STUB_ADDR_ALIGN and Reloc_stub::STUB_ADDR_ALIGN are declared as static const int, and initialized in the class body. These values are referenced from outside the class body, and with no optimization, the references go unresolved. gold/ * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization outside class body. (Reloc_stub::STUB_ADDR_ALIGN): Likewise. Change-Id: I6c0726e624be076e0d0565652a56da5ef761d88a
-rw-r--r--binutils-2.25/gold/ChangeLog6
-rw-r--r--binutils-2.25/gold/aarch64.cc9
2 files changed, 13 insertions, 2 deletions
diff --git a/binutils-2.25/gold/ChangeLog b/binutils-2.25/gold/ChangeLog
index ae58510..608d9fd 100644
--- a/binutils-2.25/gold/ChangeLog
+++ b/binutils-2.25/gold/ChangeLog
@@ -61,6 +61,12 @@
code into create_erratum_stub.
* options.h (fix_cortex_a53_835769): New option.
+2015-06-11 Cary Coutant <ccoutant@gmail.com>
+
+ * aarch64.cc (Erratum_stub::STUB_ADDR_ALIGN): Move initialization
+ outside class body.
+ (Reloc_stub::STUB_ADDR_ALIGN): Likewise.
+
2015-06-10 Han Shen <shenhan@google.com>
Patch for erratum-843419 (2 of 2 - fix erratum occurrences).
diff --git a/binutils-2.25/gold/aarch64.cc b/binutils-2.25/gold/aarch64.cc
index ac18bc4..4948194 100644
--- a/binutils-2.25/gold/aarch64.cc
+++ b/binutils-2.25/gold/aarch64.cc
@@ -897,7 +897,7 @@ public:
typedef AArch64_insn_utilities<big_endian> Insn_utilities;
typedef typename AArch64_insn_utilities<big_endian>::Insntype Insntype;
- static const int STUB_ADDR_ALIGN = 4;
+ static const int STUB_ADDR_ALIGN;
static const Insntype invalid_insn = static_cast<Insntype>(-1);
@@ -1020,6 +1020,9 @@ private:
}; // End of "Erratum_stub".
+template<int size, bool big_endian>
+const int Erratum_stub<size, big_endian>::STUB_ADDR_ALIGN = 4;
+
// Comparator used in set definition.
template<int size, bool big_endian>
struct Erratum_stub_less
@@ -1069,7 +1072,7 @@ class Reloc_stub : public Stub_base<size, big_endian>
static const int MIN_ADRP_IMM = -(1 << 20);
static const int BYTES_PER_INSN = 4;
- static const int STUB_ADDR_ALIGN = 4;
+ static const int STUB_ADDR_ALIGN;
// Determine whether the offset fits in the jump/branch instruction.
static bool
@@ -1215,6 +1218,8 @@ class Reloc_stub : public Stub_base<size, big_endian>
static const unsigned int invalid_index = static_cast<unsigned int>(-1);
}; // End of Reloc_stub
+template<int size, bool big_endian>
+const int Reloc_stub<size, big_endian>::STUB_ADDR_ALIGN = 4;
// Write data to output file.