This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[GOLD] [PATCH 1/3] aarch64.cc:Stub_template_repertoire: Avoid unnecessary, duplicate insns array
gold/ChangeLog:
2017-01-24 Pedro Alves <palves@redhat.com>
* aarch64.cc (Stub_template_repertoire): Delete ST_E_835769_INSNS
array. Add new install_insn_template_insns macro, factored out
from install_insn_template, and use it to install the stub
template for ST_E_835769.
---
gold/aarch64.cc | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)
diff --git a/gold/aarch64.cc b/gold/aarch64.cc
index b282ccf..bd9500e 100644
--- a/gold/aarch64.cc
+++ b/gold/aarch64.cc
@@ -784,28 +784,23 @@ Stub_template_repertoire<big_endian>::Stub_template_repertoire()
0x14000000, /* b <label> */
};
- // 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) \
+#define install_insn_template_insns(T, I) \
const static Stub_template<big_endian> template_##T = { \
- T##_INSNS, sizeof(T##_INSNS) / sizeof(T##_INSNS[0]) }; \
+ I##_INSNS, sizeof(I##_INSNS) / sizeof(I##_INSNS[0]) }; \
this->stub_templates_[T] = &template_##T
+#define install_insn_template(T) \
+ install_insn_template_insns(T, T)
install_insn_template(ST_NONE);
install_insn_template(ST_ADRP_BRANCH);
install_insn_template(ST_LONG_BRANCH_ABS);
install_insn_template(ST_LONG_BRANCH_PCREL);
install_insn_template(ST_E_843419);
- install_insn_template(ST_E_835769);
+ // ST_E_835769 has the same stub template as ST_E_843419.
+ install_insn_template_insns(ST_E_835769, ST_E_843419);
#undef install_insn_template
+#undef install_insn_template_insns
}
--
2.5.5