This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Figuring out start and end of sections
- From: Andrew Haley <aph at redhat dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Tue, 13 Apr 2010 18:44:25 +0100
- Subject: Re: Figuring out start and end of sections
- References: <20100413174042.GB3531@gandalf>
On 04/13/2010 06:40 PM, Felipe Balbi wrote:
> 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.
Terminate the list with a null pointer; AFAIK that's what everyone else
does. To get the start address, you just need to define a global variable
in that section. Of course this means you have to link everything in the
correct order.
Andrew.