Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src PR 54093: Align static TLS area to max_align_t.



details:   https://anonhg.NetBSD.org/src/rev/40d774fe0fc3
branches:  trunk
changeset: 460804:40d774fe0fc3
user:      joerg <joerg%NetBSD.org@localhost>
date:      Mon Nov 04 12:45:10 2019 +0000

description:
PR 54093: Align static TLS area to max_align_t.

diffstat:

 lib/libc/tls/Makefile.inc  |  4 ++--
 lib/libc/tls/tls.c         |  6 +++---
 libexec/ld.elf_so/Makefile |  3 ++-
 libexec/ld.elf_so/tls.c    |  7 ++++---
 usr.bin/ldd/Makefile.elf   |  4 +++-
 5 files changed, 14 insertions(+), 10 deletions(-)

diffs (107 lines):

diff -r c698b63d9bc9 -r 40d774fe0fc3 lib/libc/tls/Makefile.inc
--- a/lib/libc/tls/Makefile.inc Mon Nov 04 11:33:01 2019 +0000
+++ b/lib/libc/tls/Makefile.inc Mon Nov 04 12:45:10 2019 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.inc,v 1.2 2011/03/12 07:55:09 matt Exp $
+#      $NetBSD: Makefile.inc,v 1.3 2019/11/04 12:45:10 joerg Exp $
 
 .include <bsd.own.mk>
 
@@ -6,4 +6,4 @@
 .PATH: ${.PARSEDIR} ${ARCHDIR}/tls
 
 SRCS+=                 tls.c
-CPPFLAGS.tls.c+=       -D_LIBC_SOURCE
+CPPFLAGS.tls.c+=       -D_LIBC_SOURCE -std=gnu11
diff -r c698b63d9bc9 -r 40d774fe0fc3 lib/libc/tls/tls.c
--- a/lib/libc/tls/tls.c        Mon Nov 04 11:33:01 2019 +0000
+++ b/lib/libc/tls/tls.c        Mon Nov 04 12:45:10 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tls.c,v 1.9 2018/07/13 19:50:21 joerg Exp $    */
+/*     $NetBSD: tls.c,v 1.10 2019/11/04 12:45:10 joerg Exp $   */
 
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: tls.c,v 1.9 2018/07/13 19:50:21 joerg Exp $");
+__RCSID("$NetBSD: tls.c,v 1.10 2019/11/04 12:45:10 joerg Exp $");
 
 #include "namespace.h"
 
@@ -85,7 +85,7 @@
 
        if (initial_thread_tcb == NULL) {
 #ifdef __HAVE_TLS_VARIANT_II
-               tls_size = roundup2(tls_size, sizeof(void *));
+               tls_size = roundup2(tls_size, sizeof(max_align_t));
 #endif
                tls_allocation = tls_size + sizeof(*tcb);
 
diff -r c698b63d9bc9 -r 40d774fe0fc3 libexec/ld.elf_so/Makefile
--- a/libexec/ld.elf_so/Makefile        Mon Nov 04 11:33:01 2019 +0000
+++ b/libexec/ld.elf_so/Makefile        Mon Nov 04 12:45:10 2019 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile,v 1.141 2019/04/03 21:37:58 christos Exp $
+#      $NetBSD: Makefile,v 1.142 2019/11/04 12:45:10 joerg Exp $
 #
 # NOTE: when changing ld.so, ensure that ldd still compiles.
 #
@@ -92,6 +92,7 @@
 
 BINDIR=                ${SHLINKINSTALLDIR}
 
+CPPFLAGS.tls.c+=       -std=gnu11
 CPPFLAGS+=     -DLIBDIR=\"${LIBDIR}\" -D_PATH_RTLD=\"${BINDIR}/${PROG}\"
 CPPFLAGS+=     -I${.CURDIR} -I. -D_KERNTYPES
 CPPFLAGS+=     -DRTLD_LOADER
diff -r c698b63d9bc9 -r 40d774fe0fc3 libexec/ld.elf_so/tls.c
--- a/libexec/ld.elf_so/tls.c   Mon Nov 04 11:33:01 2019 +0000
+++ b/libexec/ld.elf_so/tls.c   Mon Nov 04 12:45:10 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tls.c,v 1.12 2019/04/13 00:23:32 rin Exp $     */
+/*     $NetBSD: tls.c,v 1.13 2019/11/04 12:45:10 joerg Exp $   */
 /*-
  * Copyright (c) 2011 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,11 +29,12 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: tls.c,v 1.12 2019/04/13 00:23:32 rin Exp $");
+__RCSID("$NetBSD: tls.c,v 1.13 2019/11/04 12:45:10 joerg Exp $");
 
 #include <sys/param.h>
 #include <sys/ucontext.h>
 #include <lwp.h>
+#include <stddef.h>
 #include <string.h>
 #include "debug.h"
 #include "rtld.h"
@@ -99,7 +100,7 @@
 
 #ifndef __HAVE_TLS_VARIANT_I
        _rtld_tls_static_space = roundup2(_rtld_tls_static_space,
-           sizeof(void *));
+           sizeof(max_align_t));
 #endif
        dbg(("_rtld_tls_static_space %zu", _rtld_tls_static_space));
 
diff -r c698b63d9bc9 -r 40d774fe0fc3 usr.bin/ldd/Makefile.elf
--- a/usr.bin/ldd/Makefile.elf  Mon Nov 04 11:33:01 2019 +0000
+++ b/usr.bin/ldd/Makefile.elf  Mon Nov 04 12:45:10 2019 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.elf,v 1.5 2013/05/07 13:00:35 christos Exp $
+#      $NetBSD: Makefile.elf,v 1.6 2019/11/04 12:45:10 joerg Exp $
 
 # Makefile fragment to build a (32 or 64 bit) libldd_elfxx.a.
 # Expects CPPFLAGS to have ELFSIZE set, and LIB to be set.
@@ -7,4 +7,6 @@
 SRCS+= xmalloc.c debug.c expand.c map_object.c load.c search.c \
        headers.c paths.c tls.c symver.c
 
+CPPFLAGS.tls.c+=       -std=gnu11
+
 .include "Makefile.common"



Home | Main Index | Thread Index | Old Index