函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\binfmt_aout.c Create Date:2022-07-29 11:01:42
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:load_aout_library

函数原型:static int load_aout_library(struct file *file)

返回类型:int

参数:

类型参数名称
struct file *file
263  pos等于0
265  inode等于file_inode(file)
267  retval等于负ENOEXEC
268  error等于kernel_read(file, & ex, ex的长度, & pos)
269  如果error不等于ex的长度则转到:out
273  如果N_MAGIC(ex)不等于Code indicating demand-paged executable. N_MAGIC(ex)不等于This indicates a demand-paged executable with the header in the text. The first page is unmapped to help trap NULL pointer references N_TRSIZE(ex)或N_DRSIZE(ex)或 start address 按位与0xfff且N_MAGIC(ex)恒等于Code indicating demand-paged executable. NOTE: in a 32bit arch with a preemptable kernel and* an UP compile the i_size_read/write must be atomic* with respect to the local cpu (unlike with preempt disabled),* but they don't need to be atomic with respect to other cpus like in* true SMP (so they 小于 length of text, in bytes length of data, in bytes N_SYMSIZE(ex)加N_TXTOFF(ex)则
276  转到:out
283  如果非mmap则转到:out
286  如果N_FLAGS(ex)则转到:out
292  start_addr等于 start address 按位与0xfffff000
294  如果N_TXTOFF(ex)按位与PAGE_MASK的反的值不等于0则
295  如果printk_ratelimit()则
301  retval等于vm_brk(start_addr, length of text, in bytes + length of data, in bytes + length of uninitialized data area for file, in bytes )
302  如果retval则转到:out
305  read_code(file, start_addr, N_TXTOFF(ex), length of text, in bytes + length of data, in bytes )
307  retval等于0
308  转到:out
311  error等于vm_mmap(file, start_addr, length of text, in bytes + length of data, in bytes , page can be read | page can be written | page can be executed , Interpret addr exactly | Changes are private | ETXTBSY , N_TXTOFF(ex))
315  retval等于error
316  如果error不等于start_addr则转到:out
319  len等于 align the pointer to the (next) page boundary ( length of text, in bytes + length of data, in bytes )
320  bss等于 length of text, in bytes length of data, in bytes length of uninitialized data area for file, in bytes
321  如果bss大于len
322  retval等于vm_brk(start_addr + len, bss - len)
323  如果retval则转到:out
326  retval等于0
327  out :
328  返回:retval