Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PRAGMA section (DIAB vs GNU)

706 views
Skip to first unread message

marpel

unread,
Aug 4, 2009, 10:51:30 AM8/4/09
to
Hi,

I am using Tornado2.2.1/VxWorks5.5.1 with a target board mounting a
PowerPC processor. My embedded application was formerly developed
under the DIAB toolchain, but I need now to use the GNU toolchain. The
migration from the DIAB toolchain to the GNU toolchain was been with
no problem, except for the use of "#pragma section". In fact, when the
ccppc compiles the following piece of C code:

#pragma section IMG_BUFF1 address=0x1a000000
#pragma use_section IMG_BUFF1 sm_aucImgBuff1
static UCHAR sm_aucImgBuff1 [SIZE_1K][SIZE_1K];

the pragma is ignored.

How can I solve this problem? Which is the way to obtain under GNU the
same result got under DIAB with "#pragma section"?

Thanks in advance.

Marco

Seb

unread,
Aug 5, 2009, 4:48:43 AM8/5/09
to
Hi Macro,
Used __attribute__ instead :
static UCHAR sm_aucImgBuff1 [SIZE_1K][SIZE_1K] __attribute__
((section ("IMG_BUFF1"));

For more information, refer to :
http://gcc.gnu.org/onlinedocs/gcc-4.0.4/gcc/Variable-Attributes.html

And specify the section address using the link script :
SECTIONS {
...
secname start BLOCK(align) (NOLOAD) : AT ( ldadr )
{ contents } >region =fill
...
}

For more information, refer to :
http://www.math.utah.edu/docs/info/ld_3.html#SEC16

Hope this helps :-)

Best Regards,
Sebastien.

0 new messages