Altera_Forum
Honored Contributor
19 years agoget start and end of .text from C
I am trying to get the start and end of the .text section in C code. I have currently tried:
extern int stext;
extern int etext;
struct ta
{
void * start;
void * end;
};
struct ta text_area;
char image_auth_sig;
void image_global_vars_init()
{
text_area.start = &stext;
text_area.end = &etext;
} But, I get the following: obj/common/image_global_vars.o(.text+0xc): In function `image_global_vars_init':
../common/image_global_vars.c:17: Unable to reach stext (at 0x00200150) from the global pointer (at 0x0025d900) because the offset (-382896) is out of the allowed range, -32678 to 32767. Can anyone suggest how this might be done? Thanks, Cliff