x86: Add _bfd_x86_elf_link_setup_gnu_properties
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 1 Sep 2017 15:00:36 +0000 (08:00 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 1 Sep 2017 15:00:51 +0000 (08:00 -0700)
commita6798baba212170e427d2f9bd99af12f1078b162
tree5dfcb207d647aff488599dccbac51f25241e4d8b
parent376dc015f275575e0aa7be9c46476db5506ff836
x86: Add _bfd_x86_elf_link_setup_gnu_properties

Extract the common parts of elf_i386_link_setup_gnu_properties and
elf_x86_64_link_setup_gnu_properties into a new function.

For x86-64, since PIC PLT layouts are the same as non-PIC PLT layouts,
initialize pic_plt0_entry and pic_plt_entry fields in PLT layouts with
the non-PIC PLT entries.

* elf32-i386.c (elf_i386_link_setup_gnu_properties): Updated.
Call _bfd_x86_elf_link_setup_gnu_properties.
* elf64-x86-64.c (elf_x86_lazy_plt_layout): Initialize
pic_plt0_entry and pic_plt_entry fields with the non-PIC PLT
entries.
(elf_x86_64_non_lazy_plt): Likewise.
(elf_x86_64_lazy_bnd_plt): Likewise.
(elf_x86_64_non_lazy_bnd_plt): Likewise.
(elf_x86_64_lazy_ibt_plt): Likewise.
(elf_x32_lazy_ibt_plt): Likewise.
(elf_x86_64_non_lazy_ibt_plt): Likewise.
(elf_x32_non_lazy_ibt_plt): Likewise.
(elf_x86_64_nacl_plt): Likewise.
(elf_x86_64_link_setup_gnu_properties): Updated.  Call
_bfd_x86_elf_link_setup_gnu_properties.
* elfxx-x86.c: Include elf-vxworks.h".
(_bfd_x86_elf_link_setup_gnu_properties): New function.
* elfxx-x86.h (elf_x86_lazy_plt_layout): Remove "for i386 only"
comments for pic_plt0_entry and pic_plt_entry.
(elf_x86_non_lazy_plt_layout): Likewise.
(elf_x86_plt_layout_table): New.
(_bfd_x86_elf_link_setup_gnu_properties): Likewise.
bfd/ChangeLog
bfd/elf32-i386.c
bfd/elf64-x86-64.c
bfd/elfxx-x86.c
bfd/elfxx-x86.h