* Question: "genksyms: Track changes to enum constants" doesn't work
@ 2015-03-11 4:24 shengyong
2015-03-12 8:17 ` Michal Marek
0 siblings, 1 reply; 2+ messages in thread
From: shengyong @ 2015-03-11 4:24 UTC (permalink / raw)
To: mmarek; +Cc: linux-kbuild, sam
Hi, Michal Marek
The commit e37ddb8250 ("genksyms: Track changes to enum constants") helps to changes the
checksum of export symbol if an enum is changed. I test this agains linux-next, but it
seems that it does not work well.
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
enum a {
E1,
E2,
E_MAX
};
struct s {
int a[E_MAX];
};
int test(struct s *s)
{
s->a[E2] = 0;
return 0;
}
EXPORT_SYMBOL(test);
static int __init hello_init(void) { return 0; }
static void __exit hello_exit(void) { return; }
module_init(hello_init);
module_exit(hello_exit);
After compiled, I get:
$ cat Module.symvers
*0xb6ca7216* test /home/test/module/hello EXPORT_SYMBOL
Then add an "E3" in the enum:
enum a {
E1,
E2,
+ E3,
E_MAX
};
After compiled, I still get:
$ cat Module.symvers
*0xb6ca7216* test /home/test/module/hello EXPORT_SYMBOL
Anything wrong with my test?
thanks,
Sheng
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Question: "genksyms: Track changes to enum constants" doesn't work
2015-03-11 4:24 Question: "genksyms: Track changes to enum constants" doesn't work shengyong
@ 2015-03-12 8:17 ` Michal Marek
0 siblings, 0 replies; 2+ messages in thread
From: Michal Marek @ 2015-03-12 8:17 UTC (permalink / raw)
To: shengyong; +Cc: linux-kbuild, sam
Dne 11.3.2015 v 05:24 shengyong napsal(a):
> Hi, Michal Marek
>
> The commit e37ddb8250 ("genksyms: Track changes to enum constants") helps to changes the
> checksum of export symbol if an enum is changed. I test this agains linux-next, but it
> seems that it does not work well.
>
> #include <linux/module.h>
> #include <linux/kernel.h>
> #include <linux/init.h>
>
> enum a {
> E1,
> E2,
> E_MAX
> };
>
> struct s {
> int a[E_MAX];
> };
What you are seeing is the effect of commit 2c5925d ("genksyms: Do not
expand internal types"). You need to move the type definitions to a
header for these to be considered by genksyms.
Michal
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-03-12 8:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-11 4:24 Question: "genksyms: Track changes to enum constants" doesn't work shengyong
2015-03-12 8:17 ` Michal Marek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).