summaryrefslogtreecommitdiff
path: root/arch/xtensa/include/asm/elf.h
diff options
context:
space:
mode:
authorMax Filippov <jcmvbkbc@gmail.com>2022-06-03 21:31:14 +0300
committerMax Filippov <jcmvbkbc@gmail.com>2022-09-14 04:28:00 +0300
commite3ddb8bbe0f8cc994748c81e17acc58fda6f8abe (patch)
treec4a5c648f6622b6c655b3cbd02d7575e30898b58 /arch/xtensa/include/asm/elf.h
parentccd2d9df6e21581dfed3e6dffb3b6f1b7efd1a26 (diff)
downloadlinux-e3ddb8bbe0f8cc994748c81e17acc58fda6f8abe.tar.xz
xtensa: add FDPIC and static PIE support for noMMU
Define ELFOSABI_XTENSA_FDPIC and use it as an OSABI tag in the ELF header to distinguish FDPIC ELF files from regular ELF files. Define ELF_FDPIC_PLAT_INIT and put executable map, interpreter map and executable dynamic section addresses into registers a4..a6. Update start_thread macro to preserve register values in the current register window. Add definitions for PTRACE_GETFDPIC, PTRACE_GETFDPIC_EXEC and PTRACE_GETFDPIC_INTERP. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'arch/xtensa/include/asm/elf.h')
-rw-r--r--arch/xtensa/include/asm/elf.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/xtensa/include/asm/elf.h b/arch/xtensa/include/asm/elf.h
index 9c21897c6992..ffcf1ada19c6 100644
--- a/arch/xtensa/include/asm/elf.h
+++ b/arch/xtensa/include/asm/elf.h
@@ -93,6 +93,10 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
#define elf_check_arch(x) ( ( (x)->e_machine == EM_XTENSA ) || \
( (x)->e_machine == EM_XTENSA_OLD ) )
+#define ELFOSABI_XTENSA_FDPIC 65
+#define elf_check_fdpic(x) ((x)->e_ident[EI_OSABI] == ELFOSABI_XTENSA_FDPIC)
+#define ELF_FDPIC_CORE_EFLAGS 0
+
/*
* These are used to set parameters in the core dumps.
*/
@@ -164,6 +168,13 @@ typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG];
(_r)->areg[14] = 0; (_r)->areg[15] = 0; \
} while (0)
+#define ELF_FDPIC_PLAT_INIT(_r, _exec_map_addr, _interp_map_addr, dynamic_addr) \
+ do { \
+ (_r)->areg[4] = _exec_map_addr; \
+ (_r)->areg[5] = _interp_map_addr; \
+ (_r)->areg[6] = dynamic_addr; \
+ } while (0)
+
typedef struct {
xtregs_opt_t opt;
xtregs_user_t user;