]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
* util/grub-mkimagexx.c (locate_sections): Support non-standard
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Wed, 29 Feb 2012 17:57:43 +0000 (18:57 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Wed, 29 Feb 2012 17:57:43 +0000 (18:57 +0100)
ELF section gap.
(load_image): Likewise.

ChangeLog
util/grub-mkimagexx.c

index 9478b224170ffec59099dfa9d00c47f5030988df..dc34c70776dcedbc5ee8b84ae2dd9f42bd473e37 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-02-29  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       * util/grub-mkimagexx.c (locate_sections): Support non-standard
+       ELF section gap.
+       (load_image): Likewise.
+
 2012-02-29  Vladimir Serbinenko  <phcoder@gmail.com>
 
        * configure.ac: Fix a typo in previous commit.
index 2d0176aca7276fa3e1fb3c406c8ef0c0c7680a48..476d05eeb023d5b83713e8d06d4115d854319a3b 100644 (file)
@@ -871,6 +871,9 @@ SUFFIX (locate_sections) (Elf_Shdr *sections, Elf_Half section_entsize,
                                      align) - image_target->vaddr_offset;
        grub_util_info ("locating the section %s at 0x%llx",
                        name, (unsigned long long) current_address);
+       if (image_target->id != IMAGE_EFI)
+         current_address = grub_host_to_target_addr (s->sh_addr)
+           - image_target->link_addr;
        section_addresses[i] = current_address;
        current_address += grub_host_to_target_addr (s->sh_size);
       }
@@ -896,6 +899,9 @@ SUFFIX (locate_sections) (Elf_Shdr *sections, Elf_Half section_entsize,
 
        grub_util_info ("locating the section %s at 0x%llx",
                        name, (unsigned long long) current_address);
+       if (image_target->id != IMAGE_EFI)
+         current_address = grub_host_to_target_addr (s->sh_addr)
+           - image_target->link_addr;
        section_addresses[i] = current_address;
        current_address += grub_host_to_target_addr (s->sh_size);
       }
@@ -985,6 +991,10 @@ SUFFIX (load_image) (const char *kernel_path, grub_size_t *exec_size,
        
            grub_util_info ("locating the section %s at 0x%llx",
                            name, (unsigned long long) current_address);
+           if (image_target->id != IMAGE_EFI)
+             current_address = grub_host_to_target_addr (s->sh_addr)
+               - image_target->link_addr;
+
            section_vaddresses[i] = current_address
              + image_target->vaddr_offset;
            current_address += grub_host_to_target_addr (s->sh_size);