Skip to contentSkip to conversation

elfcore: um: Fix CONFIG_UM typo in linux/elfcore.h

PATCH In review Catalin Marinas 3 participants 3 messages Oct 6, 2021 – Oct 7, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 elfcore: um: Fix CONFIG_UM typo in linux/elfcore.h

There is no CONFIG_UM, only UML. In addition, the arch/x86/um/elfcore.c file is only compiled if CONFIG_X86_32. Fix the #if conditions in the linux/elfcore.h header accordingly.

Fixes 6e7b64b9dd6d ("elfcore: fix building with clang")
Cc Arnd Bergmann <[email protected]>

---

I'm doing some arm64 changes to allow MTE tags to be dumped in the core file and I came across this. In a subsequent patch I'll change the #if check with a dedicated Kconfig option but I thought I'd send the fix first in case anyone deems it important to backport.

 include/linux/elfcore.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/elfcore.h +1 -1
index 2aaa15779d50..957ebec35aad 100644
@@ -109,7 +109,7 @@ static inline int elf_core_copy_task_fpregs(struct task_struct *t, struct pt_reg
 #endif
 }
 
-#if defined(CONFIG_UM) || defined(CONFIG_IA64)
+#if (defined(CONFIG_UML) && defined(CONFIG_X86_32)) || defined(CONFIG_IA64)
 /*
  * These functions parameterize elf_core_dump in fs/binfmt_elf.c to write out
  * extra segments containing the gate DSO contents.  Dumping its
#1 lore raw
Quoted 8 lines · Catalin Marinas

There is no CONFIG_UM, only UML. In addition, the arch/x86/um/elfcore.c file is only compiled if CONFIG_X86_32. Fix the #if conditions in the linux/elfcore.h header accordingly.

Fixes 6e7b64b9dd6d ("elfcore: fix building with clang")
Cc Arnd Bergmann <[email protected]>

Lukas noticed and sent a patch coincidentally just before you:
https://lore.kernel.org/lkml/[email protected]/

Let me cc' you and Arnd into that thread.

Quoted 23 lines

---

I'm doing some arm64 changes to allow MTE tags to be dumped in the core file and I came across this. In a subsequent patch I'll change the #if check with a dedicated Kconfig option but I thought I'd send the fix first in case anyone deems it important to backport.

 include/linux/elfcore.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/elfcore.h +1 -1
index 2aaa15779d50..957ebec35aad 100644
@@ -109,7 +109,7 @@ static inline int elf_core_copy_task_fpregs(struct task_struct *t, struct pt_reg
 #endif
 }
 
-#if defined(CONFIG_UM) || defined(CONFIG_IA64)
+#if (defined(CONFIG_UML) && defined(CONFIG_X86_32)) || defined(CONFIG_IA64)
 /*
  * These functions parameterize elf_core_dump in fs/binfmt_elf.c to write out
  * extra segments containing the gate DSO contents.  Dumping its
Signature · 2 lines
Thanks,
~Nick Desaulniers
#2 lore raw
Quoted 6 lines · On Wed, 6 Oct 2021 14:57:56 -0700 Nick Desaulniers <[email protected]>…
Quoted 5 lines · Catalin Marinas

There is no CONFIG_UM, only UML. In addition, the arch/x86/um/elfcore.c file is only compiled if CONFIG_X86_32. Fix the #if conditions in the linux/elfcore.h header accordingly.

Quoted 8 lines
Quoted 3 lines
Fixes 6e7b64b9dd6d ("elfcore: fix building with clang")
Cc Arnd Bergmann <[email protected]>

Lukas noticed and sent a patch coincidentally just before you:
https://lore.kernel.org/lkml/[email protected]/

Let me cc' you and Arnd into that thread.

I grabbed Lukas's version, as it seemed more complete.

Also I added cc:stable.