diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2018-03-25 05:02:17 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2018-03-25 05:02:32 -0700 |
commit | bf54968b128a2133174d81c438d402ecfaf83042 (patch) | |
tree | fadfbd0205867e75b54346add9cb3e22eef3df4b /ld/testsuite | |
parent | b3ee71e749f3c93c51cd6fb3fed51ffd54243117 (diff) | |
download | gdb-bf54968b128a2133174d81c438d402ecfaf83042.zip gdb-bf54968b128a2133174d81c438d402ecfaf83042.tar.gz gdb-bf54968b128a2133174d81c438d402ecfaf83042.tar.bz2 |
x86-64: Add ENDBR64 to the TLSDESC PLT entry
The TLSDESC entry in a lazy procedure linkage table is called indirectly
with "callq *(%rax)". This patch adds an ENDBR64 to support indirect
branch tracking in Intel CET. The TLSDESC PLT entry now looks like:
0xf3, 0x0f, 0x1e, 0xfa, /* endbr64 */
0xff, 0x35, 8, 0, 0, 0, /* pushq GOT+8(%rip) */
0xff, 0x25, 16, 0, 0, 0 /* jmpq *GOT+TDG(%rip) */
The BND prefix isn't needed since MPX isn't used for TLSDESC.
bfd/
PR ld/23000
* elf64-x86-64.c (elf_x86_64_finish_dynamic_sections): Add
ENDBR64 to the TLSDESC PLT entry.
ld/
PR ld/23000
* testsuite/ld-x86-64/tlsdesc.pd: Updated.
Diffstat (limited to 'ld/testsuite')
-rw-r--r-- | ld/testsuite/ld-x86-64/tlsdesc.pd | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ld/testsuite/ld-x86-64/tlsdesc.pd b/ld/testsuite/ld-x86-64/tlsdesc.pd index 0fa36f3..08b4fa3 100644 --- a/ld/testsuite/ld-x86-64/tlsdesc.pd +++ b/ld/testsuite/ld-x86-64/tlsdesc.pd @@ -13,7 +13,7 @@ Disassembly of section .plt: [0-9a-f]+: ff 35 .. .. 20 00 pushq .*\(%rip\) # 201358 <_GLOBAL_OFFSET_TABLE_\+0x8> [0-9a-f]+: ff 25 .. .. 20 00 jmpq \*.*\(%rip\) # 201360 <_GLOBAL_OFFSET_TABLE_\+0x10> [0-9a-f]+: 0f 1f 40 00 nopl 0x0\(%rax\) + [0-9a-f]+: f3 0f 1e fa endbr64 [0-9a-f]+: ff 35 .. .. 20 00 pushq .*\(%rip\) # 201358 <_GLOBAL_OFFSET_TABLE_\+0x8> [0-9a-f]+: ff 25 .. .. 20 00 jmpq \*.*\(%rip\) # 201348 <.*> - [0-9a-f]+: 0f 1f 40 00 nopl 0x0\(%rax\) |