Fix problem in aarch64 gold sources uncovered by Coverty - using sizeof on a pointer...
authorNick Clifton <nickc@redhat.com>
Fri, 20 Jan 2017 10:21:17 +0000 (10:21 +0000)
committerNick Clifton <nickc@redhat.com>
Fri, 20 Jan 2017 10:21:17 +0000 (10:21 +0000)
* aarch64.cc (Stub_template_repertoire): Change ST_E_835769_INSNS
        from a pointer to an array.

gold/ChangeLog
gold/aarch64.cc

index 787fb6e7e76077a567a6bc7b4c0e7fcc1d4fb324..b357d88ac648373c3c39a0868171e3fdef386c23 100644 (file)
@@ -1,3 +1,8 @@
+2017-01-20  Nick Clifton  <nickc@redhat.com>
+
+       * aarch64.cc (Stub_template_repertoire): Change ST_E_835769_INSNS
+        from a pointer to an array.
+
 2017-01-13  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR gold/21040
index b207dcdc3da31edd71d62e48d6b6cb818897e3bf..b282ccf4ef0b9bb600c155a629ad6219d6b41d38 100644 (file)
@@ -784,8 +784,14 @@ Stub_template_repertoire<big_endian>::Stub_template_repertoire()
       0x14000000,    /* b <label> */
     };
 
-  // ST_E_835769 has the same stub template as ST_E_843419.
-  const static Insntype* ST_E_835769_INSNS = ST_E_843419_INSNS;
+  // ST_E_835769 has the same stub template as ST_E_843419
+  // but we reproduce the array here so that the sizeof
+  // expressions in install_insn_template will work.
+  const static Insntype ST_E_835769_INSNS[] =
+    {
+      0x00000000,    /* Placeholder for erratum insn. */
+      0x14000000,    /* b <label> */
+    };
 
 #define install_insn_template(T) \
   const static Stub_template<big_endian> template_##T = {  \