diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2018-07-17 16:07:03 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2018-07-17 16:07:17 -0700 |
commit | 562837c002e42f7f0a95764e3883898f05a59327 (patch) | |
tree | 0d85bc7d10b4616ee64c79db0d25d2cc8789b568 /sysdeps/x86_64 | |
parent | 124bcde683d5d8b5c26bd2f535edcf3b7ab6108c (diff) | |
download | glibc-562837c002e42f7f0a95764e3883898f05a59327.tar glibc-562837c002e42f7f0a95764e3883898f05a59327.tar.gz glibc-562837c002e42f7f0a95764e3883898f05a59327.tar.bz2 glibc-562837c002e42f7f0a95764e3883898f05a59327.zip |
x86: Add _CET_ENDBR to functions in dl-tlsdesc.S
Add _CET_ENDBR to functions in dl-tlsdesc.S, which are called indirectly,
to support IBT.
Tested on i686 and x86-64.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* sysdeps/i386/dl-tlsdesc.S (_dl_tlsdesc_return): Add
_CET_ENDBR.
(_dl_tlsdesc_undefweak): Likewise.
(_dl_tlsdesc_dynamic): Likewise.
(_dl_tlsdesc_resolve_abs_plus_addend): Likewise.
(_dl_tlsdesc_resolve_rel): Likewise.
(_dl_tlsdesc_resolve_rela): Likewise.
(_dl_tlsdesc_resolve_hold): Likewise.
* sysdeps/x86_64/dl-tlsdesc.S (_dl_tlsdesc_return): Likewise.
(_dl_tlsdesc_undefweak): Likewise.
(_dl_tlsdesc_dynamic): Likewise.
(_dl_tlsdesc_resolve_rela): Likewise.
(_dl_tlsdesc_resolve_hold): Likewise.
Diffstat (limited to 'sysdeps/x86_64')
-rw-r--r-- | sysdeps/x86_64/dl-tlsdesc.S | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sysdeps/x86_64/dl-tlsdesc.S b/sysdeps/x86_64/dl-tlsdesc.S index 437bd8cde7..80d771cd88 100644 --- a/sysdeps/x86_64/dl-tlsdesc.S +++ b/sysdeps/x86_64/dl-tlsdesc.S @@ -37,6 +37,7 @@ cfi_startproc .align 16 _dl_tlsdesc_return: + _CET_ENDBR movq 8(%rax), %rax ret cfi_endproc @@ -58,6 +59,7 @@ _dl_tlsdesc_return: cfi_startproc .align 16 _dl_tlsdesc_undefweak: + _CET_ENDBR movq 8(%rax), %rax subq %fs:0, %rax ret @@ -96,6 +98,7 @@ _dl_tlsdesc_dynamic (register struct tlsdesc *tdp asm ("%rax")) cfi_startproc .align 16 _dl_tlsdesc_dynamic: + _CET_ENDBR /* Preserve call-clobbered registers that we modify. We need two scratch regs anyway. */ movq %rsi, -16(%rsp) @@ -166,6 +169,7 @@ _dl_tlsdesc_dynamic: .align 16 /* The PLT entry will have pushed the link_map pointer. */ _dl_tlsdesc_resolve_rela: + _CET_ENDBR cfi_adjust_cfa_offset (8) /* Save all call-clobbered registers. Add 8 bytes for push in the PLT entry to align the stack. */ @@ -216,6 +220,7 @@ _dl_tlsdesc_resolve_rela: .align 16 _dl_tlsdesc_resolve_hold: 0: + _CET_ENDBR /* Save all call-clobbered registers. */ subq $72, %rsp cfi_adjust_cfa_offset (72) |