ld: bfd: sframe: fix incorrect r_addend in RELA entries
With the fix in GAS, we now use a different PC-relative RELA for
updating the SFrame FDE function start address: The value is the offset
of the start PC of the function from the start of the SFrame section.
When RELAs are output (e.g. for relocatable links), there is need to
adjust the r_addend. This is because the r_addend values still have the
correct values for the _input_ SFrame section being linked / relocated.
The values must now be (before outputing the RELAs) with respect to the
_output_ SFrame section.
PS: This patch should be merged with the previous commits before final
commit (Otherwise the tests will fail). It is currently a separate
patch as I would like to check if this is OK to do. If such a "addend
fixup" is risky or wrong, it seems we will need a new type of RELOC for
SFrame sections.
bfd/
* elf-bfd.h: New declaration.
* elf-sframe.c (_bfd_elf_sframe_section_addend): New
definition.
* elflink.c (elf_link_input_bfd): Fixup the r_addend of
SFrame RELAs.