From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shriramana Sharma Subject: Re: Function pointers to inline functions Date: Fri, 27 Apr 2007 22:31:43 +0530 Message-ID: <46322C77.8070803@gmail.com> References: <4613DBC2.8060708@gmail.com> <6a00c8d50704041133u30d98daavec529753606fc7e9@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------080305080104080003050009" Return-path: In-Reply-To: <6a00c8d50704041133u30d98daavec529753606fc7e9@mail.gmail.com> Sender: linux-c-programming-owner@vger.kernel.org List-Id: To: Linux C Programming List This is a multi-part message in MIME format. --------------080305080104080003050009 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit I did some experimentation with pointers to inline and static inline functions. Please unpack the attachment and run the build script. You will observe that the nm files only differ in the last four lines, and that too in only three of them. The difference is that the executable built from the source with just "inline" has the functions square, cube and fourthpower marked as "W" which according to man:nm means that "The symbol is a weak symbol that has not been specifically tagged as a weak object symbol". In the same place, the executable built from the source with "static inline" has the same functions marked "t" which denotes a local symbol in the code section. I actually expected static inline to make the entries for the functions disappear but OK, I'm calling pointers to those functions, so they won't disappear. But at least shouldn't they become weak objects, like they do for "inline"? Though I do not profess to fully understand what a weak object is, (upon which matter I would like to learn more) it sounds like an object which does not have a full separate existence. If an inline function is such a weak object, how come a static inline one is not tagged as one? Thanks. Shriramana Sharma. --------------080305080104080003050009 Content-Type: application/gzip; name="function-pointers-inline-staticinline.tar.gz" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="function-pointers-inline-staticinline.tar.gz" H4sICK8pMkYAA0RWVUlZYS50YXIA7VfLctowFGWLv+KWTDshCcFgAwuSbPoB3XTXdiHbIlZq S64sk2aS/nuvZJtXMDB5Tqc6kwFbOrrvq0tmBQ8VE7yXCcYVlXmP8YRx2ssVUSwsX/qtZ8FF TEYj/T2YjNzV7xqtgTse+P7QH3vjljt0vaHbgtHz1B6GAh2VAK2cpDeckEbevv1/FLOD8h8U LImerGNf/n3MeZ1/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