linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shriramana Sharma <samjnaa@gmail.com>
To: Linux C Programming List <linux-c-programming@vger.kernel.org>
Subject: Re: Function pointers to inline functions
Date: Fri, 27 Apr 2007 22:31:43 +0530	[thread overview]
Message-ID: <46322C77.8070803@gmail.com> (raw)
In-Reply-To: <6a00c8d50704041133u30d98daavec529753606fc7e9@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1234 bytes --]

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.

[-- Attachment #2: function-pointers-inline-staticinline.tar.gz --]
[-- Type: application/gzip, Size: 858 bytes --]

  reply	other threads:[~2007-04-27 17:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-04 17:09 Function pointers to inline functions Shriramana Sharma
2007-04-04 18:23 ` Glynn Clements
2007-05-25  4:57   ` Shriramana Sharma
2007-05-25 22:41     ` Glynn Clements
2007-05-29 13:03       ` Shriramana Sharma
2007-06-04  7:08         ` Glynn Clements
2007-05-25  6:02   ` Shriramana Sharma
2007-04-04 18:33 ` Steve Graegert
2007-04-27 17:01   ` Shriramana Sharma [this message]
2007-05-04 13:40     ` Glynn Clements
2007-05-25  4:41   ` Shriramana Sharma
2007-05-25 22:45     ` Glynn Clements

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=46322C77.8070803@gmail.com \
    --to=samjnaa@gmail.com \
    --cc=linux-c-programming@vger.kernel.org \
    /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 NNTP newsgroup(s).