diff options
-rw-r--r-- | bfd/elf32-i386.c | 9 | ||||
-rw-r--r-- | bfd/elf64-x86-64.c | 9 |
2 files changed, 18 insertions, 0 deletions
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index 7e6823b..d91aa28 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -1329,6 +1329,15 @@ elf_i386_convert_load_reloc (bfd *abfd, Elf_Internal_Shdr *symtab_hdr, if (opcode == 0xff) { + switch (modrm & 0x38) + { + case 0x10: /* CALL */ + case 0x20: /* JMP */ + break; + default: + return true; + } + /* We have "call/jmp *foo@GOT[(%reg)]". */ if ((h->root.type == bfd_link_hash_defined || h->root.type == bfd_link_hash_defweak) diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c index f926464..4e5e351 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c @@ -1752,6 +1752,15 @@ elf_x86_64_convert_load_reloc (bfd *abfd, /* Convert R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX to R_X86_64_PC32. */ modrm = bfd_get_8 (abfd, contents + roff - 1); + switch (modrm & 0x38) + { + case 0x10: /* CALL */ + case 0x20: /* JMP */ + break; + default: + return true; + } + if (modrm == 0x25) { /* Convert to "jmp foo nop". */ |