public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Nicholas Mc Guire <der.herr@hofr.at>
To: Martin Faltesek <martin.faltesek@gmail.com>
Cc: gcc-help@gcc.gnu.org
Subject: Re: static functions appearing in the symbol table
Date: Mon, 24 Aug 2015 08:37:00 -0000	[thread overview]
Message-ID: <20150824083737.GA28523@opentech.at> (raw)
In-Reply-To: <CADvosSgNoJsa6Qh6P1pmwgxmSSw5AkXwhJn3bwi3yVX3n=GqTw@mail.gmail.com>

On Sun, 23 Aug 2015, Martin Faltesek wrote:

> While using gcc, I've noticed that some static functions appear in the
> symbol table while others do not. What are the conditions that control
> when a static function's symbol appears? I would have thought all
> statics would not be included.
> 
> This observation arose while debugging stack traces in the linux
> kernel. (and using ftrace).
> 
> Using arm-linux-gcc 4.9.1.
>
check your kernel config - the linux kernel has a config option 
in kernel hacking called CONFIG_OPTIMIZE_INLINING:

Kernel hacking  --->
  ...
  [*] Allow gcc to uninline functions marked 'inline' 

<snip - form the help text>
 This option determines if the kernel forces gcc to inline the functions
 developers have marked 'inline'. Doing so takes away freedom from gcc to 
 do what it thinks is best, which is desirable for the gcc 3.x series of 
 compilers. The gcc 4.x series have a rewritten inlining algorithm and 
 enabling this option will generate a smaller kernel there. Hopefully 
 this algorithm is so good that allowing gcc 4.x and above to make the 
 decision will become the default in the future. Until then this option
 is there to test gcc for this. 
<snip>

 so I suspect that this is what is causing the discrepencey between functions 
marked inline in the code and actually being compiled in. This is though
linux kernel specific and not actually a gcc issue.

also check out "3.10 Options That Control Optimization" on -finline-limit=N
and the way it is used to automatically control inlining.

thx!
hofrat

      parent reply	other threads:[~2015-08-24  8:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-23 13:16 Martin Faltesek
2015-08-23 20:36 ` Martin Sebor
2015-08-24  8:37 ` Nicholas Mc Guire [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150824083737.GA28523@opentech.at \
    --to=der.herr@hofr.at \
    --cc=gcc-help@gcc.gnu.org \
    --cc=martin.faltesek@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).