LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 2006|回复: 5

static int _init a_init()这种定义是什么意思?

[复制链接]
发表于 2005-11-11 17:51:50 | 显示全部楼层 |阅读模式
static int _init  这种定义是什么意思?什么类型?
发表于 2005-11-11 21:23:00 | 显示全部楼层
_init不属于c的标准
在内核代码里,这个表示
把这个函数放在.init.text section里
在include/linux/init.h里有定义
#define __init      __attribute__ ((__section__ (".init.text")))
这个section的空间是会被回收的
section是和连接有关的概念
如果不明白可以去看看ELF的specification
还有linkers and loaders的相关章节
回复 支持 反对

使用道具 举报

发表于 2005-11-11 21:30:08 | 显示全部楼层
Post by zhllg

section是和连接有关的概念
如果不明白可以去看看ELF的specification
还有linkers and loaders的相关章节

有没有好文章,非常想看!
回复 支持 反对

使用道具 举报

发表于 2005-11-11 23:01:34 | 显示全部楼层
google啊
回复 支持 反对

使用道具 举报

发表于 2005-11-12 09:23:28 | 显示全部楼层
please dig into the source whenever you find sth. unusual
回复 支持 反对

使用道具 举报

发表于 2005-11-12 15:28:28 | 显示全部楼层
Post by rickxbx
please dig into the source whenever you find sth. unusual

you mean special?
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表