This reverts commit eb8f689046b8 ("Use separate sections for __dev/ _cpu/__mem code/data"). Check section mismatch to __meminit* only when CONFIG_MEMORY_HOTPLUG=n. With this change, the linker script and modpost become simpler, and we can get rid of the __ref annotations from the memory hotplug code. [sfr@canb.auug.org.au: remove MEM_KEEP from arch/powerpc/kernel/vmlinux.lds.S] Link: https://lkml.kernel.org/r/20240710093213.2aefb25f@canb.auug.org.au Link: https://lkml.kernel.org/r/20240706160511.2331061-2-masahiroy@kernel.org Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Reviewed-by: Wei Yang <richard.weiyang@gmail.com> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Showing the changes to scripts/mod (1 of 4 files). Show all
Unified · Split
| @@ -776,17 +776,14 @@ static void check_section(const char *modname, struct elf_info *elf, · 775 unmodified lines | ||
| 776 | 776 | |
| 777 | 777 | |
| 778 | 778 | #define ALL_INIT_DATA_SECTIONS \ |
| 779 | − ".init.setup", ".init.rodata", ".meminit.rodata", \ | |
| 780 | − ".init.data", ".meminit.data" | |
| 779 | + ".init.setup", ".init.rodata", ".init.data" | |
| 781 | 780 | |
| 782 | 781 | #define ALL_PCI_INIT_SECTIONS \ |
| 783 | 782 | ".pci_fixup_early", ".pci_fixup_header", ".pci_fixup_final", \ |
| 784 | 783 | ".pci_fixup_enable", ".pci_fixup_resume", \ |
| 785 | 784 | ".pci_fixup_resume_early", ".pci_fixup_suspend" |
| 786 | 785 | |
| 787 | −#define ALL_XXXINIT_SECTIONS ".meminit.*" | |
| 788 | − | |
| 789 | −#define ALL_INIT_SECTIONS INIT_SECTIONS, ALL_XXXINIT_SECTIONS | |
| 786 | +#define ALL_INIT_SECTIONS ".init.*" | |
| 790 | 787 | #define ALL_EXIT_SECTIONS ".exit.*" |
| 791 | 788 | |
| 792 | 789 | #define DATA_SECTIONS ".data", ".data.rel" |
| @@ -797,9 +794,7 @@ static void check_section(const char *modname, struct elf_info *elf, · 4 unmodified lines | ||
| 797 | 794 | ".fixup", ".entry.text", ".exception.text", \ |
| 798 | 795 | ".coldtext", ".softirqentry.text" |
| 799 | 796 | |
| 800 | −#define INIT_SECTIONS ".init.*" | |
| 801 | − | |
| 802 | −#define ALL_TEXT_SECTIONS ".init.text", ".meminit.text", ".exit.text", \ | |
| 797 | +#define ALL_TEXT_SECTIONS ".init.text", ".exit.text", \ | |
| 803 | 798 | TEXT_SECTIONS, OTHER_TEXT_SECTIONS |
| 804 | 799 | |
| 805 | 800 | enum mismatch { |
| @@ -839,12 +834,6 @@ static const struct sectioncheck sectioncheck[] = { · 33 unmodified lines | ||
| 839 | 834 | .bad_tosec = { ALL_INIT_SECTIONS, ALL_EXIT_SECTIONS, NULL }, |
| 840 | 835 | .mismatch = TEXTDATA_TO_ANY_INIT_EXIT, |
| 841 | 836 | }, |
| 842 | −/* Do not reference init code/data from meminit code/data */ | |
| 843 | −{ | |
| 844 | − .fromsec = { ALL_XXXINIT_SECTIONS, NULL }, | |
| 845 | − .bad_tosec = { INIT_SECTIONS, NULL }, | |
| 846 | − .mismatch = XXXINIT_TO_SOME_INIT, | |
| 847 | −}, | |
| 848 | 837 | /* Do not use exit code/data from init code */ |
| 849 | 838 | { |
| 850 | 839 | .fromsec = { ALL_INIT_SECTIONS, NULL }, |
| @@ -859,7 +848,7 @@ static const struct sectioncheck sectioncheck[] = { · 8 unmodified lines | ||
| 859 | 848 | }, |
| 860 | 849 | { |
| 861 | 850 | .fromsec = { ALL_PCI_INIT_SECTIONS, NULL }, |
| 862 | − .bad_tosec = { INIT_SECTIONS, NULL }, | |
| 851 | + .bad_tosec = { ALL_INIT_SECTIONS, NULL }, | |
| 863 | 852 | .mismatch = ANY_INIT_TO_ANY_EXIT, |
| 864 | 853 | }, |
| 865 | 854 | { |