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: 73009 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 9232B3858C2B for ; Thu, 20 Jul 2023 16:53:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9232B3858C2B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1689872030; bh=zyNRDx3aDHHYmCeITOir5mLMvFt2lNKIzBIb3WamPic=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=qy7DG+p78McfKfLS1lQTD/n6F8EeCuNibeoFnis6+SVCuJw/nArtZt4y6W5VTIoP0 0F1pmHiqIJ12VVVcmHlRb3HXcnNeCqINUKN/u4vc/FNXyf00saRV4LBhtZboqW7G2n nUtpeAs8YLFLcS7rcNaoPtIekyCrqkKPobeN1E0c= 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+patchwork=sourceware.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.) --- 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))