且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

什么是" AW"在部分标志属性是什么意思?

更新时间:2021-07-30 15:51:04

的section(\"section-name\")$c$c>属性通过产生以下汇编行放置一个变量在一个特定的部分:

The section("section-name") attribute places a variable in a specific section by producing the following assembler line:

.section    section-name,"aw",@progbits

当您设置版块名称。myVarSection,\\仙\\,@ NOBITS#您在GCC开发一种 code注射液制作:

When you set section-name to ".myVarSection,\"aw\",@nobits#" you exploit a kind of "code injection" in GCC to produce:

.section    .myVarSection,"aw",@nobits#,"aw",@progbits

注意号开始单行注释。

请参阅 GNU汇编手册的.section伪充分说明code>指令。一般的语法为

See GNU Assembler manual for the full description of .section directive. A general syntax is

.section name [, "flags"[, @type[,flag_specific_arguments]]]

所以AW的标志:


  • :部分可分配

  • 是W :部分是可写的

  • a: section is allocatable
  • w: section is writable

@nobits 是一种类型:


  • @nobits :部分不包含数据(即,部分只占用空间)

  • @nobits: section does not contain data (i.e., section only occupies space)

所有上述也适用于functions,不只是变量。

All the above is also applicable to functions, not just variables.