Fix thumb compilation with clang.
According to EABI only STT_FUNC has convention of lowest bit indicating execution mode. R_THM_{JUMP,CALL}* relocations are assumed to be pointing to thumb mode unless they use STT_FUNC.
This commit is contained in:
parent
08438d783f
commit
42e24b6006
2 changed files with 11 additions and 0 deletions
|
@ -173,6 +173,8 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr,
|
|||
sym_addr += grub_arm_thm_call_get_offset ((grub_uint16_t *) target);
|
||||
|
||||
grub_dprintf ("dl", " sym_addr = 0x%08x\n", sym_addr);
|
||||
if (ELF_ST_TYPE (sym->st_info) != STT_FUNC)
|
||||
sym_addr |= 1;
|
||||
|
||||
offset = sym_addr - (grub_uint32_t) target;
|
||||
|
||||
|
@ -227,6 +229,9 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr,
|
|||
|
||||
sym_addr += grub_arm_thm_jump19_get_offset ((grub_uint16_t *) target);
|
||||
|
||||
if (ELF_ST_TYPE (sym->st_info) != STT_FUNC)
|
||||
sym_addr |= 1;
|
||||
|
||||
offset = sym_addr - (grub_uint32_t) target;
|
||||
|
||||
if (!grub_arm_thm_jump19_check_offset (offset)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue