aboutsummaryrefslogtreecommitdiff
path: root/gold/aarch64.cc
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2017-01-20 10:21:17 +0000
committerNick Clifton <nickc@redhat.com>2017-01-20 10:21:17 +0000
commita24df3057179f81a2624bf3bd3d78113cb2fcc8e (patch)
treec107860cd1491ec47b5d63f77a4a85273f517b92 /gold/aarch64.cc
parentde1ab01e8ebf04a3503d8450e6b924c7bb160853 (diff)
downloadgdb-a24df3057179f81a2624bf3bd3d78113cb2fcc8e.zip
gdb-a24df3057179f81a2624bf3bd3d78113cb2fcc8e.tar.gz
gdb-a24df3057179f81a2624bf3bd3d78113cb2fcc8e.tar.bz2
Fix problem in aarch64 gold sources uncovered by Coverty - using sizeof on a pointer instead of an array.
* aarch64.cc (Stub_template_repertoire): Change ST_E_835769_INSNS from a pointer to an array.
Diffstat (limited to 'gold/aarch64.cc')
-rw-r--r--gold/aarch64.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/gold/aarch64.cc b/gold/aarch64.cc
index b207dcd..b282ccf 100644
--- a/gold/aarch64.cc
+++ b/gold/aarch64.cc
@@ -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 = { \