Skip to content

Commit

Permalink
modpost: fix bogus 'exported twice' warnings.
Browse files Browse the repository at this point in the history
Andi's change in e0f244c ("asmlinkage, module: Make ksymtab and
kcrctab symbols and __this_module __visible") make the crc appear
first in the symbol table.

modpost creates an entry when it sees the CRC, then when it sees the
actual symbol, it complains that it's seen it before.  The preloaded
flag already exists for the equivalent case where we loaded from
Module.symvers, so use that.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Tested-by: The Awesome Power Of linux-next
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
  • Loading branch information
Rusty Russell committed Nov 7, 2013
1 parent 08746a6 commit b6568b1
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/mod/modpost.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ struct symbol {
unsigned int vmlinux:1; /* 1 if symbol is defined in vmlinux */
unsigned int kernel:1; /* 1 if symbol is from kernel
* (only for external modules) **/
unsigned int preloaded:1; /* 1 if symbol from Module.symvers */
unsigned int preloaded:1; /* 1 if symbol from Module.symvers, or crc */
enum export export; /* Type of export */
char name[0];
};
Expand Down Expand Up @@ -332,8 +332,11 @@ static void sym_update_crc(const char *name, struct module *mod,
{
struct symbol *s = find_symbol(name);

if (!s)
if (!s) {
s = new_symbol(name, mod, export);
/* Don't complain when we find it later. */
s->preloaded = 1;
}
s->crc = crc;
s->crc_valid = 1;
}
Expand Down

0 comments on commit b6568b1

Please sign in to comment.