public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrew Haley <aph@redhat.com>
To: gcc-help@gcc.gnu.org
Cc: me@felipebalbi.com
Subject: Re: Figuring out start and end of sections
Date: Wed, 14 Apr 2010 08:49:00 -0000	[thread overview]
Message-ID: <4BC581AB.705@redhat.com> (raw)
In-Reply-To: <mcrd3y2vq31.fsf@dhcp-172-17-9-151.mtv.corp.google.com>

On 04/14/2010 01:24 AM, Ian Lance Taylor wrote:
> Felipe Balbi <me@felipebalbi.com> writes:
> 
>> is there any way to figure out where a section starts and ends ?
>>
>> I added a specific section to my program using
>> __attribute__((section "<section name>")) and now I want to figure out
>> where that section starts so I can iterate over it and call the function
>> pointers I'm adding to it.
>>
>> Do I need a specific linker script to achieve that or does the default
>> scripts give me possibility to find that out ?
> 
> If you are using the GNU linker, or gold, and you make the section
> name a valid C identifier, then the linker will automatically define
> symbols __start_SECNAME and __stop_SECNAME which you can use.

Ah, that's a much better idea.  Forget my suggestion.

Andrew.

  reply	other threads:[~2010-04-14  8:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-13 17:40 Felipe Balbi
2010-04-13 17:44 ` Andrew Haley
2010-04-14  5:08   ` Figurig " Felipe Balbi
2010-04-14  8:49     ` Andrew Haley
2010-04-14  0:24 ` Figuring " Ian Lance Taylor
2010-04-14  8:49   ` Andrew Haley [this message]
2010-04-14  6:21 Felipe Balbi
2010-04-14  6:30 ` Felipe Balbi
2010-04-14  6:47   ` Felipe Balbi
2010-04-14  6:50   ` Fabian Cenedese

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=4BC581AB.705@redhat.com \
    --to=aph@redhat.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=me@felipebalbi.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).