help about the key-word section in VDSP IDDE

本文介绍如何使用section()关键字来指定编译器将特定的对象或函数放置到中间输出文件的指定部分。通过为section()提供字符串参数可以命名这部分,如果不指定则会使用默认的部分。适用于具有静态生存期的顶层命名对象。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Placement Support Keyword (section)

Placement Support Keyword (section)

Placement Support Keyword (section)

The section() keyword directs the compiler to place an object or function in an assembly .SECTION of the compiler’s intermediate output file. You name the assembly .SECTION with the string literal parameter of the section() keyword. If you do not specify a section() keyword for an object or function declaration, the compiler uses a default section. The .ldf file supplied to the linker must also be updated to support the additional named section. For information on the default sections, see "Using Memory Sections" .

Applying section() is meaningful only when the data item is something that the compiler can place in the named section. Apply section() only to top-level, named objects that have static duration; for example, objects that are explicitly static , or are given as external-object definitions. The example below shows the declaration of a static variable that is placed in the section called bingo .

static section("bingo") int x;

The section() keyword has the limitation that section initialization qualifiers cannot be used within the section name string. The compiler may generate labels containing this string, which will result in assembly syntax errors. Additionally, the keyword is not compatible with any pragmas that precede the object or function. For finer control over section placement and compatibility with other pragmas, use #pragma section .

Refer to "#pragma section/#pragma default_section" for more information.

Note: Note that section has replaced the segment keyword in earlier releases of the compiler. Although the segment() keyword is supported by the compiler of the current release, we recommend that you revise the legacy code.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值