diff options
author | Paul Gortmaker <paul.gortmaker@windriver.com> | 2013-06-19 19:30:48 -0400 |
---|---|---|
committer | Paul Gortmaker <paul.gortmaker@windriver.com> | 2013-06-26 12:17:06 -0400 |
commit | e24f6628811e2d4531b443684b598f7050932012 (patch) | |
tree | 2201bb012e4089e5a4a4a45cfee3a54e6dc9af22 | |
parent | 22f0a27367742f65130c0fb25ef00f7297e032c1 (diff) |
modpost: remove all traces of cpuinit/cpuexit sections
Delete all audit rules that were checking how the .cpuXYZ
related sections were inter-operating with other __init
like sections, now that __cpuinit is gone. Update the linker
script to not have any knowledge of .cpuinit sections.
[lds.h update courtesy of Ralf Baechle <ralf@linux-mips.org>]
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
-rw-r--r-- | include/asm-generic/vmlinux.lds.h | 12 | ||||
-rw-r--r-- | scripts/mod/modpost.c | 52 |
2 files changed, 9 insertions, 55 deletions
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h index eb58d2d7d971..5e01bee9d1d3 100644 --- a/include/asm-generic/vmlinux.lds.h +++ b/include/asm-generic/vmlinux.lds.h | |||
@@ -184,8 +184,6 @@ | |||
184 | *(.data..shared_aligned) /* percpu related */ \ | 184 | *(.data..shared_aligned) /* percpu related */ \ |
185 | DEV_KEEP(init.data) \ | 185 | DEV_KEEP(init.data) \ |
186 | DEV_KEEP(exit.data) \ | 186 | DEV_KEEP(exit.data) \ |
187 | CPU_KEEP(init.data) \ | ||
188 | CPU_KEEP(exit.data) \ | ||
189 | MEM_KEEP(init.data) \ | 187 | MEM_KEEP(init.data) \ |
190 | MEM_KEEP(exit.data) \ | 188 | MEM_KEEP(exit.data) \ |
191 | *(.data.unlikely) \ | 189 | *(.data.unlikely) \ |
@@ -374,8 +372,6 @@ | |||
374 | *(.ref.rodata) \ | 372 | *(.ref.rodata) \ |
375 | DEV_KEEP(init.rodata) \ | 373 | DEV_KEEP(init.rodata) \ |
376 | DEV_KEEP(exit.rodata) \ | 374 | DEV_KEEP(exit.rodata) \ |
377 | CPU_KEEP(init.rodata) \ | ||
378 | CPU_KEEP(exit.rodata) \ | ||
379 | MEM_KEEP(init.rodata) \ | 375 | MEM_KEEP(init.rodata) \ |
380 | MEM_KEEP(exit.rodata) \ | 376 | MEM_KEEP(exit.rodata) \ |
381 | } \ | 377 | } \ |
@@ -418,8 +414,6 @@ | |||
418 | *(.ref.text) \ | 414 | *(.ref.text) \ |
419 | DEV_KEEP(init.text) \ | 415 | DEV_KEEP(init.text) \ |
420 | DEV_KEEP(exit.text) \ | 416 | DEV_KEEP(exit.text) \ |
421 | CPU_KEEP(init.text) \ | ||
422 | CPU_KEEP(exit.text) \ | ||
423 | MEM_KEEP(init.text) \ | 417 | MEM_KEEP(init.text) \ |
424 | MEM_KEEP(exit.text) \ | 418 | MEM_KEEP(exit.text) \ |
425 | *(.text.unlikely) | 419 | *(.text.unlikely) |
@@ -504,7 +498,6 @@ | |||
504 | #define INIT_DATA \ | 498 | #define INIT_DATA \ |
505 | *(.init.data) \ | 499 | *(.init.data) \ |
506 | DEV_DISCARD(init.data) \ | 500 | DEV_DISCARD(init.data) \ |
507 | CPU_DISCARD(init.data) \ | ||
508 | MEM_DISCARD(init.data) \ | 501 | MEM_DISCARD(init.data) \ |
509 | KERNEL_CTORS() \ | 502 | KERNEL_CTORS() \ |
510 | MCOUNT_REC() \ | 503 | MCOUNT_REC() \ |
@@ -512,7 +505,6 @@ | |||
512 | FTRACE_EVENTS() \ | 505 | FTRACE_EVENTS() \ |
513 | TRACE_SYSCALLS() \ | 506 | TRACE_SYSCALLS() \ |
514 | DEV_DISCARD(init.rodata) \ | 507 | DEV_DISCARD(init.rodata) \ |
515 | CPU_DISCARD(init.rodata) \ | ||
516 | MEM_DISCARD(init.rodata) \ | 508 | MEM_DISCARD(init.rodata) \ |
517 | CLK_OF_TABLES() \ | 509 | CLK_OF_TABLES() \ |
518 | CLKSRC_OF_TABLES() \ | 510 | CLKSRC_OF_TABLES() \ |
@@ -522,22 +514,18 @@ | |||
522 | #define INIT_TEXT \ | 514 | #define INIT_TEXT \ |
523 | *(.init.text) \ | 515 | *(.init.text) \ |
524 | DEV_DISCARD(init.text) \ | 516 | DEV_DISCARD(init.text) \ |
525 | CPU_DISCARD(init.text) \ | ||
526 | MEM_DISCARD(init.text) | 517 | MEM_DISCARD(init.text) |
527 | 518 | ||
528 | #define EXIT_DATA \ | 519 | #define EXIT_DATA \ |
529 | *(.exit.data) \ | 520 | *(.exit.data) \ |
530 | DEV_DISCARD(exit.data) \ | 521 | DEV_DISCARD(exit.data) \ |
531 | DEV_DISCARD(exit.rodata) \ | 522 | DEV_DISCARD(exit.rodata) \ |
532 | CPU_DISCARD(exit.data) \ | ||
533 | CPU_DISCARD(exit.rodata) \ | ||
534 | MEM_DISCARD(exit.data) \ | 523 | MEM_DISCARD(exit.data) \ |
535 | MEM_DISCARD(exit.rodata) | 524 | MEM_DISCARD(exit.rodata) |
536 | 525 | ||
537 | #define EXIT_TEXT \ | 526 | #define EXIT_TEXT \ |
538 | *(.exit.text) \ | 527 | *(.exit.text) \ |
539 | DEV_DISCARD(exit.text) \ | 528 | DEV_DISCARD(exit.text) \ |
540 | CPU_DISCARD(exit.text) \ | ||
541 | MEM_DISCARD(exit.text) | 529 | MEM_DISCARD(exit.text) |
542 | 530 | ||
543 | #define EXIT_CALL \ | 531 | #define EXIT_CALL \ |
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index a4be8e112bb6..3acbf0803a9b 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c | |||
@@ -861,24 +861,23 @@ static void check_section(const char *modname, struct elf_info *elf, | |||
861 | 861 | ||
862 | 862 | ||
863 | #define ALL_INIT_DATA_SECTIONS \ | 863 | #define ALL_INIT_DATA_SECTIONS \ |
864 | ".init.setup$", ".init.rodata$", \ | 864 | ".init.setup$", ".init.rodata$", ".meminit.rodata$", \ |
865 | ".cpuinit.rodata$", ".meminit.rodata$", \ | 865 | ".init.data$", ".meminit.data$" |
866 | ".init.data$", ".cpuinit.data$", ".meminit.data$" | ||
867 | #define ALL_EXIT_DATA_SECTIONS \ | 866 | #define ALL_EXIT_DATA_SECTIONS \ |
868 | ".exit.data$", ".cpuexit.data$", ".memexit.data$" | 867 | ".exit.data$", ".memexit.data$" |
869 | 868 | ||
870 | #define ALL_INIT_TEXT_SECTIONS \ | 869 | #define ALL_INIT_TEXT_SECTIONS \ |
871 | ".init.text$", ".cpuinit.text$", ".meminit.text$" | 870 | ".init.text$", ".meminit.text$" |
872 | #define ALL_EXIT_TEXT_SECTIONS \ | 871 | #define ALL_EXIT_TEXT_SECTIONS \ |
873 | ".exit.text$", ".cpuexit.text$", ".memexit.text$" | 872 | ".exit.text$", ".memexit.text$" |
874 | 873 | ||
875 | #define ALL_PCI_INIT_SECTIONS \ | 874 | #define ALL_PCI_INIT_SECTIONS \ |
876 | ".pci_fixup_early$", ".pci_fixup_header$", ".pci_fixup_final$", \ | 875 | ".pci_fixup_early$", ".pci_fixup_header$", ".pci_fixup_final$", \ |
877 | ".pci_fixup_enable$", ".pci_fixup_resume$", \ | 876 | ".pci_fixup_enable$", ".pci_fixup_resume$", \ |
878 | ".pci_fixup_resume_early$", ".pci_fixup_suspend$" | 877 | ".pci_fixup_resume_early$", ".pci_fixup_suspend$" |
879 | 878 | ||
880 | #define ALL_XXXINIT_SECTIONS CPU_INIT_SECTIONS, MEM_INIT_SECTIONS | 879 | #define ALL_XXXINIT_SECTIONS MEM_INIT_SECTIONS |
881 | #define ALL_XXXEXIT_SECTIONS CPU_EXIT_SECTIONS, MEM_EXIT_SECTIONS | 880 | #define ALL_XXXEXIT_SECTIONS MEM_EXIT_SECTIONS |
882 | 881 | ||
883 | #define ALL_INIT_SECTIONS INIT_SECTIONS, ALL_XXXINIT_SECTIONS | 882 | #define ALL_INIT_SECTIONS INIT_SECTIONS, ALL_XXXINIT_SECTIONS |
884 | #define ALL_EXIT_SECTIONS EXIT_SECTIONS, ALL_XXXEXIT_SECTIONS | 883 | #define ALL_EXIT_SECTIONS EXIT_SECTIONS, ALL_XXXEXIT_SECTIONS |
@@ -887,11 +886,9 @@ static void check_section(const char *modname, struct elf_info *elf, | |||
887 | #define TEXT_SECTIONS ".text$" | 886 | #define TEXT_SECTIONS ".text$" |
888 | 887 | ||
889 | #define INIT_SECTIONS ".init.*" | 888 | #define INIT_SECTIONS ".init.*" |
890 | #define CPU_INIT_SECTIONS ".cpuinit.*" | ||
891 | #define MEM_INIT_SECTIONS ".meminit.*" | 889 | #define MEM_INIT_SECTIONS ".meminit.*" |
892 | 890 | ||
893 | #define EXIT_SECTIONS ".exit.*" | 891 | #define EXIT_SECTIONS ".exit.*" |
894 | #define CPU_EXIT_SECTIONS ".cpuexit.*" | ||
895 | #define MEM_EXIT_SECTIONS ".memexit.*" | 892 | #define MEM_EXIT_SECTIONS ".memexit.*" |
896 | 893 | ||
897 | /* init data sections */ | 894 | /* init data sections */ |
@@ -979,48 +976,20 @@ const struct sectioncheck sectioncheck[] = { | |||
979 | .mismatch = DATA_TO_ANY_EXIT, | 976 | .mismatch = DATA_TO_ANY_EXIT, |
980 | .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, | 977 | .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, |
981 | }, | 978 | }, |
982 | /* Do not reference init code/data from cpuinit/meminit code/data */ | 979 | /* Do not reference init code/data from meminit code/data */ |
983 | { | 980 | { |
984 | .fromsec = { ALL_XXXINIT_SECTIONS, NULL }, | 981 | .fromsec = { ALL_XXXINIT_SECTIONS, NULL }, |
985 | .tosec = { INIT_SECTIONS, NULL }, | 982 | .tosec = { INIT_SECTIONS, NULL }, |
986 | .mismatch = XXXINIT_TO_SOME_INIT, | 983 | .mismatch = XXXINIT_TO_SOME_INIT, |
987 | .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, | 984 | .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, |
988 | }, | 985 | }, |
989 | /* Do not reference cpuinit code/data from meminit code/data */ | 986 | /* Do not reference exit code/data from memexit code/data */ |
990 | { | ||
991 | .fromsec = { MEM_INIT_SECTIONS, NULL }, | ||
992 | .tosec = { CPU_INIT_SECTIONS, NULL }, | ||
993 | .mismatch = XXXINIT_TO_SOME_INIT, | ||
994 | .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, | ||
995 | }, | ||
996 | /* Do not reference meminit code/data from cpuinit code/data */ | ||
997 | { | ||
998 | .fromsec = { CPU_INIT_SECTIONS, NULL }, | ||
999 | .tosec = { MEM_INIT_SECTIONS, NULL }, | ||
1000 | .mismatch = XXXINIT_TO_SOME_INIT, | ||
1001 | .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, | ||
1002 | }, | ||
1003 | /* Do not reference exit code/data from cpuexit/memexit code/data */ | ||
1004 | { | 987 | { |
1005 | .fromsec = { ALL_XXXEXIT_SECTIONS, NULL }, | 988 | .fromsec = { ALL_XXXEXIT_SECTIONS, NULL }, |
1006 | .tosec = { EXIT_SECTIONS, NULL }, | 989 | .tosec = { EXIT_SECTIONS, NULL }, |
1007 | .mismatch = XXXEXIT_TO_SOME_EXIT, | 990 | .mismatch = XXXEXIT_TO_SOME_EXIT, |
1008 | .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, | 991 | .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, |
1009 | }, | 992 | }, |
1010 | /* Do not reference cpuexit code/data from memexit code/data */ | ||
1011 | { | ||
1012 | .fromsec = { MEM_EXIT_SECTIONS, NULL }, | ||
1013 | .tosec = { CPU_EXIT_SECTIONS, NULL }, | ||
1014 | .mismatch = XXXEXIT_TO_SOME_EXIT, | ||
1015 | .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, | ||
1016 | }, | ||
1017 | /* Do not reference memexit code/data from cpuexit code/data */ | ||
1018 | { | ||
1019 | .fromsec = { CPU_EXIT_SECTIONS, NULL }, | ||
1020 | .tosec = { MEM_EXIT_SECTIONS, NULL }, | ||
1021 | .mismatch = XXXEXIT_TO_SOME_EXIT, | ||
1022 | .symbol_white_list = { DEFAULT_SYMBOL_WHITE_LIST, NULL }, | ||
1023 | }, | ||
1024 | /* Do not use exit code/data from init code */ | 993 | /* Do not use exit code/data from init code */ |
1025 | { | 994 | { |
1026 | .fromsec = { ALL_INIT_SECTIONS, NULL }, | 995 | .fromsec = { ALL_INIT_SECTIONS, NULL }, |
@@ -1089,8 +1058,6 @@ static const struct sectioncheck *section_mismatch( | |||
1089 | * Pattern 2: | 1058 | * Pattern 2: |
1090 | * Many drivers utilise a *driver container with references to | 1059 | * Many drivers utilise a *driver container with references to |
1091 | * add, remove, probe functions etc. | 1060 | * add, remove, probe functions etc. |
1092 | * These functions may often be marked __cpuinit and we do not want to | ||
1093 | * warn here. | ||
1094 | * the pattern is identified by: | 1061 | * the pattern is identified by: |
1095 | * tosec = init or exit section | 1062 | * tosec = init or exit section |
1096 | * fromsec = data section | 1063 | * fromsec = data section |
@@ -1249,7 +1216,6 @@ static Elf_Sym *find_elf_symbol2(struct elf_info *elf, Elf_Addr addr, | |||
1249 | /* | 1216 | /* |
1250 | * Convert a section name to the function/data attribute | 1217 | * Convert a section name to the function/data attribute |
1251 | * .init.text => __init | 1218 | * .init.text => __init |
1252 | * .cpuinit.data => __cpudata | ||
1253 | * .memexitconst => __memconst | 1219 | * .memexitconst => __memconst |
1254 | * etc. | 1220 | * etc. |
1255 | * | 1221 | * |