Edit .eh_frame symbols
authorAlan Modra <amodra@gmail.com>
Thu, 27 Apr 2017 01:38:14 +0000 (11:08 +0930)
committerAlan Modra <amodra@gmail.com>
Thu, 27 Apr 2017 02:24:29 +0000 (11:54 +0930)
commitd7153c4ac333c9127c18efcf184607d368bb142d
tree72ca75116b4aadb183ba62ac329282406e67a064
parent641338d8e9b62bde9672f13f0dca2324b61e46e2
Edit .eh_frame symbols

Experimental support for moving symbols defined in .eh_frame as their
CIEs/FDEs are edited or merged.

* elf-bfd.h (struct eh_cie_fde): Add aug_str_len and aug_data_len.
(_bfd_elf_adjust_eh_frame_global_symbol): Declare.
* elf-eh-frame.c (_bfd_elf_parse_eh_frame): Set aug_str_len and
aug_data_len.
(offset_adjust): New function.
(_bfd_elf_adjust_eh_frame_global_symbol): Likewise.
(adjust_eh_frame_local_symbols): Likewise.
(_bfd_elf_discard_section_eh_frame): Call adjust_eh_frame_local_symbols
after changing anything.  Return true if anything changed.
* elflink.c (bfd_elf_discard_info): If .eh_frame changed, call
_bfd_elf_adjust_eh_frame_global_symbol for globals.
bfd/ChangeLog
bfd/elf-bfd.h
bfd/elf-eh-frame.c
bfd/elflink.c