Skip to content

Commit

Permalink
kbuild: Fix genksyms handling of DEFINE_PER_CPU(struct foo_s *, bar);
Browse files Browse the repository at this point in the history
This is a one-line change to parse.y.
To take advantage of this the scripts/genksyms/*_shipped files needs to
be rebuild - this is the next patch.

When a .c file contains:
DEFINE_PER_CPU(struct foo_s *, bar);

the .cpp output looks like:
__attribute__((__section__(".data.percpu"))) __typeof__(struct foo_s *) per_cpu__bar;

With the existing parse.y, the value inside the paranthesis of
__typeof__() does not evaluate as a type_specifier and therefore
per_cpu__bar does not get assigned a type for genksyms which results in
the EXPORT_PER_CPU_SYMBOL() not generating a CRC value.

I have compared the Modules.symvers with and without this
patch and for ia64's defconfig, the only change is:
Before 0x00000000    per_cpu____sn_nodepda   vmlinux
After  0x9d3f3faa    per_cpu____sn_nodepda   vmlinux

per_cpu____sn_nodepda was the original source of my problems.

Signed-off-by: Robin Holt <holt@sgi.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
  • Loading branch information
Robin Holt authored and Sam Ravnborg committed Dec 26, 2005
1 parent f83b5e3 commit a89a0a2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions scripts/genksyms/parse.y
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,7 @@ storage_class_specifier:
type_specifier:
simple_type_specifier
| cvar_qualifier
| TYPEOF_KEYW '(' decl_specifier_seq '*' ')'
| TYPEOF_KEYW '(' decl_specifier_seq ')'

/* References to s/u/e's defined elsewhere. Rearrange things
Expand Down

0 comments on commit a89a0a2

Please sign in to comment.