From nobody Mon Jun 05 19:33:51 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QZkLS05yNz4b2sm; Mon, 5 Jun 2023 19:33:52 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QZkLR6RHZz3tny; Mon, 5 Jun 2023 19:33:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685993631; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TaaR1jpeiaIrEju0CezlLbMp3eSpl4yHCx8aBdVBQvo=; b=xsxNeKjK01kyAub83fs/CDeF1+F6pwZGO9gdrZMAMm4+7fw3CibQPcRgbM6zSs6mJNccQz htWEFJPR8WGZjzvsO3KYPzEKDrF218rJayQG6ujS6iz4AryzBUaZyaiRw4seSflcS+nPRC SyDU7eYu3jyUFDUlKaCyhKVOOryk9ttVLXcvvpRKUN+/VAlqrvpEYtwAEAJeRfB8Xi3TJ1 pqU2iYaT468rI5AaXd9LS9Jbd7LuACMfzFixc2/tU0Whi9neYhgrpCya1HoUtQUd9PxwbJ XfVGyI815zTSFzWMuWPYjoXWzi1dvP1vhQeCOJnIivVNq69M0/sQz6IcV6zULQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1685993631; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TaaR1jpeiaIrEju0CezlLbMp3eSpl4yHCx8aBdVBQvo=; b=e0K/OQGrQzjnFEfeaHjTKfDIoh0ZtpiY8Z0wIq2FZGmbeHv1Adgkqh739Z87UMyTRgCMyD OJwq1Xx+qosWxa3EkJAqhcgQ4FVWLLN7xtbJVtGZGkH6UBmqKwYy7w83CXyU/kikMrCe6p vj+0msnQ/aBW0/lrHe8CYrXLbmDelJIWp55xBQAcfdOVFtfazGIJokMQrTfV7tRzmlp6oH 7B/++o0FzNx3rsQSYZJnUXSiWBEU9DLeawKij7r/KR3VbuEAa6H5ex/R5k1FhZoQNu+Q0p +MtOhuZaF/foYECkXtnhnNW/j/RrsJ56QgAJ58Ij35fi3MQvyNJl+Fltddo+ZA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1685993631; a=rsa-sha256; cv=none; b=M8QLGtYGR7FikzxnaRGElUSOuyiuVPth7jD7kBuBYfkoEpQhwWylqJ3r4YKrJAMpV+ca2x YvxVGK2R+kbyU0yKsVlcnxOrpoCzaIEZzw3InjY3kbJLCCxW7TK7BSelIKOoxCgaytKMDF Zd6MIm36EWt5mQRBI5JkUkgYgKOs7OhiQ6nAqcgsU0PjjORYCHdjS8KbO2/oxXgEwZoFSq Uj2jEWbv0cl8U45SNNLDSTf/NpTCJ+LiaSoC96AZT/Z+aoTJKjnFp94v/KH0ubnkIj6Xqu 6RIXRMoOtYsXQfXT9rju/Rrj0b98kHYy6+meXXFqzIQQTXmmK0b6AjfQVEHGuw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QZkLR5W6Nz119p; Mon, 5 Jun 2023 19:33:51 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 355JXpsB034261; Mon, 5 Jun 2023 19:33:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 355JXps2034260; Mon, 5 Jun 2023 19:33:51 GMT (envelope-from git) Date: Mon, 5 Jun 2023 19:33:51 GMT Message-Id: <202306051933.355JXps2034260@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 283a4f409731 - main - rtld: rename tls_done to tls_static List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 283a4f409731ba3a4eb1be41e151c20e8a960c03 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=283a4f409731ba3a4eb1be41e151c20e8a960c03 commit 283a4f409731ba3a4eb1be41e151c20e8a960c03 Author: Konstantin Belousov AuthorDate: 2023-06-05 00:43:55 +0000 Commit: Konstantin Belousov CommitDate: 2023-06-05 19:33:17 +0000 rtld: rename tls_done to tls_static The meaning of the flag is that static TLS allocation was done. Taken from NetBSD Joerg Sonnenberger change for src/libexec/ld.elf_so/tls.c rev. 1.18. Sponsored by: The FreeBSD Foundation MFC after: 1 week --- libexec/rtld-elf/aarch64/reloc.c | 2 +- libexec/rtld-elf/amd64/reloc.c | 4 ++-- libexec/rtld-elf/arm/reloc.c | 2 +- libexec/rtld-elf/i386/reloc.c | 2 +- libexec/rtld-elf/map_object.c | 2 +- libexec/rtld-elf/powerpc/reloc.c | 2 +- libexec/rtld-elf/powerpc64/reloc.c | 2 +- libexec/rtld-elf/riscv/reloc.c | 4 ++-- libexec/rtld-elf/rtld.c | 8 ++++---- libexec/rtld-elf/rtld.h | 2 +- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/libexec/rtld-elf/aarch64/reloc.c b/libexec/rtld-elf/aarch64/reloc.c index d83da4df0ec5..f9a1ae4c2b6c 100644 --- a/libexec/rtld-elf/aarch64/reloc.c +++ b/libexec/rtld-elf/aarch64/reloc.c @@ -470,7 +470,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, * modules. If we run out of space, we generate an * error. */ - if (!defobj->tls_done) { + if (!defobj->tls_static) { if (!allocate_tls_offset( __DECONST(Obj_Entry *, defobj))) { _rtld_error( diff --git a/libexec/rtld-elf/amd64/reloc.c b/libexec/rtld-elf/amd64/reloc.c index b92d89028d4e..2fdc10ad915f 100644 --- a/libexec/rtld-elf/amd64/reloc.c +++ b/libexec/rtld-elf/amd64/reloc.c @@ -258,7 +258,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, * dynamically loaded modules. If we run out * of space, we generate an error. */ - if (!defobj->tls_done) { + if (!defobj->tls_static) { if (!allocate_tls_offset( __DECONST(Obj_Entry *, defobj))) { _rtld_error("%s: No space available " @@ -279,7 +279,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, * dynamically loaded modules. If we run out * of space, we generate an error. */ - if (!defobj->tls_done) { + if (!defobj->tls_static) { if (!allocate_tls_offset( __DECONST(Obj_Entry *, defobj))) { _rtld_error("%s: No space available " diff --git a/libexec/rtld-elf/arm/reloc.c b/libexec/rtld-elf/arm/reloc.c index cfbddaeede75..b85c8b1f4845 100644 --- a/libexec/rtld-elf/arm/reloc.c +++ b/libexec/rtld-elf/arm/reloc.c @@ -279,7 +279,7 @@ reloc_nonplt_object(Obj_Entry *obj, const Elf_Rel *rel, SymCache *cache, if (def == NULL) return -1; - if (!defobj->tls_done && !allocate_tls_offset(obj)) + if (!defobj->tls_static && !allocate_tls_offset(obj)) return -1; tmp = (Elf_Addr)def->st_value + defobj->tlsoffset; diff --git a/libexec/rtld-elf/i386/reloc.c b/libexec/rtld-elf/i386/reloc.c index ae0a256e4033..bd8595f923df 100644 --- a/libexec/rtld-elf/i386/reloc.c +++ b/libexec/rtld-elf/i386/reloc.c @@ -242,7 +242,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, * dynamically loaded modules. If we run out * of space, we generate an error. */ - if (!defobj->tls_done) { + if (!defobj->tls_static) { if (!allocate_tls_offset( __DECONST(Obj_Entry *, defobj))) { _rtld_error("%s: No space available " diff --git a/libexec/rtld-elf/map_object.c b/libexec/rtld-elf/map_object.c index ff4bd513ee59..8c04183f7bca 100644 --- a/libexec/rtld-elf/map_object.c +++ b/libexec/rtld-elf/map_object.c @@ -433,7 +433,7 @@ obj_free(Obj_Entry *obj) { Objlist_Entry *elm; - if (obj->tls_done) + if (obj->tls_static) free_tls_offset(obj); while (obj->needed != NULL) { Needed_Entry *needed = obj->needed; diff --git a/libexec/rtld-elf/powerpc/reloc.c b/libexec/rtld-elf/powerpc/reloc.c index 27796cb18277..7fd6251c7dd5 100644 --- a/libexec/rtld-elf/powerpc/reloc.c +++ b/libexec/rtld-elf/powerpc/reloc.c @@ -252,7 +252,7 @@ reloc_nonplt_object(Obj_Entry *obj_rtld __unused, Obj_Entry *obj, * modules. If we run out of space, we generate an * error. */ - if (!defobj->tls_done) { + if (!defobj->tls_static) { if (!allocate_tls_offset( __DECONST(Obj_Entry *, defobj))) { _rtld_error("%s: No space available for static " diff --git a/libexec/rtld-elf/powerpc64/reloc.c b/libexec/rtld-elf/powerpc64/reloc.c index 2ca361168e0d..732d6ddff7c9 100644 --- a/libexec/rtld-elf/powerpc64/reloc.c +++ b/libexec/rtld-elf/powerpc64/reloc.c @@ -247,7 +247,7 @@ reloc_nonplt_object(Obj_Entry *obj_rtld __unused, Obj_Entry *obj, * modules. If we run out of space, we generate an * error. */ - if (!defobj->tls_done) { + if (!defobj->tls_static) { if (!allocate_tls_offset( __DECONST(Obj_Entry *, defobj))) { _rtld_error("%s: No space available for static " diff --git a/libexec/rtld-elf/riscv/reloc.c b/libexec/rtld-elf/riscv/reloc.c index 48d513b94ec6..b5dea298b74d 100644 --- a/libexec/rtld-elf/riscv/reloc.c +++ b/libexec/rtld-elf/riscv/reloc.c @@ -325,7 +325,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, * modules. If we run out of space, we generate an * error. */ - if (!defobj->tls_done) { + if (!defobj->tls_static) { if (!allocate_tls_offset( __DECONST(Obj_Entry *, defobj))) { _rtld_error( @@ -352,7 +352,7 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *obj_rtld, int flags, * modules. If we run out of space, we generate an * error. */ - if (!defobj->tls_done) { + if (!defobj->tls_static) { if (!allocate_tls_offset( __DECONST(Obj_Entry *, defobj))) { _rtld_error( diff --git a/libexec/rtld-elf/rtld.c b/libexec/rtld-elf/rtld.c index 2b833e350e5a..9ed9a4aed4bb 100644 --- a/libexec/rtld-elf/rtld.c +++ b/libexec/rtld-elf/rtld.c @@ -5474,11 +5474,11 @@ allocate_tls_offset(Obj_Entry *obj) { size_t off; - if (obj->tls_done) + if (obj->tls_static) return (true); if (obj->tlssize == 0) { - obj->tls_done = true; + obj->tls_static = true; return (true); } @@ -5509,7 +5509,7 @@ allocate_tls_offset(Obj_Entry *obj) tls_last_offset = off; tls_last_size = obj->tlssize; - obj->tls_done = true; + obj->tls_static = true; return (true); } @@ -5885,7 +5885,7 @@ distribute_static_tls(Objlist *list, RtldLockState *lockstate) return; STAILQ_FOREACH(elm, list, link) { obj = elm->obj; - if (obj->marker || !obj->tls_done || obj->static_tls_copied) + if (obj->marker || !obj->tls_static || obj->static_tls_copied) continue; distrib(obj->tlsoffset, obj->tlsinit, obj->tlsinitsize, obj->tlssize); diff --git a/libexec/rtld-elf/rtld.h b/libexec/rtld-elf/rtld.h index bb5119bfb744..025bf4ff0670 100644 --- a/libexec/rtld-elf/rtld.h +++ b/libexec/rtld-elf/rtld.h @@ -245,7 +245,7 @@ typedef struct Struct_Obj_Entry { bool traced : 1; /* Already printed in ldd trace output */ bool jmpslots_done : 1; /* Already have relocated the jump slots */ bool init_done : 1; /* Already have added object to init list */ - bool tls_done : 1; /* Already allocated offset for static TLS */ + bool tls_static : 1; /* Already allocated offset for static TLS */ bool phdr_alloc : 1; /* Phdr is allocated and needs to be freed. */ bool z_origin : 1; /* Process rpath and soname tokens */ bool z_nodelete : 1; /* Do not unload the object and dependencies */