mirror of
https://gitlab.com/game-loader/hugo.git
synced 2025-04-20 14:02:07 +08:00
change post file
This commit is contained in:
parent
47af22b888
commit
785af69d80
@ -46,3 +46,8 @@ Minimal程序使用了SEC宏,展开后结果分析如下:
|
|||||||
#### __attribute\_\_ {#attribute}
|
#### __attribute\_\_ {#attribute}
|
||||||
|
|
||||||
__attribute__也是一种编译器指令,用于在声明(函数,变量,类型)时帮助声明对象向编译器告知某些编译特性。在gnu网站上可以查知<font color="blue"> **[可用的属性](https://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/Function-Attributes.html)** </font> ,在此处的含义为,将对应的函数放入指定的name段中,并且即使该函数没有被引用也不允许将该自定义的段优化掉(used)。
|
__attribute__也是一种编译器指令,用于在声明(函数,变量,类型)时帮助声明对象向编译器告知某些编译特性。在gnu网站上可以查知<font color="blue"> **[可用的属性](https://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/Function-Attributes.html)** </font> ,在此处的含义为,将对应的函数放入指定的name段中,并且即使该函数没有被引用也不允许将该自定义的段优化掉(used)。
|
||||||
|
|
||||||
|
#### SEC整体功能 {#SEC整体功能}
|
||||||
|
|
||||||
|
博客中给出的解释为
|
||||||
|
> libbpf is able to automatically determine where to attach BPF program to by looking at its special SEC() annotation. This doesn't work for all possible BPF program types, but it does for lots of them: tracepoints, kprobes, and quite a few others. Additionally, libbpf provides extra APIs to do the attachment programmatically.
|
||||||
|
Loading…
Reference in New Issue
Block a user