hc
2024-09-20 cf4ce59b3b70238352c7f1729f0f7223214828ad
kernel/arch/mips/include/asm/elf.h
....@@ -410,6 +410,7 @@
410410 clear_thread_flag(TIF_32BIT_FPREGS); \
411411 clear_thread_flag(TIF_HYBRID_FPREGS); \
412412 clear_thread_flag(TIF_32BIT_ADDR); \
413
+ current->personality &= ~READ_IMPLIES_EXEC; \
413414 \
414415 if ((ex).e_ident[EI_CLASS] == ELFCLASS32) \
415416 __SET_PERSONALITY32(ex, state); \
....@@ -444,6 +445,9 @@
444445
445446 #define ELF_PLATFORM __elf_platform
446447 extern const char *__elf_platform;
448
+
449
+#define ELF_BASE_PLATFORM __elf_base_platform
450
+extern const char *__elf_base_platform;
447451
448452 /*
449453 * See comments in asm-alpha/elf.h, this is the same thing
....@@ -481,6 +485,8 @@
481485 extern int arch_setup_additional_pages(struct linux_binprm *bprm,
482486 int uses_interp);
483487
488
+#ifdef CONFIG_MIPS_FP_SUPPORT
489
+
484490 struct arch_elf_state {
485491 int nan_2008;
486492 int fp_abi;
....@@ -497,19 +503,35 @@
497503 .overall_fp_mode = -1, \
498504 }
499505
500
-/* Whether to accept legacy-NaN and 2008-NaN user binaries. */
501
-extern bool mips_use_nan_legacy;
502
-extern bool mips_use_nan_2008;
503
-
504506 extern int arch_elf_pt_proc(void *ehdr, void *phdr, struct file *elf,
505507 bool is_interp, struct arch_elf_state *state);
506508
507509 extern int arch_check_elf(void *ehdr, bool has_interpreter, void *interp_ehdr,
508510 struct arch_elf_state *state);
509511
512
+/* Whether to accept legacy-NaN and 2008-NaN user binaries. */
513
+extern bool mips_use_nan_legacy;
514
+extern bool mips_use_nan_2008;
515
+
510516 extern void mips_set_personality_nan(struct arch_elf_state *state);
511517 extern void mips_set_personality_fp(struct arch_elf_state *state);
512518
519
+#else /* !CONFIG_MIPS_FP_SUPPORT */
520
+
521
+struct arch_elf_state;
522
+
523
+static inline void mips_set_personality_nan(struct arch_elf_state *state)
524
+{
525
+ /* no-op */
526
+}
527
+
528
+static inline void mips_set_personality_fp(struct arch_elf_state *state)
529
+{
530
+ /* no-op */
531
+}
532
+
533
+#endif /* !CONFIG_MIPS_FP_SUPPORT */
534
+
513535 #define elf_read_implies_exec(ex, stk) mips_elf_read_implies_exec(&(ex), stk)
514536 extern int mips_elf_read_implies_exec(void *elf_ex, int exstack);
515537