why a static function is in kernel symbol table
Hi all, I happened to find that a static function show up in kernel symbol table: static bool tcp_write_xmit(struct sock *sk, unsigned int mss_now, int nonagle, int push_one, gfp_t gfp); I feel puzzled. The only difference between this function with other static functions in net/ipv4/tcp_output.c is that tcp_write_xmit is declared at the very beginning of the file. However, I tried putting declaration of another static function in front of tcp_write_xmit, but it still did not show up in newly compiled vmlinux. Could anyone kindly cast some light? Thanks Ji
On Thu, 12 Jun 2014 16:23:58 -0700, Ji Li said:
I happened to find that a static function show up in kernel symbol table:
Could anyone kindly cast some light?
Hint: 'static' prevents code in other compilation units (basically, other .c files) from referencing it directly (though they can still access it via a function pointer variable or other similar tricks). That does *not* mean that other code in the *same* compilation unit can't reference the static function in a way that requires a symbol table entry...
participants (2)
-
Ji Li -
Valdis.Kletnieks@vt.edu