diff options
| author | Russell King <rmk+kernel@armlinux.org.uk> | 2017-09-28 11:16:33 +0100 |
|---|---|---|
| committer | Russell King <rmk+kernel@armlinux.org.uk> | 2017-10-02 23:16:29 +0100 |
| commit | 1bb078330b4f0836b5b12365cd8bf68d5f3bbff8 (patch) | |
| tree | 0a15f41ace12c4b308ef6cc57e5aa3be0019e05d /arch/arm/include/asm/processor.h | |
| parent | Merge branch 'xip_zdata' of http://git.linaro.org/people/nicolas.pitre/linux ... (diff) | |
| parent | binfmt_elf_fdpic: fix crash on MMU system with dynamic binaries (diff) | |
| download | linux-1bb078330b4f0836b5b12365cd8bf68d5f3bbff8.tar.gz linux-1bb078330b4f0836b5b12365cd8bf68d5f3bbff8.zip | |
Merge branch 'fdpic' of http://git.linaro.org/people/nicolas.pitre/linux into devel-stable
This series provides the needed changes to suport the ELF_FDPIC binary
format on ARM. Both MMU and non-MMU systems are supported. This format
has many advantages over the BFLT format used on MMU-less systems, such
as being real ELF that can be parsed by standard tools, can support
shared dynamic libs, etc.
Diffstat (limited to 'arch/arm/include/asm/processor.h')
| -rw-r--r-- | arch/arm/include/asm/processor.h | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/arch/arm/include/asm/processor.h b/arch/arm/include/asm/processor.h index c3d5fc124a05..338cbe0a18ef 100644 --- a/arch/arm/include/asm/processor.h +++ b/arch/arm/include/asm/processor.h @@ -47,15 +47,24 @@ struct thread_struct { #define INIT_THREAD { } -#ifdef CONFIG_MMU -#define nommu_start_thread(regs) do { } while (0) -#else -#define nommu_start_thread(regs) regs->ARM_r10 = current->mm->start_data -#endif - #define start_thread(regs,pc,sp) \ ({ \ + unsigned long r7, r8, r9; \ + \ + if (IS_ENABLED(CONFIG_BINFMT_ELF_FDPIC)) { \ + r7 = regs->ARM_r7; \ + r8 = regs->ARM_r8; \ + r9 = regs->ARM_r9; \ + } \ memset(regs->uregs, 0, sizeof(regs->uregs)); \ + if (IS_ENABLED(CONFIG_BINFMT_ELF_FDPIC) && \ + current->personality & FDPIC_FUNCPTRS) { \ + regs->ARM_r7 = r7; \ + regs->ARM_r8 = r8; \ + regs->ARM_r9 = r9; \ + regs->ARM_r10 = current->mm->start_data; \ + } else if (!IS_ENABLED(CONFIG_MMU)) \ + regs->ARM_r10 = current->mm->start_data; \ if (current->personality & ADDR_LIMIT_32BIT) \ regs->ARM_cpsr = USR_MODE; \ else \ @@ -65,7 +74,6 @@ struct thread_struct { regs->ARM_cpsr |= PSR_ENDSTATE; \ regs->ARM_pc = pc & ~1; /* pc */ \ regs->ARM_sp = sp; /* sp */ \ - nommu_start_thread(regs); \ }) /* Forward declaration, a strange C thing */ |
