29.12.2014 Views

RealView Compilation Tools Compiler Reference Guide - ARM ...

RealView Compilation Tools Compiler Reference Guide - ARM ...

RealView Compilation Tools Compiler Reference Guide - ARM ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

<strong>Compiler</strong>-specific Features<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 />

int y1[100];<br />

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

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

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

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

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

int x2 = 5;<br />

int y2[100];<br />

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

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

#pragma arm section rodata<br />

int x3 = 5;<br />

int y3[100];<br />

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

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

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

int add1(int x)<br />

{<br />

return x+1;<br />

}<br />

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

// in .bss<br />

// in bar<br />

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

// in foo<br />

// in .bss<br />

// in .constdata<br />

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

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

#pragma arm section code<br />

See also<br />

• __attribute__((section)) on page 4-34<br />

• Chapter 5 Using Scatter-loading Description Files in the Linker <strong>Guide</strong>.<br />

4.6.4 #pragma diag_default tag[,tag,...]<br />

This pragma returns the severity of the diagnostic messages that have the specified tags<br />

to the severities that were in effect before any pragmas were issued.<br />

<strong>ARM</strong> DUI 0348A Copyright © 2007, 2010 <strong>ARM</strong> Limited. All rights reserved. 4-51<br />

Non-Confidential

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

Saved successfully!

Ooh no, something went wrong!