Skip to content

Commit d8bced2

Browse files
daxtensmpe
authored andcommitted
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: Daniel Axtens <[email protected]> Reviewed-by: Mahesh Salgaonkar <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent 7c98bd7 commit d8bced2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

arch/powerpc/include/asm/fadump.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@
4545

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

48-
#ifndef ELF_CORE_EFLAGS
49-
#define ELF_CORE_EFLAGS 0
50-
#endif
51-
5248
/* Firmware provided dump sections */
5349
#define FADUMP_CPU_STATE_DATA 0x0001
5450
#define FADUMP_HPTE_REGION 0x0002

arch/powerpc/kernel/fadump.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,11 @@ static int fadump_init_elfcore_header(char *bufp)
778778
elf->e_entry = 0;
779779
elf->e_phoff = sizeof(struct elfhdr);
780780
elf->e_shoff = 0;
781-
elf->e_flags = ELF_CORE_EFLAGS;
781+
#if defined(_CALL_ELF)
782+
elf->e_flags = _CALL_ELF;
783+
#else
784+
elf->e_flags = 0;
785+
#endif
782786
elf->e_ehsize = sizeof(struct elfhdr);
783787
elf->e_phentsize = sizeof(struct elf_phdr);
784788
elf->e_phnum = 0;

0 commit comments

Comments
 (0)