Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\binfmt_aout.c Create Date:2022-07-28 20:27:18
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:load_aout_library

Proto:static int load_aout_library(struct file *file)

Type:int

Parameter:

TypeParameterName
struct file *file
263  pos = 0
265  inode = file_inode(file)
267  retval = -ENOEXEC
268  error = kernel_read(file, & ex, size of ex , & pos)
269  If error != size of ex Then Go to out
273  If 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) Then
276  Go to out
283  If Not mmap Then Go to out
286  If N_FLAGS(ex) Then Go to out
292  start_addr = start address & 0xfffff000
294  If (N_TXTOFF(ex) & ~PAGE_MASK) != 0 Then
295  If printk_ratelimit() Then
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  If retval Then Go to out
305  read_code(file, start_addr, N_TXTOFF(ex), length of text, in bytes + length of data, in bytes )
307  retval = 0
308  Go to 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  If error != start_addr Then Go to 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  If bss > len Then
322  retval = vm_brk(start_addr + len, bss - len)
323  If retval Then Go to out
326  retval = 0
327  out :
328  Return retval