elf: Expose ELF header in compat_start_thread()
Like it is done for SET_PERSONALITY with x86, which requires the ELF header to select correct personality parameters, x86 requires the headers on compat_start_thread() to choose starting CS for ELF32 binaries, instead of relying on the going-away TIF_IA32/X32 flags. Add an indirection macro to ELF invocations of START_THREAD, that x86 can reimplement to receive the extra parameter just for ELF files. This requires no changes to other architectures who don't need the header information, they can continue to use the original start_thread for ELF and non-ELF binaries, and it prevents affecting non-ELF code paths for x86. Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/r/20201004032536.1229030-6-krisman@collabora.com
This commit is contained in:
committed by
Thomas Gleixner
parent
2656af0d5a
commit
bc3d7bf61a
@@ -22,6 +22,11 @@
|
||||
SET_PERSONALITY(ex)
|
||||
#endif
|
||||
|
||||
#ifndef START_THREAD
|
||||
#define START_THREAD(elf_ex, regs, elf_entry, start_stack) \
|
||||
start_thread(regs, elf_entry, start_stack)
|
||||
#endif
|
||||
|
||||
#define ELF32_GNU_PROPERTY_ALIGN 4
|
||||
#define ELF64_GNU_PROPERTY_ALIGN 8
|
||||
|
||||
|
||||
Reference in New Issue
Block a user