Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 62924
b: refs/heads/master
c: 2f5ee61
h: refs/heads/master
v: v3
  • Loading branch information
Sam Ravnborg committed Jul 25, 2007
1 parent 199d820 commit fd49061
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 33 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: 114f51577724b782a30f4f5ceaee9880de93d776
refs/heads/master: 2f5ee619045d923de9137b6a263a99cc2428391a
80 changes: 48 additions & 32 deletions trunk/scripts/mod/modpost.c
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,54 @@ static int strrcmp(const char *s, const char *sub)
return memcmp(s + slen - sublen, sub, sublen);
}

/*
* Functions used only during module init is marked __init and is stored in
* a .init.text section. Likewise data is marked __initdata and stored in
* a .init.data section.
* If this section is one of these sections return 1
* See include/linux/init.h for the details
*/
static int init_section(const char *name)
{
if (strcmp(name, ".init") == 0)
return 1;
if (strncmp(name, ".init.", strlen(".init.")) == 0)
return 1;
return 0;
}

/*
* Functions used only during module exit is marked __exit and is stored in
* a .exit.text section. Likewise data is marked __exitdata and stored in
* a .exit.data section.
* If this section is one of these sections return 1
* See include/linux/init.h for the details
**/
static int exit_section(const char *name)
{
if (strcmp(name, ".exit.text") == 0)
return 1;
if (strcmp(name, ".exit.data") == 0)
return 1;
return 0;

}

/*
* Data sections are named like this:
* .data | .data.rel | .data.rel.*
* Return 1 if the specified section is a data section
*/
static int data_section(const char *name)
{
if ((strcmp(name, ".data") == 0) ||
(strcmp(name, ".data.rel") == 0) ||
(strncmp(name, ".data.rel.", strlen(".data.rel.")) == 0))
return 1;
else
return 0;
}

/**
* Whitelist to allow certain references to pass with no warning.
*
Expand Down Expand Up @@ -1108,21 +1156,6 @@ static int initexit_section_ref_ok(const char *name)
return 0;
}

/**
* Functions used only during module init is marked __init and is stored in
* a .init.text section. Likewise data is marked __initdata and stored in
* a .init.data section.
* If this section is one of these sections return 1
* See include/linux/init.h for the details
**/
static int init_section(const char *name)
{
if (strcmp(name, ".init") == 0)
return 1;
if (strncmp(name, ".init.", strlen(".init.")) == 0)
return 1;
return 0;
}

/*
* Identify sections from which references to a .init section is OK.
Expand Down Expand Up @@ -1179,23 +1212,6 @@ static int init_section_ref_ok(const char *name)
return 0;
}

/*
* Functions used only during module exit is marked __exit and is stored in
* a .exit.text section. Likewise data is marked __exitdata and stored in
* a .exit.data section.
* If this section is one of these sections return 1
* See include/linux/init.h for the details
**/
static int exit_section(const char *name)
{
if (strcmp(name, ".exit.text") == 0)
return 1;
if (strcmp(name, ".exit.data") == 0)
return 1;
return 0;

}

/*
* Identify sections from which references to a .exit section is OK.
*/
Expand Down

0 comments on commit fd49061

Please sign in to comment.