History

linux/init: remove __memexit* annotations

We have never used __memexit, __memexitdata, or __memexitconst. These were unneeded.

Masahiro Yamada committed 3 years ago

Commit 6a4e59e1 parent 3ada34b3 files · +3 −21Browse files

Unified · Split

3 files
  1. include/asm-generic/vmlinux.lds.h +0 −6
  2. include/linux/init.h +0 −3
  3. scripts/mod/modpost.c +3 −12
include/asm-generic/vmlinux.lds.h+0−6
@@ -356,7 +356,6 @@ · 355 unmodified lines
356 *(.ref.data) \356 *(.ref.data) \
357 *(.data..shared_aligned) /* percpu related */ \357 *(.data..shared_aligned) /* percpu related */ \
358 MEM_KEEP(init.data*) \358 MEM_KEEP(init.data*) \
359 MEM_KEEP(exit.data*) \
360 *(.data.unlikely) \359 *(.data.unlikely) \
361 __start_once = .; \360 __start_once = .; \
362 *(.data.once) \361 *(.data.once) \
@@ -521,7 +520,6 @@ · 158 unmodified lines
521 __init_rodata : AT(ADDR(__init_rodata) - LOAD_OFFSET) { \520 __init_rodata : AT(ADDR(__init_rodata) - LOAD_OFFSET) { \
522 *(.ref.rodata) \521 *(.ref.rodata) \
523 MEM_KEEP(init.rodata) \522 MEM_KEEP(init.rodata) \
524 MEM_KEEP(exit.rodata) \
525 } \523 } \
526 \524 \
527 /* Built-in module parameters. */ \525 /* Built-in module parameters. */ \
@@ -574,7 +572,6 @@ · 46 unmodified lines
574 *(.ref.text) \572 *(.ref.text) \
575 *(.text.asan.* .text.tsan.*) \573 *(.text.asan.* .text.tsan.*) \
576 MEM_KEEP(init.text*) \574 MEM_KEEP(init.text*) \
577 MEM_KEEP(exit.text*) \
578 575
579 576
580/* sched.text is aling to function alignment to secure we have same577/* sched.text is aling to function alignment to secure we have same
@@ -714,13 +711,10 @@ · 133 unmodified lines
714 *(.exit.data .exit.data.*) \711 *(.exit.data .exit.data.*) \
715 *(.fini_array .fini_array.*) \712 *(.fini_array .fini_array.*) \
716 *(.dtors .dtors.*) \713 *(.dtors .dtors.*) \
717 MEM_DISCARD(exit.data*) \
718 MEM_DISCARD(exit.rodata*)
719 714
720#define EXIT_TEXT \715#define EXIT_TEXT \
721 *(.exit.text) \716 *(.exit.text) \
722 *(.text.exit) \717 *(.text.exit) \
723 MEM_DISCARD(exit.text)
724 718
725#define EXIT_CALL \719#define EXIT_CALL \
726 *(.exitcall.exit)720 *(.exitcall.exit)
include/linux/init.h+0−3
@@ -89,9 +89,6 @@ · 88 unmodified lines
89 __latent_entropy89 __latent_entropy
90#define __meminitdata __section(".meminit.data")90#define __meminitdata __section(".meminit.data")
91#define __meminitconst __section(".meminit.rodata")91#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")
95 92
96/* For assembly routines */93/* For assembly routines */
97#define __HEAD .section ".head.text","ax"94#define __HEAD .section ".head.text","ax"
scripts/mod/modpost.c+3−12
@@ -798,7 +798,7 @@ static void check_section(const char *modname, struct elf_info *elf, · 797 unmodified lines
798#define ALL_INIT_TEXT_SECTIONS \798#define ALL_INIT_TEXT_SECTIONS \
799 ".init.text", ".meminit.text"799 ".init.text", ".meminit.text"
800#define ALL_EXIT_TEXT_SECTIONS \800#define ALL_EXIT_TEXT_SECTIONS \
801 ".exit.text", ".memexit.text"801 ".exit.text"
802 802
803#define ALL_PCI_INIT_SECTIONS \803#define ALL_PCI_INIT_SECTIONS \
804 ".pci_fixup_early", ".pci_fixup_header", ".pci_fixup_final", \804 ".pci_fixup_early", ".pci_fixup_header", ".pci_fixup_final", \
@@ -806,10 +806,9 @@ static void check_section(const char *modname, struct elf_info *elf, · 1 unmodified line
806 ".pci_fixup_resume_early", ".pci_fixup_suspend"806 ".pci_fixup_resume_early", ".pci_fixup_suspend"
807 807
808#define ALL_XXXINIT_SECTIONS MEM_INIT_SECTIONS808#define ALL_XXXINIT_SECTIONS MEM_INIT_SECTIONS
809#define ALL_XXXEXIT_SECTIONS MEM_EXIT_SECTIONS
810 809
811#define ALL_INIT_SECTIONS INIT_SECTIONS, ALL_XXXINIT_SECTIONS810#define ALL_INIT_SECTIONS INIT_SECTIONS, ALL_XXXINIT_SECTIONS
812#define ALL_EXIT_SECTIONS EXIT_SECTIONS, ALL_XXXEXIT_SECTIONS811#define ALL_EXIT_SECTIONS EXIT_SECTIONS
813 812
814#define DATA_SECTIONS ".data", ".data.rel"813#define DATA_SECTIONS ".data", ".data.rel"
815#define TEXT_SECTIONS ".text", ".text.*", ".sched.text", \814#define TEXT_SECTIONS ".text", ".text.*", ".sched.text", \
@@ -822,7 +821,6 @@ static void check_section(const char *modname, struct elf_info *elf, · 6 unmodified lines
822#define MEM_INIT_SECTIONS ".meminit.*"821#define MEM_INIT_SECTIONS ".meminit.*"
823 822
824#define EXIT_SECTIONS ".exit.*"823#define EXIT_SECTIONS ".exit.*"
825#define MEM_EXIT_SECTIONS ".memexit.*"
826 824
827#define ALL_TEXT_SECTIONS ALL_INIT_TEXT_SECTIONS, ALL_EXIT_TEXT_SECTIONS, \825#define ALL_TEXT_SECTIONS ALL_INIT_TEXT_SECTIONS, ALL_EXIT_TEXT_SECTIONS, \
828 TEXT_SECTIONS, OTHER_TEXT_SECTIONS826 TEXT_SECTIONS, OTHER_TEXT_SECTIONS
@@ -832,7 +830,6 @@ enum mismatch { · 3 unmodified lines
832 DATA_TO_ANY_INIT,830 DATA_TO_ANY_INIT,
833 TEXTDATA_TO_ANY_EXIT,831 TEXTDATA_TO_ANY_EXIT,
834 XXXINIT_TO_SOME_INIT,832 XXXINIT_TO_SOME_INIT,
835 XXXEXIT_TO_SOME_EXIT,
836 ANY_INIT_TO_ANY_EXIT,833 ANY_INIT_TO_ANY_EXIT,
837 ANY_EXIT_TO_ANY_INIT,834 ANY_EXIT_TO_ANY_INIT,
838 EXTABLE_TO_NON_TEXT,835 EXTABLE_TO_NON_TEXT,
@@ -883,12 +880,6 @@ static const struct sectioncheck sectioncheck[] = { · 44 unmodified lines
883 .bad_tosec = { INIT_SECTIONS, NULL },880 .bad_tosec = { INIT_SECTIONS, NULL },
884 .mismatch = XXXINIT_TO_SOME_INIT,881 .mismatch = XXXINIT_TO_SOME_INIT,
885},882},
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},
892/* Do not use exit code/data from init code */883/* Do not use exit code/data from init code */
893{884{
894 .fromsec = { ALL_INIT_SECTIONS, NULL },885 .fromsec = { ALL_INIT_SECTIONS, NULL },
@@ -1017,7 +1008,7 @@ static int secref_whitelist(const char *fromsec, const char *fromsym, · 122 unmodified lines
1017 1008
1018 /* symbols in data sections that may refer to meminit sections */1009 /* symbols in data sections that may refer to meminit sections */
1019 if (match(fromsec, PATTERNS(DATA_SECTIONS)) &&1010 if (match(fromsec, PATTERNS(DATA_SECTIONS)) &&
1020 match(tosec, PATTERNS(ALL_XXXINIT_SECTIONS, ALL_XXXEXIT_SECTIONS)) &&1011 match(tosec, PATTERNS(ALL_XXXINIT_SECTIONS)) &&
1021 match(fromsym, PATTERNS("*driver")))1012 match(fromsym, PATTERNS("*driver")))
1022 return 0;1013 return 0;
1023 1014