arm: Fix trampoline generation.

We used the wrong pointer in this case. It worked only by accident.
This commit is contained in:
Vladimir Serbinenko 2017-02-01 15:58:36 +01:00
parent 68c6cec061
commit 3d173955f0

View file

@ -232,8 +232,8 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr,
if (!grub_arm_thm_jump19_check_offset (offset)
|| !(sym_addr & 1))
{
struct trampoline_thumb *tp = mod->gotptr;
mod->gotptr = tp + 1;
struct trampoline_thumb *tp = mod->trampptr;
mod->trampptr = tp + 1;
grub_memcpy (tp->template, thumb_template, sizeof (tp->template));
tp->neg_addr = -sym_addr - 4;
offset = ((grub_uint8_t *) tp - (grub_uint8_t *) target - 4) | 1;