From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 116863 invoked by alias); 23 Aug 2015 20:36:41 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 116842 invoked by uid 89); 23 Aug 2015 20:36:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qg0-f42.google.com Received: from mail-qg0-f42.google.com (HELO mail-qg0-f42.google.com) (209.85.192.42) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Sun, 23 Aug 2015 20:36:39 +0000 Received: by qgj62 with SMTP id 62so75784709qgj.2 for ; Sun, 23 Aug 2015 13:36:37 -0700 (PDT) X-Received: by 10.140.234.133 with SMTP id f127mr48179904qhc.69.1440362197572; Sun, 23 Aug 2015 13:36:37 -0700 (PDT) Received: from [192.168.0.20] (97-122-175-227.hlrn.qwest.net. [97.122.175.227]) by smtp.gmail.com with ESMTPSA id 49sm9646609qgh.4.2015.08.23.13.36.35 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 23 Aug 2015 13:36:36 -0700 (PDT) Message-ID: <55DA2ED2.9000601@gmail.com> Date: Sun, 23 Aug 2015 20:36:00 -0000 From: Martin Sebor User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Martin Faltesek , gcc-help@gcc.gnu.org Subject: Re: static functions appearing in the symbol table References: In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-08/txt/msg00142.txt.bz2 On 08/23/2015 07:15 AM, 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. At a high level, a static function whose calls in a program are all inlined will not have an entry in the symbol table. A static function that's not completely inlined will. What is and isn't inlined depends on optimizations in effect and on attributes (e.g., function with the always_inline attribute will likely not a have a symbol even at -O0, while a trivial static function that's declared with attribute noinline will even at -O1 and higher). Martin