From patchwork Wed May 12 16:57:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 43397 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6153F399083F; Wed, 12 May 2021 16:57:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6153F399083F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1620838660; bh=ZaAct4yZu+Lb/1gkN8f95kcg3h6bO+uSjPMfK+ep7Hk=; h=To:Subject:In-Reply-To:References:Date:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=HaJKhHm+1CfBE97UunXvvHVXyjLtZvB+WVNDnP3sX2MGjNTt16k0Ev6XPn6LYhCER MSw6vY/IEsz6kbZaTYHm66BrFtb09KOLQhtDoaL91hKRS3bIb5Fg8YGZg5neu/cREL bjE5Z/7YHUKeDnTT6Fcbzn1pTQFEK09Ig5r9B8XQ= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 21AF4385380A for ; Wed, 12 May 2021 16:57:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 21AF4385380A Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-409-qcHQ94o7PK-ytodyr8MtSA-1; Wed, 12 May 2021 12:57:34 -0400 X-MC-Unique: qcHQ94o7PK-ytodyr8MtSA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A3C9880293B for ; Wed, 12 May 2021 16:57:32 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-112-137.ams2.redhat.com [10.36.112.137]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 07B36100164C for ; Wed, 12 May 2021 16:57:31 +0000 (UTC) To: libc-alpha@sourceware.org Subject: [PATCH 02/23] nptl: Move __nptl_create_event, __nptl_death_event into libc In-Reply-To: References: X-From-Line: 9f464e7bf0f0b5616ab3d8a2c107e89eb9cf732b Mon Sep 17 00:00:00 2001 Message-Id: <9f464e7bf0f0b5616ab3d8a2c107e89eb9cf732b.1620838411.git.fweimer@redhat.com> Date: Wed, 12 May 2021 18:57:29 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Florian Weimer via Libc-alpha From: Florian Weimer Reply-To: Florian Weimer Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" In libthread_db, use the exported GLIBC_PRIVATE symbols directly instead of relying on _thread_db_* variables in libpthread (which used to be created by the DB_FUNCTION macros). Reviewed-by: Adhemerval Zanella --- nptl/Makefile | 2 +- nptl/Versions | 2 ++ nptl/events.c | 4 ++-- nptl/pthreadP.h | 4 ++-- nptl_db/db-symbols.awk | 1 + nptl_db/structs.def | 11 +++++++---- 6 files changed, 15 insertions(+), 9 deletions(-) diff --git a/nptl/Makefile b/nptl/Makefile index 37a762d530..b57b010779 100644 --- a/nptl/Makefile +++ b/nptl/Makefile @@ -41,6 +41,7 @@ routines = \ elision-timed \ elision-trylock \ elision-unlock \ + events \ futex-internal \ libc-cleanup \ libc_multiple_threads \ @@ -200,7 +201,6 @@ shared-only-routines = forward static-only-routines = pthread_atfork libpthread-routines = \ - events \ libpthread-compat \ nptl-init \ pt-interp \ diff --git a/nptl/Versions b/nptl/Versions index fb3379b788..6e2def1b4c 100644 --- a/nptl/Versions +++ b/nptl/Versions @@ -351,6 +351,8 @@ libc { tss_set; } GLIBC_PRIVATE { + __nptl_create_event; + __nptl_death_event; __default_pthread_attr; __default_pthread_attr_lock; __futex_abstimed_wait64; diff --git a/nptl/events.c b/nptl/events.c index 5a07e58402..ab57fefd48 100644 --- a/nptl/events.c +++ b/nptl/events.c @@ -24,10 +24,10 @@ void __nptl_create_event (void) { } -hidden_def (__nptl_create_event) +libc_hidden_def (__nptl_create_event) void __nptl_death_event (void) { } -hidden_def (__nptl_death_event) +libc_hidden_def (__nptl_death_event) diff --git a/nptl/pthreadP.h b/nptl/pthreadP.h index dc2aece37e..a4a87cb549 100644 --- a/nptl/pthreadP.h +++ b/nptl/pthreadP.h @@ -337,8 +337,8 @@ rtld_hidden_proto (__nptl_initial_report_events) /* Event handlers for libthread_db interface. */ extern void __nptl_create_event (void); extern void __nptl_death_event (void); -hidden_proto (__nptl_create_event) -hidden_proto (__nptl_death_event) +libc_hidden_proto (__nptl_create_event) +libc_hidden_proto (__nptl_death_event) /* The fork generation counter, defined in libpthread. */ extern unsigned long int __fork_generation attribute_hidden; diff --git a/nptl_db/db-symbols.awk b/nptl_db/db-symbols.awk index 9e981537c8..6f326cf379 100644 --- a/nptl_db/db-symbols.awk +++ b/nptl_db/db-symbols.awk @@ -4,6 +4,7 @@ BEGIN { %define DB_RTLD_VARIABLE(name) /* Nothing. */ %define DB_MAIN_VARIABLE(name) /* Nothing. */ +%define DB_MAIN_SYMBOL(name) /* Nothing. */ %define DB_MAIN_ARRAY_VARIABLE(name) /* Nothing. */ %define DB_LOOKUP_NAME(idx, name) required[STRINGIFY (name)] = 1; %define DB_LOOKUP_NAME_TH_UNIQUE(idx, name) th_unique[STRINGIFY (name)] = 1; diff --git a/nptl_db/structs.def b/nptl_db/structs.def index 275c12bc7a..71c9f7bfc2 100644 --- a/nptl_db/structs.def +++ b/nptl_db/structs.def @@ -26,11 +26,14 @@ # define DB_RTLD_VARIABLE(name) DB_VARIABLE (name) #endif -/* DB_MAIN_VARIABLE and DB_MAIN_ARRAY_VARIABLE are not covered by the - libpthread symbol check in db-symbols.awk. */ +/* DB_MAIN_VARIABLE, DB_MAIN_SYMBOL, DB_MAIN_ARRAY_VARIABLE are not + covered by the libpthread symbol check in db-symbols.awk. */ #ifndef DB_MAIN_VARIABLE # define DB_MAIN_VARIABLE(name) DB_VARIABLE (name) #endif +#ifndef DB_MAIN_SYMBOL +# define DB_MAIN_SYMBOL(name) DB_SYMBOL (name) +#endif #ifndef DB_MAIN_ARRAY_VARIABLE # define DB_MAIN_ARRAY_VARIABLE(name) DB_ARRAY_VARIABLE (name) #endif @@ -75,8 +78,8 @@ DB_STRUCT_FIELD (td_eventbuf_t, eventnum) DB_STRUCT_FIELD (td_eventbuf_t, eventdata) DB_SYMBOL (nptl_version) -DB_FUNCTION (__nptl_create_event) -DB_FUNCTION (__nptl_death_event) +DB_MAIN_SYMBOL (__nptl_create_event) +DB_MAIN_SYMBOL (__nptl_death_event) DB_SYMBOL (__nptl_threads_events) DB_MAIN_VARIABLE (__nptl_nthreads) DB_VARIABLE (__nptl_last_event)