]> sourceware.org Git - glibc.git/commitdiff
_dl_map_object_from_fd: Remove unnecessary debugger notification in error path
authorAndreas Schwab <schwab@suse.de>
Thu, 23 Mar 2023 15:18:50 +0000 (16:18 +0100)
committerAndreas Schwab <schwab@suse.de>
Mon, 27 Mar 2023 08:06:07 +0000 (10:06 +0200)
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

index fcb39a78d4a19e41c4326f5ecbdc8795cf343182..9a0e40c0e99b7427264864d487df2069fd34d3b8 100644 (file)
@@ -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);
This page took 0.044644 seconds and 5 git commands to generate.