更新时间: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
的标志:
和 @nobits
是一种类型:
所有上述也适用于functions,不只是变量。
All the above is also applicable to functions, not just variables.