kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* why a static function is in kernel symbol table
@ 2014-06-13  7:10 Ji
  2014-06-14  2:54 ` Ji Li
  0 siblings, 1 reply; 4+ messages in thread
From: Ji @ 2014-06-13  7:10 UTC (permalink / raw)
  To: kernelnewbies

Thank you very much for replying.

I actually notice that there are many static functions in that file. However, some of them show up in symbol table, the rest do not. So  what you are saying is that there is no connection between being a static function and showing up in kernel symbol table. Then what causes the difference appearing in symbol table or not? In other word, if i add a new static function and like it in kallsyms, what should I do?

Thanks,
Ji

-----Original Message-----
From: "Valdis.Kletnieks@vt.edu" <Valdis.Kletnieks@vt.edu>
Sent: ?6/?12/?2014 8:47 PM
To: "Ji Li" <lijimlee@gmail.com>
Cc: "Kernelnewbies at kernelnewbies.org" <Kernelnewbies@kernelnewbies.org>
Subject: Re: why a static function is in kernel symbol table

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...

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140613/9732cc25/attachment.html 

^ permalink raw reply	[flat|nested] 4+ messages in thread
* why a static function is in kernel symbol table
@ 2014-06-12 23:23 Ji Li
  2014-06-13  3:47 ` Valdis.Kletnieks at vt.edu
  0 siblings, 1 reply; 4+ messages in thread
From: Ji Li @ 2014-06-12 23:23 UTC (permalink / raw)
  To: kernelnewbies

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-06-14  2:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-13  7:10 why a static function is in kernel symbol table Ji
2014-06-14  2:54 ` Ji Li
  -- strict thread matches above, loose matches on Subject: below --
2014-06-12 23:23 Ji Li
2014-06-13  3:47 ` Valdis.Kletnieks at vt.edu

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).