<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/scripts/genksyms, branch v4.8-rc6</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>scripts: genksyms: fix resource leak</title>
<updated>2016-04-20T07:24:49+00:00</updated>
<author>
<name>Maxim Zhukov</name>
<email>mussitantesmortem@gmail.com</email>
</author>
<published>2016-04-12T20:54:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4deaaa4deb0f9c42452711aa0a4b9c27016ca2f0'/>
<id>4deaaa4deb0f9c42452711aa0a4b9c27016ca2f0</id>
<content type='text'>
This commit fixed resource leak at func main

Signed-off-by: Maxim Zhukov &lt;mussitantesmortem@gmail.com&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit fixed resource leak at func main

Signed-off-by: Maxim Zhukov &lt;mussitantesmortem@gmail.com&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>genksyms: Handle string literals with spaces in reference files</title>
<updated>2015-12-09T14:19:23+00:00</updated>
<author>
<name>Michal Marek</name>
<email>mmarek@suse.com</email>
</author>
<published>2015-12-09T14:08:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a78f70e8d65e88b9f631d073f68cb26dcd746298'/>
<id>a78f70e8d65e88b9f631d073f68cb26dcd746298</id>
<content type='text'>
The reference files use spaces to separate tokens, however, we must
preserve spaces inside string literals. Currently the only case in the
tree is struct edac_raw_error_desc in &lt;linux/edac.h&gt;:

$ KBUILD_SYMTYPES=1 make -s drivers/edac/amd64_edac.symtypes
$ mv drivers/edac/amd64_edac.{symtypes,symref}
$ KBUILD_SYMTYPES=1 make -s drivers/edac/amd64_edac.symtypes
drivers/edac/amd64_edac.c:527: warning: amd64_get_dram_hole_info: modversion changed because of changes in struct edac_raw_error_desc

Signed-off-by: Michal Marek &lt;mmarek@suse.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The reference files use spaces to separate tokens, however, we must
preserve spaces inside string literals. Currently the only case in the
tree is struct edac_raw_error_desc in &lt;linux/edac.h&gt;:

$ KBUILD_SYMTYPES=1 make -s drivers/edac/amd64_edac.symtypes
$ mv drivers/edac/amd64_edac.{symtypes,symref}
$ KBUILD_SYMTYPES=1 make -s drivers/edac/amd64_edac.symtypes
drivers/edac/amd64_edac.c:527: warning: amd64_get_dram_hole_info: modversion changed because of changes in struct edac_raw_error_desc

Signed-off-by: Michal Marek &lt;mmarek@suse.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>genksyms: Regenerate parser</title>
<updated>2015-08-20T12:57:47+00:00</updated>
<author>
<name>Michal Marek</name>
<email>mmarek@suse.com</email>
</author>
<published>2015-08-20T12:13:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5b733faca671756dd41b7e24584374e2b1fc3c4d'/>
<id>5b733faca671756dd41b7e24584374e2b1fc3c4d</id>
<content type='text'>
Rebuild the parser after commit 1c722503fa81 (genksyms: Duplicate
function pointer type definitions segfault), using bison 2.7.

Signed-off-by: Michal Marek &lt;mmarek@suse.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Rebuild the parser after commit 1c722503fa81 (genksyms: Duplicate
function pointer type definitions segfault), using bison 2.7.

Signed-off-by: Michal Marek &lt;mmarek@suse.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>genksyms: Duplicate function pointer type definitions segfault</title>
<updated>2015-08-20T12:55:55+00:00</updated>
<author>
<name>Richard Yao</name>
<email>richard.yao@clusterhq.com</email>
</author>
<published>2015-07-20T23:52:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=1c722503fa81888c936a8d1a5052daec859f1a7c'/>
<id>1c722503fa81888c936a8d1a5052daec859f1a7c</id>
<content type='text'>
I noticed that genksyms will segfault when it sees duplicate function
pointer type declaration when I placed the same function pointer
definition in two separate headers in a local branch as an intermediate
step of some refactoring. This can be reproduced by piping the following
minimal test case into `genksyms -r /dev/null` or alternatively, putting
it into a C file attempting a build:

typedef int (*f)();
typedef int (*f)();

Attaching gdb to genksyms to understand this failure is useless without
changing CFLAGS to emit debuginfo. Once you have debuginfo, you will
find that the failure is that `char *s` was NULL and the program
executed `while(*s)`. At which point, further debugging requires
familiarity with compiler front end / parser development.

What happens is that flex identifies the first instance of the token "f"
as IDENT and the yacc parser adds it to the symbol table. On the second
instance, flex will identify "f" as TYPE, which triggers an error case
in the yacc parser. Given that TYPE would have been IDENT had it not
been in the symbol table, the the segmentaion fault could be avoided by
treating TYPE as IDENT in the affected rule.

