aboutsummaryrefslogtreecommitdiff
path: root/gold/arm.cc
diff options
context:
space:
mode:
authorUmesh Kalappa <ukalappa@cisco.com>2017-10-19 20:53:14 -0700
committerCary Coutant <ccoutant@gmail.com>2017-10-19 20:53:14 -0700
commit36862fc052b7006c78024952c4024c60b8a2733f (patch)
treed45668fbecacd4c5175788d9610a3aa324602241 /gold/arm.cc
parent4c2287b0bdfbed95d37d09222fc253f4c5086ada (diff)
downloadgdb-36862fc052b7006c78024952c4024c60b8a2733f.zip
gdb-36862fc052b7006c78024952c4024c60b8a2733f.tar.gz
gdb-36862fc052b7006c78024952c4024c60b8a2733f.tar.bz2
Implement BE8 support for ARM.
gold/ * arm.cc (Stub::do_fixed_endian_write):Far call stubs support for arm in the be8 mode. * testsuite/Makefile.am: New test cases. * testsuite/Makefile.in: Regenerate. * testsuite/arm_farcall_arm_arm_be8.sh: New script for arm to arm far call stubs. * testsuite/arm_farcall_thumb_thumb_be8.sh: New script for thumb to thumb far call stubs.
Diffstat (limited to 'gold/arm.cc')
-rw-r--r--gold/arm.cc33
1 files changed, 26 insertions, 7 deletions
diff --git a/gold/arm.cc b/gold/arm.cc
index f887fe5..982c46d 100644
--- a/gold/arm.cc
+++ b/gold/arm.cc
@@ -4516,30 +4516,49 @@ Stub::do_fixed_endian_write(unsigned char* view, section_size_type view_size)
{
const Stub_template* stub_template = this->stub_template();
const Insn_template* insns = stub_template->insns();
+ const bool enable_be8 = parameters->options().be8();
- // FIXME: We do not handle BE8 encoding yet.
unsigned char* pov = view;
for (size_t i = 0; i < stub_template->insn_count(); i++)
{
switch (insns[i].type())
{
case Insn_template::THUMB16_TYPE:
- elfcpp::Swap<16, big_endian>::writeval(pov, insns[i].data() & 0xffff);
+ if (enable_be8)
+ elfcpp::Swap<16, false>::writeval(pov, insns[i].data() & 0xffff);
+ else
+ elfcpp::Swap<16, big_endian>::writeval(pov,
+ insns[i].data() & 0xffff);
break;
case Insn_template::THUMB16_SPECIAL_TYPE:
- elfcpp::Swap<16, big_endian>::writeval(
- pov,
- this->thumb16_special(i));
+ if (enable_be8)
+ elfcpp::Swap<16, false>::writeval(pov, this->thumb16_special(i));
+ else
+ elfcpp::Swap<16, big_endian>::writeval(pov,
+ this->thumb16_special(i));
break;
case Insn_template::THUMB32_TYPE:
{
uint32_t hi = (insns[i].data() >> 16) & 0xffff;
uint32_t lo = insns[i].data() & 0xffff;
- elfcpp::Swap<16, big_endian>::writeval(pov, hi);
- elfcpp::Swap<16, big_endian>::writeval(pov + 2, lo);
+ if (enable_be8)
+ {
+ elfcpp::Swap<16, false>::writeval(pov, hi);
+ elfcpp::Swap<16, false>::writeval(pov + 2, lo);
+ }
+ else
+ {
+ elfcpp::Swap<16, big_endian>::writeval(pov, hi);
+ elfcpp::Swap<16, big_endian>::writeval(pov + 2, lo);
+ }
}
break;
case Insn_template::ARM_TYPE:
+ if (enable_be8)
+ elfcpp::Swap<32, false>::writeval(pov, insns[i].data());
+ else
+ elfcpp::Swap<32, big_endian>::writeval(pov, insns[i].data());
+ break;
case Insn_template::DATA_TYPE:
elfcpp::Swap<32, big_endian>::writeval(pov, insns[i].data());
break;