Skip to content

Commit 6a4e59e

Browse files
committed
linux/init: remove __memexit* annotations
We have never used __memexit, __memexitdata, or __memexitconst. These were unneeded. Signed-off-by: Masahiro Yamada <[email protected]> Acked-by: Arnd Bergmann <[email protected]>
1 parent 3ada34b commit 6a4e59e

File tree

3 files changed

+3
-21
lines changed

3 files changed

+3
-21
lines changed

include/asm-generic/vmlinux.lds.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,6 @@
356356
*(.ref.data) \
357357
*(.data..shared_aligned) /* percpu related */ \
358358
MEM_KEEP(init.data*) \
359-
MEM_KEEP(exit.data*) \
360359
*(.data.unlikely) \
361360
__start_once = .; \
362361
*(.data.once) \
@@ -521,7 +520,6 @@
521520
__init_rodata : AT(ADDR(__init_rodata) - LOAD_OFFSET) { \
522521
*(.ref.rodata) \
523522
MEM_KEEP(init.rodata) \
524-
MEM_KEEP(exit.rodata) \
525523
} \
526524
\
527525
/* Built-in module parameters. */ \
@@ -574,7 +572,6 @@
574572
*(.ref.text) \
575573
*(.text.asan.* .text.tsan.*) \
576574
MEM_KEEP(init.text*) \
577-
MEM_KEEP(exit.text*) \
578575

579576

580577
/* sched.text is aling to function alignment to secure we have same
@@ -714,13 +711,10 @@
714711
*(.exit.data .exit.data.*) \
715712
*(.fini_array .fini_array.*) \
716713
*(.dtors .dtors.*) \
717-
MEM_DISCARD(exit.data*) \
718-
MEM_DISCARD(exit.rodata*)
719714

720715
#define EXIT_TEXT \
721716
*(.exit.text) \
722717
*(.text.exit) \
723-
MEM_DISCARD(exit.text)
724718

725719
#define EXIT_CALL \
726720
*(.exitcall.exit)

include/linux/init.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,6 @@
8989
__latent_entropy
9090
#define __meminitdata __section(".meminit.data")
9191
#define __meminitconst __section(".meminit.rodata")
92-
#define __memexit __section(".memexit.text") __exitused __cold notrace
93-
#define __memexitdata __section(".memexit.data")
94-
#define __memexitconst __section(".memexit.rodata")
9592

9693
/* For assembly routines */
9794
#define __HEAD .section ".head.text","ax"

scripts/mod/modpost.c

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -798,18 +798,17 @@ static void check_section(const char *modname, struct elf_info *elf,
798798
#define ALL_INIT_TEXT_SECTIONS \
799799
".init.text", ".meminit.text"
800800
#define ALL_EXIT_TEXT_SECTIONS \
801-
".exit.text", ".memexit.text"
801+
".exit.text"
802802

803803
#define ALL_PCI_INIT_SECTIONS \
804804
".pci_fixup_early", ".pci_fixup_header", ".pci_fixup_final", \
805805
".pci_fixup_enable", ".pci_fixup_resume", \
806806
".pci_fixup_resume_early", ".pci_fixup_suspend"
807807

808808
#define ALL_XXXINIT_SECTIONS MEM_INIT_SECTIONS
809-
#define ALL_XXXEXIT_SECTIONS MEM_EXIT_SECTIONS
810809

811810
#define ALL_INIT_SECTIONS INIT_SECTIONS, ALL_XXXINIT_SECTIONS
812-
#define ALL_EXIT_SECTIONS EXIT_SECTIONS, ALL_XXXEXIT_SECTIONS
811+
#define ALL_EXIT_SECTIONS EXIT_SECTIONS
813812

814813
#define DATA_SECTIONS ".data", ".data.rel"
815814
#define TEXT_SECTIONS ".text", ".text.*", ".sched.text", \
@@ -822,7 +821,6 @@ static void check_section(const char *modname, struct elf_info *elf,
822821
#define MEM_INIT_SECTIONS ".meminit.*"
823822

824823
#define EXIT_SECTIONS ".exit.*"
825-
#define MEM_EXIT_SECTIONS ".memexit.*"
826824

827825
#define ALL_TEXT_SECTIONS ALL_INIT_TEXT_SECTIONS, ALL_EXIT_TEXT_SECTIONS, \
828826
TEXT_SECTIONS, OTHER_TEXT_SECTIONS
@@ -832,7 +830,6 @@ enum mismatch {
832830
DATA_TO_ANY_INIT,
833831
TEXTDATA_TO_ANY_EXIT,
834832
XXXINIT_TO_SOME_INIT,
835-
XXXEXIT_TO_SOME_EXIT,
836833
ANY_INIT_TO_ANY_EXIT,
837834
ANY_EXIT_TO_ANY_INIT,
838835
EXTABLE_TO_NON_TEXT,
@@ -883,12 +880,6 @@ static const struct sectioncheck sectioncheck[] = {
883880
.bad_tosec = { INIT_SECTIONS, NULL },
884881
.mismatch = XXXINIT_TO_SOME_INIT,
885882
},
886-
/* Do not reference exit code/data from memexit code/data */
887-
{
888-
.fromsec = { ALL_XXXEXIT_SECTIONS, NULL },
889-
.bad_tosec = { EXIT_SECTIONS, NULL },
890-
.mismatch = XXXEXIT_TO_SOME_EXIT,
891-
},
892883
/* Do not use exit code/data from init code */
893884
{
894885
.fromsec = { ALL_INIT_SECTIONS, NULL },
@@ -1017,7 +1008,7 @@ static int secref_whitelist(const char *fromsec, const char *fromsym,
10171008

10181009
/* symbols in data sections that may refer to meminit sections */
10191010
if (match(fromsec, PATTERNS(DATA_SECTIONS)) &&
1020-
match(tosec, PATTERNS(ALL_XXXINIT_SECTIONS, ALL_XXXEXIT_SECTIONS)) &&
1011+
match(tosec, PATTERNS(ALL_XXXINIT_SECTIONS)) &&
10211012
match(fromsym, PATTERNS("*driver")))
10221013
return 0;
10231014

0 commit comments

Comments
 (0)