Some might consider placing identical function pointer type declarations
in different headers to be poor style might consider a failure to be
beneficial. However, failing through a segmentation fault makes the
cause non-obvious and can waste the time of anyone who encounters it.

Signed-off-by: Richard Yao &lt;richard.yao@clusterhq.com&gt;
Acked-by: Madhuri Yechuri &lt;madhuriyechuri@clusterhq.com&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I noticed that genksyms will segfault when it sees duplicate function
pointer type declaration when I placed the same function pointer
definition in two separate headers in a local branch as an intermediate
step of some refactoring. This can be reproduced by piping the following
minimal test case into `genksyms -r /dev/null` or alternatively, putting
it into a C file attempting a build:

typedef int (*f)();
typedef int (*f)();

Attaching gdb to genksyms to understand this failure is useless without
changing CFLAGS to emit debuginfo. Once you have debuginfo, you will
find that the failure is that `char *s` was NULL and the program
executed `while(*s)`. At which point, further debugging requires
familiarity with compiler front end / parser development.

What happens is that flex identifies the first instance of the token "f"
as IDENT and the yacc parser adds it to the symbol table. On the second
instance, flex will identify "f" as TYPE, which triggers an error case
in the yacc parser. Given that TYPE would have been IDENT had it not
been in the symbol table, the the segmentaion fault could be avoided by
treating TYPE as IDENT in the affected rule.

Some might consider placing identical function pointer type declarations
in different headers to be poor style might consider a failure to be
beneficial. However, failing through a segmentation fault makes the
cause non-obvious and can waste the time of anyone who encounters it.

Signed-off-by: Richard Yao &lt;richard.yao@clusterhq.com&gt;
Acked-by: Madhuri Yechuri &lt;madhuriyechuri@clusterhq.com&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>genksyms: fix typeof() handling</title>
<updated>2014-04-03T23:20:52+00:00</updated>
<author>
<name>Jan Beulich</name>
<email>JBeulich@suse.com</email>
</author>
<published>2014-04-03T21:46:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=dc53324060f324e8af6867f57bf4891c13c6ef18'/>
<id>dc53324060f324e8af6867f57bf4891c13c6ef18</id>
<content type='text'>
Recent increased use of typeof() throughout the tree resulted in a
number of symbols (25 in a typical distro config of ours) not getting a
proper CRC calculated for them anymore, due to the parser in genksyms
not coping with several of these uses (interestingly in the majority of
[if not all] cases the problem is due to the use of typeof() in code
preceding a certain export, not in the declaration/definition of the
exported function/object itself; I wasn't able to find a way to address
this more general parser shortcoming).

The use of parameter_declaration is a little more relaxed than would be
ideal (permitting not just a bare type specification, but also one with
identifier), but since the same code is being passed through an actual
compiler, there's no apparent risk of allowing through any broken code.

Otoh using parameter_declaration instead of the ad hoc
"decl_specifier_seq '*'" / "decl_specifier_seq" pair allows all types to
be handled rather than just plain ones and pointers to plain ones.

Signed-off-by: Jan Beulich &lt;jbeulich@suse.com&gt;
Cc: Michal Marek &lt;mmarek@suse.cz&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Recent increased use of typeof() throughout the tree resulted in a
number of symbols (25 in a typical distro config of ours) not getting a
proper CRC calculated for them anymore, due to the parser in genksyms
not coping with several of these uses (interestingly in the majority of
[if not all] cases the problem is due to the use of typeof() in code
preceding a certain export, not in the declaration/definition of the
exported function/object itself; I wasn't able to find a way to address
this more general parser shortcoming).

The use of parameter_declaration is a little more relaxed than would be
ideal (permitting not just a bare type specification, but also one with
identifier), but since the same code is being passed through an actual
compiler, there's no apparent risk of allowing through any broken code.

Otoh using parameter_declaration instead of the ad hoc
"decl_specifier_seq '*'" / "decl_specifier_seq" pair allows all types to
be handled rather than just plain ones and pointers to plain ones.

Signed-off-by: Jan Beulich &lt;jbeulich@suse.com&gt;
Cc: Michal Marek &lt;mmarek@suse.cz&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>genksyms: pass symbol-prefix instead of arch</title>
<updated>2013-03-20T00:57:27+00:00</updated>
<author>
<name>James Hogan</name>
<email>james.hogan@imgtec.com</email>
</author>
<published>2013-03-18T09:08:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d70f82acf32affa78ae4957caa0fb2a550d2c6ea'/>
<id>d70f82acf32affa78ae4957caa0fb2a550d2c6ea</id>
<content type='text'>
Pass symbol-prefix to genksyms instead of arch, so that the decision
what symbol prefix to use is kept in one place.

