PATCH Add GOT and GOTOFF support for ARM/Thumb code symbols
Richard Earnshaw
rearnsha@arm.com
Tue Mar 19 06:10:00 GMT 2002
If we are building a GOT entry for a Thumb symbol, or if we are generating
an offset from the GOT to a Thumb function, then we need to make sure that
the resulting pointer has bit[0] set. Otherwise, attempts to call the
function pointer will cause the processor to switch to ARM mode and hence
miss-execute the code.
I think I've found all the relevant parts to change, but I'm not familiar
with the linker code. Have I missed anything?
For -mthumb -fPIC, this fixes 75 failures in the gcc.c-torture tests of
the gcc testsuite (I never managed to get the g++ tests to complete before
adding this patch), and 152 failures in the GDB testsuite.
<date> 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bfd-thpic.patch
Type: text/x-patch
Size: 1355 bytes
Desc: bfd-thpic.patch
URL: <https://sourceware.org/pipermail/binutils/attachments/20020319/5e9f3ab9/attachment.bin>
More information about the Binutils
mailing list