Handle X86_64_PC64 relocation.
Those are generated by some cygwin compilers.
This commit is contained in:
parent
252a289cb3
commit
f4171ebd34
4 changed files with 26 additions and 0 deletions
|
@ -1,3 +1,9 @@
|
|||
2013-12-16 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Handle X86_64_PC64 relocation.
|
||||
|
||||
Those are generated by some cygwin compilers.
|
||||
|
||||
2013-12-16 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
Determine the need for mingw-related stubs at compile time rather than
|
||||
|
|
|
@ -80,6 +80,13 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr,
|
|||
}
|
||||
break;
|
||||
|
||||
case R_X86_64_PC64:
|
||||
{
|
||||
*addr64 += rel->r_addend + sym->st_value -
|
||||
(Elf64_Xword) seg->addr - rel->r_offset;
|
||||
}
|
||||
break;
|
||||
|
||||
case R_X86_64_32:
|
||||
{
|
||||
grub_uint64_t value = *addr32 + rel->r_addend + sym->st_value;
|
||||
|
|
|
@ -1132,6 +1132,7 @@ typedef struct
|
|||
#define R_X86_64_PC16 13
|
||||
#define R_X86_64_8 14
|
||||
#define R_X86_64_PC8 15
|
||||
#define R_X86_64_PC64 24
|
||||
|
||||
/* Legal values for ST_TYPE subfield of st_info (symbol type). */
|
||||
|
||||
|
|
|
@ -709,6 +709,18 @@ SUFFIX (relocate_addresses) (Elf_Ehdr *e, Elf_Shdr *sections,
|
|||
break;
|
||||
}
|
||||
|
||||
case R_X86_64_PC64:
|
||||
{
|
||||
*target = grub_host_to_target64 (grub_target_to_host64 (*target)
|
||||
+ addend + sym_addr
|
||||
- target_section_addr - offset
|
||||
- image_target->vaddr_offset);
|
||||
grub_util_info ("relocating an R_X86_64_PC64 entry to 0x%llx at the offset 0x%llx",
|
||||
(unsigned long long) *target,
|
||||
(unsigned long long) offset);
|
||||
break;
|
||||
}
|
||||
|
||||
case R_X86_64_32:
|
||||
case R_X86_64_32S:
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue