Merge tag 'core_core_updates_for_5.8' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-microblaze.git] / arch / arm64 / include / asm / elf.h
index 0e7df6f..8d1c8dc 100644 (file)
 
 #ifndef __ASSEMBLY__
 
+#include <uapi/linux/elf.h>
 #include <linux/bug.h>
+#include <linux/errno.h>
+#include <linux/fs.h>
+#include <linux/types.h>
 #include <asm/processor.h> /* for signal_minsigstksz, used by ARCH_DLINFO */
 
 typedef unsigned long elf_greg_t;
@@ -245,6 +249,52 @@ extern int aarch32_setup_additional_pages(struct linux_binprm *bprm,
 
 #endif /* CONFIG_COMPAT */
 
+struct arch_elf_state {
+       int flags;
+};
+
+#define ARM64_ELF_BTI          (1 << 0)
+
+#define INIT_ARCH_ELF_STATE {                  \
+       .flags = 0,                             \
+}
+
+static inline int arch_parse_elf_property(u32 type, const void *data,
+                                         size_t datasz, bool compat,
+                                         struct arch_elf_state *arch)
+{
+       /* No known properties for AArch32 yet */
+       if (IS_ENABLED(CONFIG_COMPAT) && compat)
+               return 0;
+
+       if (type == GNU_PROPERTY_AARCH64_FEATURE_1_AND) {
+               const u32 *p = data;
+
+               if (datasz != sizeof(*p))
+                       return -ENOEXEC;
+
+               if (system_supports_bti() &&
+                   (*p & GNU_PROPERTY_AARCH64_FEATURE_1_BTI))
+                       arch->flags |= ARM64_ELF_BTI;
+       }
+
+       return 0;
+}
+
+static inline int arch_elf_pt_proc(void *ehdr, void *phdr,
+                                  struct file *f, bool is_interp,
+                                  struct arch_elf_state *state)
+{
+       return 0;
+}
+
+static inline int arch_check_elf(void *ehdr, bool has_interp,
+                                void *interp_ehdr,
+                                struct arch_elf_state *state)
+{
+       return 0;
+}
+
 #endif /* !__ASSEMBLY__ */
 
 #endif