From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2138) id 950C33858D37; Mon, 27 Mar 2023 08:07:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 950C33858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1679904429; bh=kXeeICtP4wxyCWex0bsC/EerCme7qf5Cq5JnXG7asws=; h=From:To:Subject:Date:From; b=XtSLcx9SR3vWcepIF+DZUJ9th3/LWvOWPpio85wIFeO4//Wv5Yr27l7ylaNXIalpO qYSBkboePDM8LDYP+rw9PQi0ZcuEn2lifgJZWvMDlqxBMi7ru7A3Jktp0o5IJAH+14 4MDCa7mcjZ8f8y+kIyNo4Oj+dxE6axEgpaflTSqo= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Andreas Schwab To: glibc-cvs@sourceware.org Subject: [glibc] _dl_map_object_from_fd: Remove unnecessary debugger notification in error path X-Act-Checkin: glibc X-Git-Author: Andreas Schwab X-Git-Refname: refs/heads/master X-Git-Oldrev: ab991a3d1b401ded6bd4f027352da8262b021a11 X-Git-Newrev: 152f863926e77c6f9c9a8b8779c8084eb844ec44 Message-Id: <20230327080709.950C33858D37@sourceware.org> Date: Mon, 27 Mar 2023 08:07:09 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=152f863926e77c6f9c9a8b8779c8084eb844ec44 commit 152f863926e77c6f9c9a8b8779c8084eb844ec44 Author: Andreas Schwab Date: Thu Mar 23 16:18:50 2023 +0100 _dl_map_object_from_fd: Remove unnecessary debugger notification in error path 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. Diff: --- 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);