aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfxx-x86.h
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-09-01 08:00:36 -0700
committerH.J. Lu <hjl.tools@gmail.com>2017-09-01 08:00:51 -0700
commita6798baba212170e427d2f9bd99af12f1078b162 (patch)
tree5dfcb207d647aff488599dccbac51f25241e4d8b /bfd/elfxx-x86.h
parent376dc015f275575e0aa7be9c46476db5506ff836 (diff)
downloadgdb-a6798baba212170e427d2f9bd99af12f1078b162.zip
gdb-a6798baba212170e427d2f9bd99af12f1078b162.tar.gz
gdb-a6798baba212170e427d2f9bd99af12f1078b162.tar.bz2
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.
Diffstat (limited to 'bfd/elfxx-x86.h')
-rw-r--r--bfd/elfxx-x86.h31
1 files changed, 27 insertions, 4 deletions
diff --git a/bfd/elfxx-x86.h b/bfd/elfxx-x86.h
index 45f2458..f0240b3 100644
--- a/bfd/elfxx-x86.h
+++ b/bfd/elfxx-x86.h
@@ -159,11 +159,11 @@ struct elf_x86_lazy_plt_layout
unsigned int plt_lazy_offset;
/* The first entry in a PIC lazy procedure linkage table looks like
- this. This is used for i386 only. */
+ this. */
const bfd_byte *pic_plt0_entry;
/* Subsequent entries in a PIC lazy procedure linkage table look
- like this. This is used for i386 only. */
+ like this. */
const bfd_byte *pic_plt_entry;
/* .eh_frame covering the lazy .plt section. */
@@ -176,8 +176,7 @@ struct elf_x86_non_lazy_plt_layout
/* Entries in an absolute non-lazy procedure linkage table look like
this. */
const bfd_byte *plt_entry;
- /* Entries in a PIC non-lazy procedure linkage table look like this.
- This is used for i386 only. */
+ /* Entries in a PIC non-lazy procedure linkage table look like this. */
const bfd_byte *pic_plt_entry;
unsigned int plt_entry_size; /* Size of each PLT entry. */
@@ -304,6 +303,27 @@ struct elf_x86_link_hash_table
const char *tls_get_addr;
};
+struct elf_x86_plt_layout_table
+{
+ /* The lazy PLT layout. */
+ const struct elf_x86_lazy_plt_layout *lazy_plt;
+
+ /* The non-lazy PLT layout. */
+ const struct elf_x86_non_lazy_plt_layout *non_lazy_plt;
+
+ /* The lazy PLT layout for IBT. */
+ const struct elf_x86_lazy_plt_layout *lazy_ibt_plt;
+
+ /* The non-lazy PLT layout for IBT. */
+ const struct elf_x86_non_lazy_plt_layout *non_lazy_ibt_plt;
+
+ /* TRUE if this is an normal x86 target. */
+ bfd_boolean normal_target;
+
+ /* TRUE if this is a VxWorks x86 target. */
+ bfd_boolean is_vxworks;
+};
+
struct elf_x86_obj_tdata
{
struct elf_obj_tdata root;
@@ -403,6 +423,9 @@ extern enum elf_property_kind _bfd_x86_elf_parse_gnu_properties
extern bfd_boolean _bfd_x86_elf_merge_gnu_properties
(struct bfd_link_info *, bfd *, elf_property *, elf_property *);
+extern bfd * _bfd_x86_elf_link_setup_gnu_properties
+ (struct bfd_link_info *, struct elf_x86_plt_layout_table *);
+
#define bfd_elf64_bfd_link_hash_table_create \
_bfd_x86_elf_link_hash_table_create
#define bfd_elf32_bfd_link_hash_table_create \