Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 149515
b: refs/heads/master
c: fd6c3a8
h: refs/heads/master
i:
  149513: bc130e9
  149511: ab45910
v: v3
  • Loading branch information
Jan Beulich authored and Sam Ravnborg committed Jun 9, 2009
1 parent d5cdf3c commit ba088f1
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6d9923219c6cd1df360f8823253717623f3ad348
refs/heads/master: fd6c3a8dc44329d3aff9a578b5120982f63711ee
5 changes: 3 additions & 2 deletions trunk/include/asm-generic/vmlinux.lds.h
Original file line number Diff line number Diff line change
Expand Up @@ -336,10 +336,11 @@
#define INIT_DATA \
*(.init.data) \
DEV_DISCARD(init.data) \
DEV_DISCARD(init.rodata) \
CPU_DISCARD(init.data) \
CPU_DISCARD(init.rodata) \
MEM_DISCARD(init.data) \
*(.init.rodata) \
DEV_DISCARD(init.rodata) \
CPU_DISCARD(init.rodata) \
MEM_DISCARD(init.rodata)

#define INIT_TEXT \
Expand Down
3 changes: 2 additions & 1 deletion trunk/include/linux/init.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,8 @@ struct obs_kernel_param {
* obs_kernel_param "array" too far apart in .init.setup.
*/
#define __setup_param(str, unique_id, fn, early) \
static char __setup_str_##unique_id[] __initdata __aligned(1) = str; \
static const char __setup_str_##unique_id[] __initconst \
__aligned(1) = str; \
static struct obs_kernel_param __setup_##unique_id \
__used __section(.init.setup) \
__attribute__((aligned((sizeof(long))))) \
Expand Down
48 changes: 38 additions & 10 deletions trunk/scripts/mod/modpost.c
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,8 @@ static void check_section(const char *modname, struct elf_info *elf,


#define ALL_INIT_DATA_SECTIONS \
".init.setup$", ".init.rodata$", \
".devinit.rodata$", ".cpuinit.rodata$", ".meminit.rodata$" \
".init.data$", ".devinit.data$", ".cpuinit.data$", ".meminit.data$"
#define ALL_EXIT_DATA_SECTIONS \
".exit.data$", ".devexit.data$", ".cpuexit.data$", ".memexit.data$"
Expand All @@ -772,21 +774,23 @@ static void check_section(const char *modname, struct elf_info *elf,
#define ALL_EXIT_TEXT_SECTIONS \
".exit.text$", ".devexit.text$", ".cpuexit.text$", ".memexit.text$"

#define ALL_INIT_SECTIONS ALL_INIT_DATA_SECTIONS, ALL_INIT_TEXT_SECTIONS
#define ALL_EXIT_SECTIONS ALL_EXIT_DATA_SECTIONS, ALL_EXIT_TEXT_SECTIONS
#define ALL_INIT_SECTIONS INIT_SECTIONS, DEV_INIT_SECTIONS, \
CPU_INIT_SECTIONS, MEM_INIT_SECTIONS
#define ALL_EXIT_SECTIONS EXIT_SECTIONS, DEV_EXIT_SECTIONS, \
CPU_EXIT_SECTIONS, MEM_EXIT_SECTIONS

#define DATA_SECTIONS ".data$", ".data.rel$"
#define TEXT_SECTIONS ".text$"

#define INIT_SECTIONS ".init.data$", ".init.text$"
#define DEV_INIT_SECTIONS ".devinit.data$", ".devinit.text$"
#define CPU_INIT_SECTIONS ".cpuinit.data$", ".cpuinit.text$"
#define MEM_INIT_SECTIONS ".meminit.data$", ".meminit.text$"
#define INIT_SECTIONS ".init.*"
#define DEV_INIT_SECTIONS ".devinit.*"
#define CPU_INIT_SECTIONS ".cpuinit.*"
#define MEM_INIT_SECTIONS ".meminit.*"

#define EXIT_SECTIONS ".exit.data$", ".exit.text$"
#define DEV_EXIT_SECTIONS ".devexit.data$", ".devexit.text$"
#define CPU_EXIT_SECTIONS ".cpuexit.data$", ".cpuexit.text$"
#define MEM_EXIT_SECTIONS ".memexit.data$", ".memexit.text$"
#define EXIT_SECTIONS ".exit.*"
#define DEV_EXIT_SECTIONS ".devexit.*"
#define CPU_EXIT_SECTIONS ".cpuexit.*"
#define MEM_EXIT_SECTIONS ".memexit.*"

/* init data sections */
static const char *init_data_sections[] = { ALL_INIT_DATA_SECTIONS, NULL };
Expand Down Expand Up @@ -869,12 +873,36 @@ const struct sectioncheck sectioncheck[] = {
.tosec = { INIT_SECTIONS, NULL },
.mismatch = XXXINIT_TO_INIT,
},
/* Do not reference cpuinit code/data from meminit code/data */
{
.fromsec = { MEM_INIT_SECTIONS, NULL },
.tosec = { CPU_INIT_SECTIONS, NULL },
.mismatch = XXXINIT_TO_INIT,
},
/* Do not reference meminit code/data from cpuinit code/data */
{
.fromsec = { CPU_INIT_SECTIONS, NULL },
.tosec = { MEM_INIT_SECTIONS, NULL },
.mismatch = XXXINIT_TO_INIT,
},
/* Do not reference exit code/data from devexit/cpuexit/memexit code/data */
{
.fromsec = { DEV_EXIT_SECTIONS, CPU_EXIT_SECTIONS, MEM_EXIT_SECTIONS, NULL },
.tosec = { EXIT_SECTIONS, NULL },
.mismatch = XXXEXIT_TO_EXIT,
},
/* Do not reference cpuexit code/data from memexit code/data */
{
.fromsec = { MEM_EXIT_SECTIONS, NULL },
.tosec = { CPU_EXIT_SECTIONS, NULL },
.mismatch = XXXEXIT_TO_EXIT,
},
/* Do not reference memexit code/data from cpuexit code/data */
{
.fromsec = { CPU_EXIT_SECTIONS, NULL },
.tosec = { MEM_EXIT_SECTIONS, NULL },
.mismatch = XXXEXIT_TO_EXIT,
},
/* Do not use exit code/data from init code */
{
.fromsec = { ALL_INIT_SECTIONS, NULL },
Expand Down

0 comments on commit ba088f1

Please sign in to comment.