I\'m working in C on Linux. I\'ve seen the usage of of the gcc __section__ attribute (especially in the Linux kernel) to collect data (usually function pointers) into custom
So the answer above, __start_SECTION
and __stop_SECTION
will work, however for the program to be able to use the information from the linker you to need to declare those variables as extern char* __start_SECTION
. Enjoy!
extern char * __start_blobby;
...
printf("This section starts at %p\n", (unsigned int)&__start_blobby);
...