2 * GRUB -- GRand Unified Bootloader
3 * Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
5 * GRUB is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * GRUB is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef GRUB_ELFLOAD_HEADER
20 #define GRUB_ELFLOAD_HEADER 1
24 #include <grub/file.h>
25 #include <grub/symbol.h>
26 #include <grub/types.h>
37 typedef struct grub_elf_file
*grub_elf_t
;
39 typedef grub_err_t (*grub_elf32_load_hook_t
)
40 (Elf32_Phdr
*phdr
, grub_addr_t
*addr
, int *load
);
41 typedef grub_err_t (*grub_elf64_load_hook_t
)
42 (Elf64_Phdr
*phdr
, grub_addr_t
*addr
, int *load
);
44 grub_elf_t
grub_elf_open (const char *);
45 grub_elf_t
grub_elf_file (grub_file_t
);
46 grub_err_t
grub_elf_close (grub_elf_t
);
48 int grub_elf_is_elf32 (grub_elf_t
);
49 grub_size_t
grub_elf32_size (grub_elf_t
);
50 grub_err_t
grub_elf32_load (grub_elf_t
, grub_elf32_load_hook_t
, grub_addr_t
*,
53 int grub_elf_is_elf64 (grub_elf_t
);
54 grub_size_t
grub_elf64_size (grub_elf_t
);
55 grub_err_t
grub_elf64_load (grub_elf_t
, grub_elf64_load_hook_t
, grub_addr_t
*,
58 #endif /* ! GRUB_ELFLOAD_HEADER */