From: Felipe Balbi <me@felipebalbi.com>
To: Felipe Balbi <me@felipebalbi.com>
Cc: gcc-help@gcc.gnu.org, iant@google.com
Subject: Re: Figuring out start and end of sections
Date: Wed, 14 Apr 2010 06:30:00 -0000 [thread overview]
Message-ID: <20100414063043.GC4285@gandalf> (raw)
In-Reply-To: <20100414062234.GB4285@gandalf>
Hi,
On Wed, Apr 14, 2010 at 09:22:35AM +0300, Felipe Balbi wrote:
> #include <stdio.h>
>
> typedef int (*initcall_t)(void);
>
> static int my_init(void)
> {
> printf("hello world from _init\n");
> }
> static initcall_t __my_initcall_my_init
> __attribute__((__used__))
> __attribute__((section("_initcall"))) = my_init;
>
> int main(int argc, char *argv[])
> {
> initcall_t *fn;
>
> for (fn = __start__initcall; fn <
> __stop__initcall; fn++)
> (void) fn();
>
> return 0;
> }
I commented the for loop just to get the thing compiling and nm doesn't
show any __start_ symbols:
$ nm tst | grep init
080494cc d __init_array_end
080494cc d __init_array_start
08048400 T __libc_csu_init
080495d4 d __my_initcall_my_init
08048298 T _init
080483c4 t my_init
--
balbi
next prev parent reply other threads:[~2010-04-14 6:30 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-14 6:21 Felipe Balbi
2010-04-14 6:30 ` Felipe Balbi [this message]
2010-04-14 6:47 ` Felipe Balbi
2010-04-14 6:50 ` Fabian Cenedese
-- strict thread matches above, loose matches on Subject: below --
2010-04-13 17:40 Felipe Balbi
2010-04-13 17:44 ` Andrew Haley
2010-04-14 0:24 ` Ian Lance Taylor
2010-04-14 8:49 ` Andrew Haley
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=20100414063043.GC4285@gandalf \
--to=me@felipebalbi.com \
--cc=gcc-help@gcc.gnu.org \
--cc=iant@google.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).