From acf7950ee5062e3ae5a2fa7f249ae3acb65d4517 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Wed, 31 Jan 2024 13:47:04 -0800 Subject: [PATCH] rtld: Reduce diff with upstream in allocate_tls Only copy over tls_static_space bytes from the old TLS block to the new one. --- libexec/rtld-elf/rtld.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 8da7e099f67d..c2bb0035e21b 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -5767,7 +5767,7 @@ allocate_tls(Obj_Entry *objs, void *oldtcb, size_t tcbsize, size_t tcbalign) if (oldtcb != NULL) { memcpy(tls_block, get_tls_block_ptr(oldtcb, tcbsize), - tls_block_size); + tls_static_space); free(get_tls_block_ptr(oldtcb, tcbsize)); /* Adjust the DTV. */