Thread (3 messages) flat view 3 messages, 2 authors, 2022-01-20

Re: [PATCH V3 10/17] riscv: compat: Add elf.h implementation

From: Arnd Bergmann <arnd@arndb.de>
Date: 2022-01-20 10:26:41
Also in: linux-mips, linux-riscv, linux-s390, linuxppc-dev, lkml, sparclinux

On Thu, Jan 20, 2022 at 8:39 AM [off-list ref] wrote:
From: Guo Ren <redacted>

Implement necessary type and macro for compat elf. See the code
comment for detail.

Signed-off-by: Guo Ren <redacted>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
+
+/*
+ * FIXME: not sure SET_PERSONALITY for compat process is right!
+ */
+#define SET_PERSONALITY(ex)                                    \
+do {    if ((ex).e_ident[EI_CLASS] == ELFCLASS32)              \
+               set_thread_flag(TIF_32BIT);                     \
+       else                                                    \
+               clear_thread_flag(TIF_32BIT);                   \
+       if (personality(current->personality) != PER_LINUX32)   \
+               set_personality(PER_LINUX |                     \
+                       (current->personality & (~PER_MASK)));  \
+} while (0)
+
The implementation looks good to me now,  you can remove that comment above it.

        Arnd

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help