Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 61837
b: refs/heads/master
c: 1d8af55
h: refs/heads/master
i:
  61835: 28fca5c
v: v3
  • Loading branch information
Sam Ravnborg committed Jul 16, 2007
1 parent d63e1e8 commit d4c37a6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 26 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: 1087247b7d8f1938425906d2ac983df76c6dcc18
refs/heads/master: 1d8af559f9ffd6847856f74658e501ed7ded9f01
32 changes: 7 additions & 25 deletions trunk/scripts/mod/modpost.c
Original file line number Diff line number Diff line change
Expand Up @@ -612,14 +612,10 @@ static int strrcmp(const char *s, const char *sub)
* atsym = *driver, *_template, *_sht, *_ops, *_probe, *probe_one, *_console
*
* Pattern 3:
* Whitelist all references from .pci_fixup* section to .init.text
* This is part of the PCI init when built-in
*
* Pattern 4:
* Whitelist all refereces from .text.head to .init.data
* Whitelist all refereces from .text.head to .init.text
*
* Pattern 5:
* Pattern 4:
* Some symbols belong to init section but still it is ok to reference
* these from non-init sections as these symbols don't have any memory
* allocated for them and symbol address and value are same. So even
Expand All @@ -628,20 +624,14 @@ static int strrcmp(const char *s, const char *sub)
* This pattern is identified by
* refsymname = __init_begin, _sinittext, _einittext
*
* Pattern 7:
* Pattern 5:
* Logos used in drivers/video/logo reside in __initdata but the
* funtion that references them are EXPORT_SYMBOL() so cannot be
* marker __init. So we whitelist them here.
* The pattern is:
* tosec = .init.data
* fromsec = .text*
* refsymname = logo_
*
* Pattern 10:
* ia64 has machvec table for each platform and
* powerpc has a machine desc table for each platform.
* It is mixture of function pointers of .init.text and .text.
* fromsec = .machvec | .machine.desc
**/
static int secref_whitelist(const char *modname, const char *tosec,
const char *fromsec, const char *atsym,
Expand Down Expand Up @@ -699,32 +689,22 @@ static int secref_whitelist(const char *modname, const char *tosec,
return 1;

/* Check for pattern 3 */
if ((strncmp(fromsec, ".pci_fixup", strlen(".pci_fixup")) == 0) &&
(strcmp(tosec, ".init.text") == 0))
return 1;

/* Check for pattern 4 */
if ((strcmp(fromsec, ".text.head") == 0) &&
((strcmp(tosec, ".init.data") == 0) ||
(strcmp(tosec, ".init.text") == 0)))
return 1;

/* Check for pattern 5 */
/* Check for pattern 4 */
for (s = pat3refsym; *s; s++)
if (strcmp(refsymname, *s) == 0)
return 1;

/* Check for pattern 7 */
/* Check for pattern 5 */
if ((strcmp(tosec, ".init.data") == 0) &&
(strncmp(fromsec, ".text", strlen(".text")) == 0) &&
(strncmp(refsymname, "logo_", strlen("logo_")) == 0))
return 1;

/* Check for pattern 10 */
if ((strcmp(fromsec, ".machvec") == 0) ||
(strcmp(fromsec, ".machine.desc") == 0))
return 1;

return 0;
}

Expand Down Expand Up @@ -1088,7 +1068,7 @@ static void check_sec_ref(struct module *mod, const char *modname,
* section, not the ia64 .opd section.
* ia64 .opd should not point to discarded sections.
* [.rodata] like for .init.text we ignore .rodata references -same reason
**/
*/
static int initexit_section_ref_ok(const char *name)
{
const char **s;
Expand All @@ -1099,6 +1079,8 @@ static int initexit_section_ref_ok(const char *name)
".altinstructions",
".cranges", /* used by sh64 */
".fixup",
".machvec", /* ia64 + powerpc uses these */
".machine.desc",
".opd", /* See comment [OPD] */
".parainstructions",
".pdr",
Expand Down

0 comments on commit d4c37a6

Please sign in to comment.