binfmt_elf.c (088e7af73a962fcc8883b7a6392544d8342553d6) | binfmt_elf.c (1fcccbac89f5bbc5e41aa72086960059fce372da) |
---|---|
1/* 2 * linux/fs/binfmt_elf.c 3 * 4 * These are the functions used to load ELF format executables as used 5 * on SVr4 machines. Information on the format may be found in the book 6 * "UNIX SYSTEM V RELEASE 4 Programmers Guide: Ansi C and Programming Support 7 * Tools". 8 * --- 1864 unchanged lines hidden (view full) --- 1873 elf = kmalloc(sizeof(*elf), GFP_KERNEL); 1874 if (!elf) 1875 goto out; 1876 /* 1877 * The number of segs are recored into ELF header as 16bit value. 1878 * Please check DEFAULT_MAX_MAP_COUNT definition when you modify here. 1879 */ 1880 segs = current->mm->map_count; | 1/* 2 * linux/fs/binfmt_elf.c 3 * 4 * These are the functions used to load ELF format executables as used 5 * on SVr4 machines. Information on the format may be found in the book 6 * "UNIX SYSTEM V RELEASE 4 Programmers Guide: Ansi C and Programming Support 7 * Tools". 8 * --- 1864 unchanged lines hidden (view full) --- 1873 elf = kmalloc(sizeof(*elf), GFP_KERNEL); 1874 if (!elf) 1875 goto out; 1876 /* 1877 * The number of segs are recored into ELF header as 16bit value. 1878 * Please check DEFAULT_MAX_MAP_COUNT definition when you modify here. 1879 */ 1880 segs = current->mm->map_count; |
1881#ifdef ELF_CORE_EXTRA_PHDRS 1882 segs += ELF_CORE_EXTRA_PHDRS; 1883#endif | 1881 segs += elf_core_extra_phdrs(); |
1884 1885 gate_vma = get_gate_vma(current); 1886 if (gate_vma != NULL) 1887 segs++; 1888 1889 /* 1890 * Collect all the non-memory information about the process for the 1891 * notes. This also sets up the file header. --- 61 unchanged lines hidden (view full) --- 1953 phdr.p_align = ELF_EXEC_PAGESIZE; 1954 1955 size += sizeof(phdr); 1956 if (size > cprm->limit 1957 || !dump_write(cprm->file, &phdr, sizeof(phdr))) 1958 goto end_coredump; 1959 } 1960 | 1882 1883 gate_vma = get_gate_vma(current); 1884 if (gate_vma != NULL) 1885 segs++; 1886 1887 /* 1888 * Collect all the non-memory information about the process for the 1889 * notes. This also sets up the file header. --- 61 unchanged lines hidden (view full) --- 1951 phdr.p_align = ELF_EXEC_PAGESIZE; 1952 1953 size += sizeof(phdr); 1954 if (size > cprm->limit 1955 || !dump_write(cprm->file, &phdr, sizeof(phdr))) 1956 goto end_coredump; 1957 } 1958 |
1961#ifdef ELF_CORE_WRITE_EXTRA_PHDRS 1962 ELF_CORE_WRITE_EXTRA_PHDRS; 1963#endif | 1959 if (!elf_core_write_extra_phdrs(cprm->file, offset, &size, cprm->limit)) 1960 goto end_coredump; |
1964 1965 /* write out the notes section */ 1966 if (!write_note_info(&info, cprm->file, &foffset)) 1967 goto end_coredump; 1968 1969 if (elf_coredump_extra_notes_write(cprm->file, &foffset)) 1970 goto end_coredump; 1971 --- 22 unchanged lines hidden (view full) --- 1994 page_cache_release(page); 1995 } else 1996 stop = !dump_seek(cprm->file, PAGE_SIZE); 1997 if (stop) 1998 goto end_coredump; 1999 } 2000 } 2001 | 1961 1962 /* write out the notes section */ 1963 if (!write_note_info(&info, cprm->file, &foffset)) 1964 goto end_coredump; 1965 1966 if (elf_coredump_extra_notes_write(cprm->file, &foffset)) 1967 goto end_coredump; 1968 --- 22 unchanged lines hidden (view full) --- 1991 page_cache_release(page); 1992 } else 1993 stop = !dump_seek(cprm->file, PAGE_SIZE); 1994 if (stop) 1995 goto end_coredump; 1996 } 1997 } 1998 |
2002#ifdef ELF_CORE_WRITE_EXTRA_DATA 2003 ELF_CORE_WRITE_EXTRA_DATA; 2004#endif | 1999 if (!elf_core_write_extra_data(cprm->file, &size, cprm->limit)) 2000 goto end_coredump; |
2005 2006end_coredump: 2007 set_fs(fs); 2008 2009cleanup: 2010 free_note_info(&info); 2011 kfree(elf); 2012out: --- 19 unchanged lines hidden --- | 2001 2002end_coredump: 2003 set_fs(fs); 2004 2005cleanup: 2006 free_note_info(&info); 2007 kfree(elf); 2008out: --- 19 unchanged lines hidden --- |