mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-07-24 01:51:54 +08:00
* elf32-arm.h (elf32_arm_final_link_relocate case R_ARM_GOTOFF)
(case R_ARM_GOT): Handle relocations to Thumb functions.
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
2002-03-21 Richard Earnshaw <rearnsha@arm.com>
|
||||||
|
|
||||||
|
* elf32-arm.h (elf32_arm_final_link_relocate case R_ARM_GOTOFF)
|
||||||
|
(case R_ARM_GOT): Handle relocations to Thumb functions.
|
||||||
|
|
||||||
2002-03-21 Alan Modra <amodra@bigpond.net.au>
|
2002-03-21 Alan Modra <amodra@bigpond.net.au>
|
||||||
|
|
||||||
* coff64-rs6000.c (_bfd_xcoff64_put_symbol_name): Prototype.
|
* coff64-rs6000.c (_bfd_xcoff64_put_symbol_name): Prototype.
|
||||||
|
@ -1560,6 +1560,12 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd,
|
|||||||
if (sgot == NULL)
|
if (sgot == NULL)
|
||||||
return bfd_reloc_notsupported;
|
return bfd_reloc_notsupported;
|
||||||
|
|
||||||
|
/* If we are addressing a Thumb function, we need to adjust the
|
||||||
|
address by one, so that attempts to call the function pointer will
|
||||||
|
correctly interpret it as Thumb code. */
|
||||||
|
if (sym_flags == STT_ARM_TFUNC)
|
||||||
|
value += 1;
|
||||||
|
|
||||||
/* Note that sgot->output_offset is not involved in this
|
/* Note that sgot->output_offset is not involved in this
|
||||||
calculation. We always want the start of .got. If we
|
calculation. We always want the start of .got. If we
|
||||||
define _GLOBAL_OFFSET_TABLE in a different way, as is
|
define _GLOBAL_OFFSET_TABLE in a different way, as is
|
||||||
@ -1612,6 +1618,13 @@ elf32_arm_final_link_relocate (howto, input_bfd, output_bfd,
|
|||||||
off &= ~1;
|
off &= ~1;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
/* If we are addressing a Thumb function, we need to
|
||||||
|
adjust the address by one, so that attempts to
|
||||||
|
call the function pointer will correctly
|
||||||
|
interpret it as Thumb code. */
|
||||||
|
if (sym_flags == STT_ARM_TFUNC)
|
||||||
|
value |= 1;
|
||||||
|
|
||||||
bfd_put_32 (output_bfd, value, sgot->contents + off);
|
bfd_put_32 (output_bfd, value, sgot->contents + off);
|
||||||
h->got.offset |= 1;
|
h->got.offset |= 1;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user