1 From 3288c6da64add3b4561b8c10fff522027caea01c Mon Sep 17 00:00:00 2001
2 From: Nicholas Miell <nmiell@gmail.com>
3 Date: Sat, 17 Jun 2017 18:21:07 -0700
4 Subject: [PATCH] Align the stack on entry to __tls_get_addr()
6 Old versions of gcc (4 & 5) didn't align the stack according to the
7 AMD64 psABI when calling __tls_get_addr(). Apparently new versions of
8 gcc (7) got much more aggressive about vectorizing and generating MOVAPS
9 instructions, which means old binaries built with the buggy versions of
10 gcc are much more likely to crash when using versions of glibc built
13 For example, a large number of Linux games built using the Unity game
14 engine and available for purchase on Steam.
17 1 file changed, 4 insertions(+)
19 diff --git a/elf/dl-tls.c b/elf/dl-tls.c
20 index 5aba33b3fa..3f3cb917de 100644
23 @@ -827,6 +827,10 @@ rtld_hidden_proto (__tls_get_addr)
24 rtld_hidden_def (__tls_get_addr)
28 +/* Old versions of gcc didn't align the stack. */
29 +__attribute__((force_align_arg_pointer))
31 /* The generic dynamic and local dynamic model cannot be used in
32 statically linked applications. */