mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-22 15:22:39 +00:00
Allow _start == 0 with relocatable images
This commit is contained in:
1 parent
fc489a889d
commit
575c7a6e3c
1 file changed
+3
-3
@@ -495,7 +495,7 @@ SUFFIX (relocate_symbols) (Elf_Ehdr *e, Elf_Shdr *sections,
|
|||||||
{
|
{
|
||||||
Elf_Word symtab_size, sym_size, num_syms;
|
Elf_Word symtab_size, sym_size, num_syms;
|
||||||
Elf_Off symtab_offset;
|
Elf_Off symtab_offset;
|
||||||
Elf_Addr start_address = 0;
|
Elf_Addr start_address = (Elf_Addr) -1;
|
||||||
Elf_Sym *sym;
|
Elf_Sym *sym;
|
||||||
Elf_Word i;
|
Elf_Word i;
|
||||||
Elf_Shdr *strtab_section;
|
Elf_Shdr *strtab_section;
|
||||||
@@ -560,7 +560,7 @@ SUFFIX (relocate_symbols) (Elf_Ehdr *e, Elf_Shdr *sections,
|
|||||||
(unsigned long long) sym->st_value,
|
(unsigned long long) sym->st_value,
|
||||||
(unsigned long long) section_addresses[cur_index]);
|
(unsigned long long) section_addresses[cur_index]);
|
||||||
|
|
||||||
if (! start_address)
|
if (start_address == (Elf_Addr)-1)
|
||||||
if (strcmp (name, "_start") == 0 || strcmp (name, "start") == 0)
|
if (strcmp (name, "_start") == 0 || strcmp (name, "start") == 0)
|
||||||
start_address = sym->st_value;
|
start_address = sym->st_value;
|
||||||
}
|
}
|
||||||
@@ -1793,7 +1793,7 @@ SUFFIX (grub_mkimage_load_image) (const char *kernel_path,
|
|||||||
layout->ia64jmp_off
|
layout->ia64jmp_off
|
||||||
+ image_target->vaddr_offset,
|
+ image_target->vaddr_offset,
|
||||||
image_target);
|
image_target);
|
||||||
if (layout->start_address == 0)
|
if (layout->start_address == (Elf_Addr) -1)
|
||||||
grub_util_error ("start symbol is not defined");
|
grub_util_error ("start symbol is not defined");
|
||||||
|
|
||||||
SUFFIX (entry_point) = (Elf_Addr) layout->start_address;
|
SUFFIX (entry_point) = (Elf_Addr) layout->start_address;
|
||||||
|
|||||||
Reference in new issue
Block a user