[patch][gold][arm]Support IFUNC

Hán Shěn (沈涵) shenhan@google.com
Fri Jan 23 18:30:00 GMT 2015


Hi,

This patch adds IFUNC support for arm gold backend, which is a
required feature in chromeos  arm development work.

Tested:
1) Built passed all-gold on x86_64 machine
2) Tested with basic gold aarch64 ifunc unittests -
   a) global ifunc, statically/non-statically linked
   b) local ifunc, statically/non-statically linked
   c) global/local, other shared library routine mixed,
statically/non-statically
   linked

gold/ChangeLog
2015-01-22  Han Shen  <shenhan@google.com>
        * arm.cc (Target_arm::Target_arm): Add initialization for new members.
        (Target_arm::do_plt_address_for_global): New method.
        (Target_arm::do_plt_address_for_local): New method.
        (Target_arm::rel_irelative_section): New method.
        (Target_arm::make_data_plt): Add more parameters for plt ctor.
        (Target_arm::do_make_data_plt): Add more parameters for plt ctor.
        (Target_arm::Scan::symbol_needs_plt_entry): Add ifunc support.
        (Target_arm::Scan::reloc_needs_plt_for_ifunc): Add ifunc support.
        (Target_arm::Scan::check_non_pic): Add ifunc support.
        (Target_arm::Scan::local): Add ifunc support.
        (Target_arm::Scan::global): Add ifunc support.
        (Target_arm::make_plt_section): New method.
        (Target_arm::make_plt_entry): Change to call to make_plt_section.
        (Target_arm::make_local_ifunc_plt_entry): New method.
        (Target_arm::got_irelative_): New member.
        (Target_arm::rel_irelative_): New member.
        (Target_arm::got_section): Add creation for got_irelative_.
        (Target_arm::rel_dyn_section): Add creation for rel_irelative_.
        (Target_arm::Relocate::relocate): Properly set local ifunc address.
        (Target_arm::do_dynsym_value): Properly set global ifunc address.
        (Target_arm::scan_reloc_for_stub): Properly set global ifunc address.
        (Output_data_plt_arm::IRelative_data): New type.
        (Output_data_plt_arm::Output_data_plt_arm): Add more parameters.
        (Output_data_plt_arm::add_entry): Add more parameters.
        (Output_data_plt_arm::add_relocation): New method.
        (Output_data_plt_arm::add_local_ifunc_entry): New method.
        (Output_data_plt_arm::rel_irelative): New method.
        (Output_data_plt_arm::entry_count): Modified.
        (Output_data_plt_arm::address_for_global): New method.
        (Output_data_plt_arm::address_for_local): New method.
        (Output_data_plt_arm::set_final_data_size): Add irelative_count_.
        (Output_data_plt_arm::insert_irelative_data): New method.
        (Output_data_plt_arm::irelative_rel_): New member.
        (Output_data_plt_arm::got_): New member.
        (Output_data_plt_arm::got_irelative_): New member.
        (Output_data_plt_arm::irelative_count_): New member.
        (Output_data_plt_arm::IRelative_data_vec): New typedef.
        (Output_data_plt_arm::irelative_data_vec): New member.
        (Output_data_plt_arm::do_write): Write out irelative entries.
        (Output_data_plt_arm_standard::Output_data_plt_arm_standard): Add
        more parameters to ctor.
        (Output_data_plt_arm_nacl::Output_data_plt_arm_nacl): Add
        more parameters to ctor.
        * output.h (Output_data_reloc::add_local_relative): New method.
        * aarch64.cc (Output_data_plt_aarch64): Fixed typo in comment.

elfcpp/ChangeLog
2015-01-22  Han Shen  <shenhan@google.com>
        * arm.h (R_ARM_IRELATIVE): New dynamic relocation.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ifunc.patch
Type: text/x-patch
Size: 39323 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20150123/86c8c21e/attachment.bin>


More information about the Binutils mailing list