From: Bharata B Rao Date: Mon, 19 May 2014 17:59:22 +0000 (+0200) Subject: target-ppc: Set the correct endianness in ELF dump header X-Git-Tag: v2.1.0-rc0~53^2~77 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e6ed54ef84c5c131216bcef44930970eee8f687;p=thirdparty%2Fqemu.git target-ppc: Set the correct endianness in ELF dump header Signed-off-by: Bharata B Rao Reviewed-by: Alexander Graf Signed-off-by: Greg Kurz Signed-off-by: Alexander Graf --- diff --git a/target-ppc/arch_dump.c b/target-ppc/arch_dump.c index 5a3b40df100..5acafc68a4e 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; }