aboutsummaryrefslogtreecommitdiff
path: root/target-ppc
diff options
context:
space:
mode:
authorBharata B Rao <bharata@linux.vnet.ibm.com>2014-05-19 19:59:22 +0200
committerAlexander Graf <agraf@suse.de>2014-06-16 13:24:36 +0200
commit1e6ed54ef84c5c131216bcef44930970eee8f687 (patch)
tree201e25962a9e629cd21c0c3c5873db9ccd70f87a /target-ppc
parent382d2db62bcb34dff7febc270783d5ff662ced7a (diff)
target-ppc: Set the correct endianness in ELF dump header
Signed-off-by: Bharata B Rao <bharata@linux.vnet.ibm.com> Reviewed-by: Alexander Graf <agraf@suse.de> Signed-off-by: Greg Kurz <gkurz@linux.vnet.ibm.com> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'target-ppc')
-rw-r--r--target-ppc/arch_dump.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/target-ppc/arch_dump.c b/target-ppc/arch_dump.c
index 5a3b40df10..5acafc68a4 100644
--- a/target-ppc/arch_dump.c
+++ b/target-ppc/arch_dump.c
@@ -209,12 +209,16 @@ typedef struct NoteFuncDescStruct NoteFuncDesc;
int cpu_get_dump_info(ArchDumpInfo *info,
const struct GuestPhysBlockList *guest_phys_blocks)
{
- /*
- * Currently only handling PPC64 big endian.
- */
+ PowerPCCPU *cpu = POWERPC_CPU(first_cpu);
+ PowerPCCPUClass *pcc = POWERPC_CPU_GET_CLASS(cpu);
+
info->d_machine = EM_PPC64;
- info->d_endian = ELFDATA2MSB;
info->d_class = ELFCLASS64;
+ if ((*pcc->interrupts_big_endian)(cpu)) {
+ info->d_endian = ELFDATA2MSB;
+ } else {
+ info->d_endian = ELFDATA2LSB;
+ }
return 0;
}