Thread (20 messages) 20 messages, 6 authors, 2016-09-14

Re: [PATCH v2 4/5] powerpc/fadump: Make ELF eflags depend on endian

flat view

From: Michael Ellerman <mpe@ellerman.id.au>
Date: 2016-09-09 10:58:14

Mahesh Jagannath Salgaonkar [off-list ref] writes:
On 09/08/2016 12:30 PM, Mahesh Jagannath Salgaonkar wrote:
quoted
On 09/06/2016 11:02 AM, Daniel Axtens wrote:
quoted
diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
index 0638b82ce294..457f08e544c6 100644
--- a/arch/powerpc/kernel/fadump.c
+++ b/arch/powerpc/kernel/fadump.c
@@ -779,7 +779,11 @@ static int fadump_init_elfcore_header(char *bufp)
 	elf->e_entry = 0;
 	elf->e_phoff = sizeof(struct elfhdr);
 	elf->e_shoff = 0;
-	elf->e_flags = ELF_CORE_EFLAGS;
+#ifdef __LITTLE_ENDIAN__
Wouldn't '#ifdef PPC64_ELF_ABI_v2' be more appropriate here ?
Hari just pointed out to me that the upstream commit
[https://git.kernel.org/cgit/linux/kernel/git/powerpc/linux.git/commit/?id=918d0355]
introduces ELF_CORE_EFLAGS with correct values.
No that's wrong in this case.

It does:

+#define ELF_CORE_EFLAGS (is_elf2_task() ? 2 : 0)

We are generating a core file for *the kernel itself*. So using
is_elf2_task() is wrong. We need to know if the kernel is built v2 or
not, not whether the currently running process is v2.

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help