From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id 4B60C3858CDB for ; Thu, 23 Mar 2023 16:32:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4B60C3858CDB Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 6EFA21FE09 for ; Thu, 23 Mar 2023 16:32:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1679589160; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=cVvrD3FMBOdFM6w1H/ymJCuQmgnPZ0bbgdoIIjGSg+w=; b=zwi5w0Tkjc9UCATlI4l+UBQjfRLlFNagh5QaaQEp2z+IuDFx+ivR1+l7hYKHR6TeyQk+z/ VF8JUpB0ksXzZvi8ad2xcMB56+4xcoTxBExL47F4gzzE2BdgT5ySdH3K0GbA8ixki9WGh6 DF5AfANBbnQSQiRZTXjofvEtEmjc42E= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1679589160; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type; bh=cVvrD3FMBOdFM6w1H/ymJCuQmgnPZ0bbgdoIIjGSg+w=; b=1lfLu0tLP5ZadAprmXTdSujnmbAEClV5mPGYHZh0dJ4INaO6I9CRI22NgeoQqhaVOhqjEX 3/jAO+Qb1M7pE4Aw== Received: from hawking.suse.de (unknown [10.168.4.11]) by relay2.suse.de (Postfix) with ESMTP id 6E4A02C141 for ; Thu, 23 Mar 2023 16:32:40 +0000 (UTC) Received: by hawking.suse.de (Postfix, from userid 17005) id 5B1464A0358; Thu, 23 Mar 2023 17:32:40 +0100 (CET) From: Andreas Schwab To: libc-alpha@sourceware.org Subject: [PATCH] _dl_map_object_from_fd: Remove unnecessary debugger notification in error path X-Yow: What a COINCIDENCE! I'm an authorized ``SNOOTS OF THE STARS'' dealer!! Date: Thu, 23 Mar 2023 17:32:40 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-9.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: After commit ed3ce71f5c ("elf: Move la_activity (LA_ACT_ADD) after _dl_add_to_namespace_list() (BZ #28062)") it is no longer necessary to reset the debugger state in the error case, since the debugger notification only happens after no more errors can occur. --- elf/dl-load.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/elf/dl-load.c b/elf/dl-load.c index fcb39a78d4..9a0e40c0e9 100644 --- a/elf/dl-load.c +++ b/elf/dl-load.c @@ -951,8 +951,6 @@ _dl_map_object_from_fd (const char *name, const char *origname, int fd, /* Initialize to keep the compiler happy. */ const char *errstring = NULL; int errval = 0; - struct r_debug *r = _dl_debug_update (nsid); - bool make_consistent = false; /* Get file information. To match the kernel behavior, do not fill in this information for the executable in case of an explicit @@ -984,14 +982,6 @@ _dl_map_object_from_fd (const char *name, const char *origname, int fd, free ((void *) l->l_phdr); free (l); free (realname); - - if (make_consistent && r != NULL) - { - r->r_state = RT_CONSISTENT; - _dl_debug_state (); - LIBC_PROBE (map_failed, 2, nsid, r); - } - _dl_signal_error (errval, name, NULL, errstring); } @@ -1494,6 +1484,7 @@ cannot enable executable stack as shared object requires"); _dl_add_to_namespace_list (l, nsid); /* Signal that we are going to add new objects. */ + struct r_debug *r = _dl_debug_update (nsid); if (r->r_state == RT_CONSISTENT) { #ifdef SHARED @@ -1510,7 +1501,6 @@ cannot enable executable stack as shared object requires"); r->r_state = RT_ADD; _dl_debug_state (); LIBC_PROBE (map_start, 2, nsid, r); - make_consistent = true; } else assert (r->r_state == RT_ADD); -- 2.40.0 -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different."