Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 258114
b: refs/heads/master
c: 62a2635
h: refs/heads/master
v: v3
  • Loading branch information
Alessio Igor Bogani authored and Rusty Russell committed Jul 24, 2011
1 parent 92a6d0b commit eea1e90
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 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: 88bfa3247961fe5f3623f4d2cf1cd5dc72457598
refs/heads/master: 62a2635610dbc83c5e8d724e00941eee4d18c186
29 changes: 28 additions & 1 deletion trunk/scripts/mod/modpost.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,28 @@ static enum export export_no(const char *s)
return export_unknown;
}

static const char *sec_name(struct elf_info *elf, int secindex);

#define strstarts(str, prefix) (strncmp(str, prefix, strlen(prefix)) == 0)

static enum export export_from_secname(struct elf_info *elf, unsigned int sec)
{
const char *secname = sec_name(elf, sec);

if (strstarts(secname, "___ksymtab+"))
return export_plain;
else if (strstarts(secname, "___ksymtab_unused+"))
return export_unused;
else if (strstarts(secname, "___ksymtab_gpl+"))
return export_gpl;
else if (strstarts(secname, "___ksymtab_unused_gpl+"))
return export_unused_gpl;
else if (strstarts(secname, "___ksymtab_gpl_future+"))
return export_gpl_future;
else
return export_unknown;
}

static enum export export_from_sec(struct elf_info *elf, unsigned int sec)
{
if (sec == elf->export_sec)
Expand Down Expand Up @@ -563,7 +585,12 @@ static void handle_modversions(struct module *mod, struct elf_info *info,
Elf_Sym *sym, const char *symname)
{
unsigned int crc;
enum export export = export_from_sec(info, get_secindex(info, sym));
enum export export;

if (!is_vmlinux(mod->name) && strncmp(symname, "__ksymtab", 9) == 0)
export = export_from_secname(info, get_secindex(info, sym));
else
export = export_from_sec(info, get_secindex(info, sym));

switch (sym->st_shndx) {
case SHN_COMMON:
Expand Down

0 comments on commit eea1e90

Please sign in to comment.