Basically genksyms used to take a -a $ARCH argument and it used that to
determine whether to add an underscore symbol prefix. It's now changed
to take a -s $SYMBOL_PREFIX argument so that the caller decides whether
a symbol prefix is required. The build system then uses
CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX to determine whether to pass the
argument.

Signed-off-by: James Hogan &lt;james.hogan@imgtec.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pass symbol-prefix to genksyms instead of arch, so that the decision
what symbol prefix to use is kept in one place.

Basically genksyms used to take a -a $ARCH argument and it used that to
determine whether to add an underscore symbol prefix. It's now changed
to take a -s $SYMBOL_PREFIX argument so that the caller decides whether
a symbol prefix is required. The build system then uses
CONFIG_HAVE_UNDERSCORE_SYMBOL_PREFIX to determine whether to pass the
argument.

Signed-off-by: James Hogan &lt;james.hogan@imgtec.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>genksyms: fix metag symbol prefix on crc symbols</title>
<updated>2013-03-02T20:11:13+00:00</updated>
<author>
<name>James Hogan</name>
<email>james.hogan@imgtec.com</email>
</author>
<published>2013-02-11T15:40:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=97c3ec63089fdcd2abf66619b913900909841dc0'/>
<id>97c3ec63089fdcd2abf66619b913900909841dc0</id>
<content type='text'>
Meta uses symbol prefixes, so add "metag" to the list of architectures
to set the mod_prefix to "_" for. This fixes __crc_* symbols to add the
extra underscore to match _CRC_SYMBOL macro in &lt;linux/export.h&gt; and so
that modpost finds them.

Signed-off-by: James Hogan &lt;james.hogan@imgtec.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Meta uses symbol prefixes, so add "metag" to the list of architectures
to set the mod_prefix to "_" for. This fixes __crc_* symbols to add the
extra underscore to match _CRC_SYMBOL macro in &lt;linux/export.h&gt; and so
that modpost finds them.

Signed-off-by: James Hogan &lt;james.hogan@imgtec.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scripts/genksyms: clean lex/yacc generated files</title>
<updated>2012-01-08T13:48:15+00:00</updated>
<author>
<name>Fernando Luis Vázquez Cao</name>
<email>fernando@oss.ntt.co.jp</email>
</author>
<published>2011-12-12T03:17:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=603d8c0adb0f7576f92fc435c69be9406dc60762'/>
<id>603d8c0adb0f7576f92fc435c69be9406dc60762</id>
<content type='text'>
Add "keywords.hash.c", "lex.lex.c", "parse.tab.c" and "parse.tab.h" to
clean-list so that they get automagically deleted at clean/mrproper
time.

Signed-off-by: Fernando Luis Vazquez Cao&lt;fernando@oss.ntt.co.jp&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.cz&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add "keywords.hash.c", "lex.lex.c", "parse.tab.c" and "parse.tab.h" to
clean-list so that they get automagically deleted at clean/mrproper
time.

Signed-off-by: Fernando Luis Vazquez Cao&lt;fernando@oss.ntt.co.jp&gt;
Signed-off-by: Michal Marek &lt;mmarek@suse.cz&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>genksyms: Regenerate lexer and parser</title>
<updated>2011-10-11T10:07:05+00:00</updated>
<author>
<name>Michal Marek</name>
<email>mmarek@suse.cz</email>
</author>
<published>2011-10-11T10:07:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0359de7dd501f694f01b61364c9b633eab41f494'/>
<id>0359de7dd501f694f01b61364c9b633eab41f494</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>genksyms: Do not expand internal types</title>
<updated>2011-10-11T10:00:39+00:00</updated>
<author>
<name>Michal Marek</name>
<email>mmarek@suse.cz</email>
</author>
<published>2011-10-07T23:18:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2c5925d6b7fedc8f1c325f4f85451f505ec69aca'/>
<id>2c5925d6b7fedc8f1c325f4f85451f505ec69aca</id>
<content type='text'>
Consider structures, unions and enums defined in the source file as
internal and do not expand them. This way, changes to e.g. struct
serial_private in drivers/tty/serial/8250_pci.c will not affect the
checksum of the pciserial_* exports.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Consider structures, unions and enums defined in the source file as
internal and do not expand them. This way, changes to e.g. struct
serial_private in drivers/tty/serial/8250_pci.c will not affect the
checksum of the pciserial_* exports.
</pre>
</div>
</content>
</entry>
</feed>
