Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d8bced27 authored by Daniel Axtens's avatar Daniel Axtens Committed by Michael Ellerman
Browse files

powerpc/fadump: Set core e_flags using kernel's ELF ABI version



Firmware Assisted Dump is a facility to dump kernel core with assistance
from firmware. As part of this process the kernel ELF ABI version is
stored in the core file.

Currently fadump.h defines this to 0 if it is not already defined. This
clashes with a define in elf.h which sets it based on the current task -
not based on the kernel's ELF ABI version.

Use the compiler-provided #define _CALL_ELF which tells us the ELF ABI
version of the kernel to set e_flags, this matches what binutils does.

Remove the definition in fadump.h, which becomes unused.

Signed-off-by: default avatarDaniel Axtens <dja@axtens.net>
Reviewed-by: default avatarMahesh Salgaonkar <mahesh@linux.vnet.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 7c98bd72
Loading
Loading
Loading
Loading
+0 −4
Original line number Original line Diff line number Diff line
@@ -45,10 +45,6 @@


#define memblock_num_regions(memblock_type)	(memblock.memblock_type.cnt)
#define memblock_num_regions(memblock_type)	(memblock.memblock_type.cnt)


#ifndef ELF_CORE_EFLAGS
#define ELF_CORE_EFLAGS 0
#endif

/* Firmware provided dump sections */
/* Firmware provided dump sections */
#define FADUMP_CPU_STATE_DATA	0x0001
#define FADUMP_CPU_STATE_DATA	0x0001
#define FADUMP_HPTE_REGION	0x0002
#define FADUMP_HPTE_REGION	0x0002
+5 −1
Original line number Original line Diff line number Diff line
@@ -778,7 +778,11 @@ static int fadump_init_elfcore_header(char *bufp)
	elf->e_entry = 0;
	elf->e_entry = 0;
	elf->e_phoff = sizeof(struct elfhdr);
	elf->e_phoff = sizeof(struct elfhdr);
	elf->e_shoff = 0;
	elf->e_shoff = 0;
	elf->e_flags = ELF_CORE_EFLAGS;
#if defined(_CALL_ELF)
	elf->e_flags = _CALL_ELF;
#else
	elf->e_flags = 0;
#endif
	elf->e_ehsize = sizeof(struct elfhdr);
	elf->e_ehsize = sizeof(struct elfhdr);
	elf->e_phentsize = sizeof(struct elf_phdr);
	elf->e_phentsize = sizeof(struct elf_phdr);
	elf->e_phnum = 0;
	elf->e_phnum = 0;