From patchwork Thu Jul 20 16:53:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1810562 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=WYB59ImH; dkim-atps=neutral Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4R6Jfz1rF5z20FK for ; Fri, 21 Jul 2023 02:53:46 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 74473385AFBF for ; Thu, 20 Jul 2023 16:53:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 74473385AFBF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1689872023; bh=zyNRDx3aDHHYmCeITOir5mLMvFt2lNKIzBIb3WamPic=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=WYB59ImHweOEEyZWV/DL9T0+VfXQIFx6NTh2ZquRWY3aP1NvKgXMuiHkl9sTdXOti L0YYsdKJreiiuZeCNWB9SnVwPKr0G0Q8UWkFXXyRQ90iGqH0IMZHmmOOS1SD5hn/wU Xy/ryTEXUluHd0FtOyml8XWXonfLqTdZdX/Eh5PE= 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 [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 0F3F13858CDB for ; Thu, 20 Jul 2023 16:53:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0F3F13858CDB Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-177-i0cMwgB0MlWgI8XfBj5fyg-1; Thu, 20 Jul 2023 12:53:26 -0400 X-MC-Unique: i0cMwgB0MlWgI8XfBj5fyg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C8C04805BC3; Thu, 20 Jul 2023 16:53:25 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.13]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 160FBC2C857; Thu, 20 Jul 2023 16:53:24 +0000 (UTC) To: libc-alpha@sourceware.org Cc: libc-stable@sourceware.org Subject: [PATCH 2.34] debug: Mark libSegFault.so as NODELETE Date: Thu, 20 Jul 2023 18:53:23 +0200 Message-ID: <87cz0mmsn0.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.6 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_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" The signal handler installed in the ELF constructor cannot easily be removed again (because the program may have changed handlers in the meantime). Mark the object as NODELETE so that the registered handler function is never unloaded. Submitting this for 2.34 because libSegFault.so was removed in 2.35. Verified using readelf -dW that NODELETE is now set on libSegFault.so. (Note that there is no lib prefix on the LDFLAGS variable.) Reviewed-by: Carlos O'Donell --- debug/Makefile | 2 ++ 1 file changed, 2 insertions(+) base-commit: cad3adf4ddeada37912c1c13b59a2ea5dd5d2832 diff --git a/debug/Makefile b/debug/Makefile index 71248e0d45..9fbc40dc69 100644 --- a/debug/Makefile +++ b/debug/Makefile @@ -213,6 +213,8 @@ extra-libs-others = $(extra-libs) libSegFault-routines = segfault libSegFault-inhibit-o = $(filter-out .os,$(object-suffixes)) +# libSegFault.so installs a signal handler in its ELF constructor. +LDFLAGS-SegFault.so = -Wl,--enable-new-dtags,-z,nodelete libpcprofile-routines = pcprofile libpcprofile-inhibit-o = $(filter-out .os,$(object-suffixes))