public inbox for linux-kbuild@vger.kernel.org
 help / color / mirror / Atom feed
* 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

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