This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

How to get address and size of a section


Hi all.

Does anyone know how to get the address and size of a section in gcc
in a somewhat portable way without using linking script? I mean
portable because I want to compile the program using icc(intel c
compiler) too.

for example.
int a __attribute__(section(".extra")) = 1;
int b __attribute__(section(".extra")) = 2;
int c __attribute__(section(".extra")) = 3;

Does gcc provides any directive to get the address and size of
".extra" section, or is inline assembly available? I want to access
variables in ".extra" section in batches. And can I specify the layout
of the section that a is laid before b, and b before c, that's,
&a+1==&b and &b+1==&c ?


-- Sai.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]