2N/A/* grub-mkimage.c - make a bootable image */
2N/A * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
2N/A#if defined(MKIMAGE_ELF32)
static Elf_Addr
Elf_Word i;
* section_entsize));
i < num_syms;
== STT_FUNC)
jptr++;
*jptr = 0;
jptr++;
if (! start_address)
return start_address;
static Elf_Addr
static Elf_Addr *
static Elf_Addr
Elf_Word i;
i < num_syms;
ret++;
return ret;
#ifdef MKIMAGE_ELF64
struct unaligned_uint32 *p;
static grub_uint32_t
struct unaligned_uint32 *p;
p->val = ((add_value_to_slot_21_real (((p->val >> 2) & MASKF21), value) & MASKF21) << 2) | (p->val & ~(MASKF21 << 2));
p->val = ((add_value_to_slot_21_real (((p->val >> 3) & MASKF21), value) & MASKF21) << 3) | (p->val & ~(MASKF21 << 3));
p->val = ((add_value_to_slot_21_real (((p->val >> 4) & MASKF21), value) & MASKF21) << 4) | (p->val & ~(MASKF21 << 4));
const char *strtab,
Elf_Half i;
Elf_Shdr *s;
for (i = 0, s = sections;
i < num_sections;
Elf_Rela *r;
Elf_Word j;
* section_entsize));
* section_entsize));
j < num_rs;
r->r_addend : 0;
case EM_386:
case R_386_NONE:
case R_386_32:
case R_386_PC32:
case EM_X86_64:
case R_X86_64_NONE:
case R_X86_64_64:
case R_X86_64_PC32:
case R_X86_64_32:
case R_X86_64_32S:
#ifdef MKIMAGE_ELF64
case EM_IA_64:
case R_IA64_PCREL21B:
tr++;
noff);
case R_IA64_LTOFF22X:
case R_IA64_LTOFF22:
case R_IA64_LTOFF_FPTR22:
gpptr++;
case R_IA64_GPREL22:
case R_IA64_PCREL64LSB:
case R_IA64_SEGREL64LSB:
case R_IA64_DIR64LSB:
case R_IA64_FPTR64LSB:
case R_IA64_LDXMOV:
static Elf_Addr
struct grub_pe32_fixup_block *b;
b = &((*cblock)->b);
if (flush)
- next_address)
while (padding_size--)
b = &((*cblock)->b);
if (! flush)
b->block_size = sizeof (*b);
return current_address;
static Elf_Addr
const char *strtab,
Elf_Shdr *s;
Elf_Rel *r;
Elf_Word j;
j < num_rs;
case EM_386:
case EM_X86_64:
addr,
0, current_address,
case EM_IA_64:
case R_IA64_PCREL64LSB:
case R_IA64_LDXMOV:
case R_IA64_PCREL21B:
case R_IA64_LTOFF_FPTR22:
case R_IA64_LTOFF22X:
case R_IA64_LTOFF22:
case R_IA64_GPREL22:
case R_IA64_SEGREL64LSB:
case R_IA64_FPTR64LSB:
case R_IA64_DIR64LSB:
addr,
0, current_address,
for (i = 0; i < njumpers; i++)
0, current_address,
return current_address;
== SHF_ALLOC);
if (size < sizeof (*e)
static Elf_Addr *
Elf_Shdr *s;
current_address = 0;
for (i = 0, s = sections;
i < num_sections;
for (i = 0, s = sections;
i < num_sections;
if (align)
for (i = 0, s = sections;
i < num_sections;
if (align)
return section_addresses;
Elf_Ehdr *e;
Elf_Shdr *s;
*start = 0;
for (i = 0; i < num_sections; i++)
for (i = 0, s = sections;
i < num_sections;
if (align)
*bss_size = 0;
for (i = 0, s = sections;
i < num_sections;
symtab_section = s;
#ifdef MKIMAGE_ELF64
if (! symtab_section)
*reloc_size = 0;
if (*start == 0)
for (i = 0, s = sections;
i < num_sections;
return out_img;