Linux对可执行文件格式的管理 ●例如,ELF格式的描述符elf format fs/binfmt elf.c static struct linux _binfmt elf format = .module THIS_MODULE, load_binary load_elf_binary, load_shlib load elf library, .core_dump elf_core_dump, .min_coredump ELF_EXEC_PAGESIZE, .hasvdso =1 } 1口t4四1是142刀00 陈香兰(xlanchenoustc,ed加,cn)(计异款应Limx操作系纯分折0 hapter9-2Lnux中径开 November 4.2014 10 21
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Linux对可执行文件格式的管理 例如,ELF格式的描述符elf_format . fs/binfmt_elf.c . . static struct linux_binfmt elf_format = { .module = THIS_MODULE, .load_binary = load_elf_binary, .load_shlib = load_elf_library, .core_dump = elf_core_dump, .min_coredump = ELF_EXEC_PAGESIZE, .hasvdso = 1 }; 陈香兰(xlanchen@ustc.edu.cn) (计算机应用教研室 Linux操作系统分析Chapter 9-2 Linux中程序的执行 @计算机学院嵌入式系统实验室@苏州研究院中国科学技术大学Fall 2014) November 4, 2014 10 / 21
Linux对可执行文件格式的管理 。可执行文件格式的注册和注销: include/linux/binfmts.h extern int register_binfmt(struct linux_binfmt ) extern void unregister_binfmt(struct linux_binfmt ) 。可执行文件格式的链表 fs/exec.c static LIST_HEAD(formats); static DEFINE_RWLOCK(binfmt_lock); ·在系统启动时,所有编译进内核的可执行格式都被注册 ,查看Linux2.6.26中看到的可执行文件格式 ·在系统运行过程中,也可以注册一个新的可执行文件格式 4口4四1是14P刀00 陈香兰(x1 anchenoustc,edu,cn)(升界丸应Lnmx掉作系纯分折0 hapter-2Lnux中花开 November 4.2014 10 21
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Linux对可执行文件格式的管理 可执行文件格式的注册和注销: . include/linux/binfmts.h . . extern int register_binfmt(struct linux_binfmt *); extern void unregister_binfmt(struct linux_binfmt *); 可执行文件格式的链表 . fs/exec.c . . static LIST_HEAD(formats); static DEFINE_RWLOCK(binfmt_lock); 在系统启动时,所有编译进内核的可执行格式都被注册 ▶ 查看Linux 2.6.26中看到的可执行文件格式 在系统运行过程中,也可以注册一个新的可执行文件格式 陈香兰(xlanchen@ustc.edu.cn) (计算机应用教研室 Linux操作系统分析Chapter 9-2 Linux中程序的执行 @计算机学院嵌入式系统实验室@苏州研究院中国科学技术大学Fall 2014) November 4, 2014 10 / 21