Function report |
Source Code:fs\binfmt_elf.c |
Create Date:2022-07-28 20:28:22 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:This is much more generalized than the library routine read function,so we keep this separate. Technically the library read functionis only provided so that we can read a.out libraries that havean ELF header
Proto:static unsigned long load_elf_interp(struct elf64_hdr *interp_elf_ex, struct file *interpreter, unsigned long no_base, struct elf64_phdr *interp_elf_phdata)
Type:unsigned long
Parameter:
Type | Parameter | Name |
---|---|---|
struct elf64_hdr * | interp_elf_ex | |
struct file * | interpreter | |
unsigned long | no_base | |
struct elf64_phdr * | interp_elf_phdata |
561 | load_addr = 0 |
562 | load_addr_set = 0 |
564 | bss_prot = 0 |
565 | error = ~0UL |
573 | If Not elf_check_arch(interp_elf_ex) || That's for binfmt_elf_fdpic to deal with (interp_elf_ex) Then Go to out |
581 | If Not total_size Then |
586 | eppnt = interp_elf_phdata |
589 | elf_type = Changes are private | ETXTBSY |
591 | vaddr = 0 |
594 | vaddr = Segment virtual address |
595 | If e_type == ET_EXEC || load_addr_set Then elf_type |= MAP_FIXED which doesn't unmap underlying mapping |
600 | map_addr = elf_map(interpreter, load_addr + vaddr, eppnt, elf_prot, elf_type, total_size) |
602 | total_size = 0 |
607 | If Not load_addr_set && e_type == ET_DYN Then |
609 | load_addr = map_addr - ELF_PAGESTART(vaddr) |
610 | load_addr_set = 1 |
618 | k = load_addr + Segment virtual address |
619 | If BAD_ADDR(k) || Segment size in file > Segment size in memory || Segment size in memory > TASK_SIZE || TASK_SIZE - Segment size in memory < k Then |
661 | elf_bss = ELF_PAGEALIGN(elf_bss) |
662 | last_bss = ELF_PAGEALIGN(last_bss) |
665 | error = vm_brk_flags(elf_bss, last_bss - elf_bss, bss_prot & page can be executed ? VM_EXEC : 0) |
672 | out : |
673 | Return error |
Name | Describe |
---|---|
load_elf_binary |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |