[ARM] Initialize GOT slot for local symbol in non-PIC link
Eric Botcazou
ebotcazou@adacore.com
Fri Jul 13 22:15:00 GMT 2018
Hi,
the context is as follows: on ARM/VxWorks 7, the R_ARM_TARGET2 relocation used
for exception handling is R_ARM_GOT_PREL; moreover in Ada you can define local
exceptions. In this case, you may end up with a GOT relocation against a local
symbol in a non-PIC link and the ARM linker leaves the GOT slot uninitialized,
unlike for example the i386 or the SPARC linkers in the same situation.
The attached patch fixes that by mimicing what the linker does for a global
symbol that binds locally in the same situation (it also contains a small
cleanup for this case).
Tested on ARM/VxWorks 7 and ARM/EABI, OK for the trunk?
2018-07-13 Eric Botcazou <ebotcazou@adacore.com>
bfd/
* elf32-arm.c (elf32_arm_final_link_relocate) <R_ARM_GOT32>: Small
cleanup for the case of a global symbol that binds locally. Also
install a value in the GOT slot in the case of a local symbol in
a non-PIC link.
--
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-patch
Size: 3527 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20180713/adb6acb3/attachment.bin>
More information about the Binutils
mailing list