2 * Copyright (C) 2010 gonzoj
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
21 #include <linux/elf.h>
29 elf_is_valid(vaddr_t
);
32 elf_read(vaddr_t
, void *, size_t);
34 #define elf_read_ehdr(addr, ehdr) elf_read(addr, &ehdr, sizeof(Elf32_Ehdr))
36 #define elf_read_phdr(addr, phdr) elf_read(addr, &phdr, sizeof(Elf32_Phdr))
38 #define elf_read_shdr(addr, shdr) elf_read(addr, &shdr, sizeof(Elf32_Shdr))
40 #define elf_read_dyn(addr, dyn) elf_read(addr, &dyn, sizeof(Elf32_Dyn))
42 #define elf_read_sym(addr, sym) elf_read(addr, &sym, sizeof(Elf32_Sym))
45 elf_read_string(vaddr_t
);
48 elf_dump_ehdr(Elf32_Ehdr
);
51 elf_dump_phdr(Elf32_Phdr
);
54 elf_dump_shdr(Elf32_Shdr
);
57 elf_dump_dyn(Elf32_Dyn
);
60 elf_dump_sym(Elf32_Sym
);
62 #endif /* ELF_UTILS_H_ */