12.07.2015 Views

RealView 编译工具编译器参考指南 - ARM Information Center

RealView 编译工具编译器参考指南 - ARM Information Center

RealView 编译工具编译器参考指南 - ARM Information Center

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

编 译 器 特 有 的 功 能4.3.13 __attribute__((section("name")))可 以 使 用 section 函 数 属 性 将 代 码 放 在 映 像 的 不 同 节 中 。注 意此 函 数 属 性 是 <strong>ARM</strong> 编 译 器 支 持 的 GNU 编 译 器 扩 展 。示 例在 以 下 示 例 中 , 将 Function_Attributes_section_0 放 在 RO 节 new_section 中 , 而不 是 放 在 .text 中 。void Function_Attributes_section_0 (void)__attribute__ ((section ("new_section")));void Function_Attributes_section_0 (void){static int aStatic =0;aStatic++;}在 以 下 示 例 中 , section 函 数 属 性 覆 盖 #pragma arm section 设 置 。#pragma arm section code="foo"int f2(){return 1;} // into the 'foo' area__attribute__ ((section ("bar"))) int f3(){return 1;} // into the 'bar' areaint f4(){return 1;} // into the 'foo' area#pragma arm section另 请 参 阅• 第 4-56 页 的 #pragma arm section [section_sort_list]4-38 Copyright © 2007-2009 <strong>ARM</strong> Limited. All rights reserved. <strong>ARM</strong> DUI 0348BCNon-Confidential, Unrestricted AccessID090708

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

Saved successfully!

Ooh no, something went wrong!