aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-i386.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2018-05-28 10:46:16 -0700
committerH.J. Lu <hjl.tools@gmail.com>2018-05-28 10:46:16 -0700
commit92e68c1d65f844c0027f471a0c9e1722d781ef7d (patch)
tree548256bb8779e724bf0292bc8e976feaaf8d43d1 /bfd/elf32-i386.c
parentac98f9e2275ffcca560eaa0bddd282a1ff94fc28 (diff)
downloadgdb-92e68c1d65f844c0027f471a0c9e1722d781ef7d.zip
gdb-92e68c1d65f844c0027f471a0c9e1722d781ef7d.tar.gz
gdb-92e68c1d65f844c0027f471a0c9e1722d781ef7d.tar.bz2
x86-64: Add TLSDESC fields to elf_x86_lazy_plt_layout
ENDBR64 is added to the special TLSDESC entry, which is similar to the PLT0 entry, in the x86-64 lazy procedure linkage table to support Intel CET. The NaCl PLT is different from the normal PLT. This patch adds plt_tlsdesc_entry, plt_tlsdesc_entry_size, plt_tlsdesc_got1_offset, plt_tlsdesc_got2_offset, plt_tlsdesc_got1_insn_end and plt_tlsdesc_got2_insn_end to elf_x86_lazy_plt_layout to support both normal and NaCl TLSDESC entries. This fixed FAIL: TLS descriptor -fpic -shared transitions for x86_64-nacl. * elf32-i386.c (elf_i386_lazy_plt): Add plt_tlsdesc_entry, plt_tlsdesc_entry_size, plt_tlsdesc_got1_offset, plt_tlsdesc_got2_offset, plt_tlsdesc_got1_insn_end and plt_tlsdesc_got2_insn_end for TLSDESC entry. (elf_i386_lazy_ibt_plt): Likewise. (elf_i386_nacl_plt): Likewise. * elf64-x86-64.c (tlsdesc_plt_entry): Moved and renamed to ... (elf_x86_64_tlsdesc_plt_entry): This. (elf_x86_64_lazy_plt): Add plt_tlsdesc_entry, plt_tlsdesc_entry_size, plt_tlsdesc_got1_offset, plt_tlsdesc_got2_offset, plt_tlsdesc_got1_insn_end and plt_tlsdesc_got2_insn_end for TLSDESC entry. (elf_x86_64_lazy_bnd_plt): Likewise. (elf_x86_64_lazy_ibt_plt): Likewise. (elf_x32_lazy_ibt_plt): Likewise. (elf_x86_64_nacl_plt): Likewise. (elf_x86_64_finish_dynamic_sections): Use plt_tlsdesc_entry, plt_tlsdesc_entry_size, plt_tlsdesc_got1_offset, plt_tlsdesc_got2_offset, plt_tlsdesc_got1_insn_end and plt_tlsdesc_got2_insn_end to update TLSDESC entry. * elfxx-x86.h (elf_x86_lazy_plt_layout): Update comments. Add plt_tlsdesc_entry, plt_tlsdesc_entry_size, plt_tlsdesc_got1_offset, plt_tlsdesc_got2_offset, plt_tlsdesc_got1_insn_end and plt_tlsdesc_got2_insn_end. (elf_x86_non_lazy_plt_layout): Update comments. (elf_x86_plt_layout): Likewise.
Diffstat (limited to 'bfd/elf32-i386.c')
-rw-r--r--bfd/elf32-i386.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c
index 3dd709a..49797dc 100644
--- a/bfd/elf32-i386.c
+++ b/bfd/elf32-i386.c
@@ -766,6 +766,12 @@ static const struct elf_x86_lazy_plt_layout elf_i386_lazy_plt =
sizeof (elf_i386_lazy_plt0_entry), /* plt0_entry_size */
elf_i386_lazy_plt_entry, /* plt_entry */
LAZY_PLT_ENTRY_SIZE, /* plt_entry_size */
+ NULL, /* plt_tlsdesc_entry */
+ 0, /* plt_tlsdesc_entry_size*/
+ 0, /* plt_tlsdesc_got1_offset */
+ 0, /* plt_tlsdesc_got2_offset */
+ 0, /* plt_tlsdesc_got1_insn_end */
+ 0, /* plt_tlsdesc_got2_insn_end */
2, /* plt0_got1_offset */
8, /* plt0_got2_offset */
0, /* plt0_got2_insn_end */
@@ -798,6 +804,12 @@ static const struct elf_x86_lazy_plt_layout elf_i386_lazy_ibt_plt =
sizeof (elf_i386_lazy_ibt_plt0_entry), /* plt0_entry_size */
elf_i386_lazy_ibt_plt_entry, /* plt_entry */
LAZY_PLT_ENTRY_SIZE, /* plt_entry_size */
+ NULL, /* plt_tlsdesc_entry */
+ 0, /* plt_tlsdesc_entry_size*/
+ 0, /* plt_tlsdesc_got1_offset */
+ 0, /* plt_tlsdesc_got2_offset */
+ 0, /* plt_tlsdesc_got1_insn_end */
+ 0, /* plt_tlsdesc_got2_insn_end */
2, /* plt0_got1_offset */
8, /* plt0_got2_offset */
0, /* plt0_got2_insn_end */
@@ -4728,6 +4740,12 @@ static const struct elf_x86_lazy_plt_layout elf_i386_nacl_plt =
sizeof (elf_i386_nacl_plt0_entry), /* plt0_entry_size */
elf_i386_nacl_plt_entry, /* plt_entry */
NACL_PLT_ENTRY_SIZE, /* plt_entry_size */
+ NULL, /* plt_tlsdesc_entry */
+ 0, /* plt_tlsdesc_entry_size*/
+ 0, /* plt_tlsdesc_got1_offset */
+ 0, /* plt_tlsdesc_got2_offset */
+ 0, /* plt_tlsdesc_got1_insn_end */
+ 0, /* plt_tlsdesc_got2_insn_end */
2, /* plt0_got1_offset */
8, /* plt0_got2_offset */
0, /* plt0_got2_insn_end */