Skip to content

Commit abd1506

Browse files
masahir0ysmb49
authored andcommitted
linux/init: remove __memexit* annotations
BugLink: https://bugs.launchpad.net/bugs/2061814 commit 6a4e59e upstream. We have never used __memexit, __memexitdata, or __memexitconst. These were unneeded. Signed-off-by: Masahiro Yamada <[email protected]> Acked-by: Arnd Bergmann <[email protected]> [nathan: Remove additional case of XXXEXIT_TO_SOME_EXIT due to lack of 78dac1a in 6.1] Signed-off-by: Nathan Chancellor <[email protected]> Stable-dep-of: 846cfbe ("um: Fix adding '-no-pie' for clang") Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Portia Stephens <[email protected]> Signed-off-by: Roxana Nicolescu <[email protected]>
1 parent 13c7a39 commit abd1506

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
@@ -363,7 +363,6 @@
363363
*(.ref.data) \
364364
*(.data..shared_aligned) /* percpu related */ \
365365
MEM_KEEP(init.data*) \
366-
MEM_KEEP(exit.data*) \
367366
*(.data.unlikely) \
368367
__start_once = .; \
369368
*(.data.once) \
@@ -528,7 +527,6 @@
528527
__init_rodata : AT(ADDR(__init_rodata) - LOAD_OFFSET) { \
529528
*(.ref.rodata) \
530529
MEM_KEEP(init.rodata) \
531-
MEM_KEEP(exit.rodata) \
532530
} \
533531
\
534532
/* Built-in module parameters. */ \
@@ -581,7 +579,6 @@
581579
*(.ref.text) \
582580
*(.text.asan.* .text.tsan.*) \
583581
MEM_KEEP(init.text*) \
584-
MEM_KEEP(exit.text*) \
585582

586583

587584
/* sched.text is aling to function alignment to secure we have same
@@ -721,13 +718,10 @@
721718
*(.exit.data .exit.data.*) \
722719
*(.fini_array .fini_array.*) \
723720
*(.dtors .dtors.*) \
724-
MEM_DISCARD(exit.data*) \
725-
MEM_DISCARD(exit.rodata*)
726721

727722
#define EXIT_TEXT \
728723
*(.exit.text) \
729724
*(.text.exit) \
730-
MEM_DISCARD(exit.text)
731725

732726
#define EXIT_CALL \
733727
*(.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
@@ -796,18 +796,17 @@ static void check_section(const char *modname, struct elf_info *elf,
796796
#define ALL_INIT_TEXT_SECTIONS \
797797
".init.text", ".meminit.text"
798798
#define ALL_EXIT_TEXT_SECTIONS \
799-
".exit.text", ".memexit.text"
799+
".exit.text"
800800

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

806806
#define ALL_XXXINIT_SECTIONS MEM_INIT_SECTIONS
807-
#define ALL_XXXEXIT_SECTIONS MEM_EXIT_SECTIONS
808807

809808
#define ALL_INIT_SECTIONS INIT_SECTIONS, ALL_XXXINIT_SECTIONS
810-
#define ALL_EXIT_SECTIONS EXIT_SECTIONS, ALL_XXXEXIT_SECTIONS
809+
#define ALL_EXIT_SECTIONS EXIT_SECTIONS
811810

812811
#define DATA_SECTIONS ".data", ".data.rel"
813812
#define TEXT_SECTIONS ".text", ".text.*", ".sched.text", \
@@ -820,7 +819,6 @@ static void check_section(const char *modname, struct elf_info *elf,
820819
#define MEM_INIT_SECTIONS ".meminit.*"
821820

822821
#define EXIT_SECTIONS ".exit.*"
823-
#define MEM_EXIT_SECTIONS ".memexit.*"
824822

825823
#define ALL_TEXT_SECTIONS ALL_INIT_TEXT_SECTIONS, ALL_EXIT_TEXT_SECTIONS, \
826824
TEXT_SECTIONS, OTHER_TEXT_SECTIONS
@@ -830,7 +828,6 @@ enum mismatch {
830828
DATA_TO_ANY_INIT,
831829
TEXTDATA_TO_ANY_EXIT,
832830
XXXINIT_TO_SOME_INIT,
833-
XXXEXIT_TO_SOME_EXIT,
834831
ANY_INIT_TO_ANY_EXIT,
835832
ANY_EXIT_TO_ANY_INIT,
836833
EXTABLE_TO_NON_TEXT,
@@ -881,12 +878,6 @@ static const struct sectioncheck sectioncheck[] = {
881878
.bad_tosec = { INIT_SECTIONS, NULL },
882879
.mismatch = XXXINIT_TO_SOME_INIT,
883880
},
884-
/* Do not reference exit code/data from memexit code/data */
885-
{
886-
.fromsec = { ALL_XXXEXIT_SECTIONS, NULL },
887-
.bad_tosec = { EXIT_SECTIONS, NULL },
888-
.mismatch = XXXEXIT_TO_SOME_EXIT,
889-
},
890881
/* Do not use exit code/data from init code */
891882
{
892883
.fromsec = { ALL_INIT_SECTIONS, NULL },
@@ -1015,7 +1006,7 @@ static int secref_whitelist(const char *fromsec, const char *fromsym,
10151006

10161007
/* symbols in data sections that may refer to meminit sections */
10171008
if (match(fromsec, PATTERNS(DATA_SECTIONS)) &&
1018-
match(tosec, PATTERNS(ALL_XXXINIT_SECTIONS, ALL_XXXEXIT_SECTIONS)) &&
1009+
match(tosec, PATTERNS(ALL_XXXINIT_SECTIONS)) &&
10191010
match(fromsym, PATTERNS("*driver")))
10201011
return 0;
10211012

0 commit comments

Comments
 (0)