04.01.2015 Views

RealView Compilation Tools - ARM Information Center

RealView Compilation Tools - ARM Information Center

RealView Compilation Tools - ARM Information Center

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Compiler-specific Features<br />

• rwdata<br />

• zidata.<br />

Usage<br />

Use a scatter-loading description file with the <strong>ARM</strong> linker to control how to place a<br />

named section at a particular address in memory.<br />

Restrictions<br />

This option has no effect on:<br />

• Inline functions and their local static variables.<br />

• Template instantiations and their local static variables.<br />

• Elimination of unused variables and functions. However, using #pragma arm<br />

section enables the linker to eliminate a function or variable that might otherwise<br />

be kept because it is in the same section as a used function or variable.<br />

• The order that definitions are written to the object file.<br />

Example<br />

int x1 = 5;<br />

// in .data (default)<br />

int y1[100];<br />

// in .bss (default)<br />

int const z1[3] = {1,2,3}; // in .constdata (default)<br />

#pragma arm section rwdata = "foo", rodata = "bar"<br />

int x2 = 5;<br />

// in foo (data part of region)<br />

int y2[100];<br />

// in .bss<br />

int const z2[3] = {1,2,3}; // in bar<br />

char *s2 = "abc";<br />

// s2 in foo, "abc" in .conststring<br />

#pragma arm section rodata<br />

int x3 = 5;<br />

// in foo<br />

int y3[100];<br />

// in .bss<br />

int const z3[3] = {1,2,3}; // in .constdata<br />

char *s3 = "abc";<br />

// s3 in foo, "abc" in .conststring<br />

#pragma arm section code = "foo"<br />

int add1(int x)<br />

// in foo (code part of region)<br />

{<br />

return x+1;<br />

}<br />

#pragma arm section code<br />

See also<br />

• __attribute__((section("name"))) on page 4-38<br />

4-60 Copyright © 2007-2010 <strong>ARM</strong>. All rights reserved. <strong>ARM</strong> DUI 0348C<br />

Non-Confidential,<br />

ID101213

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!