elf: Remove any_debug from dl_main_state
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 6 Nov 2023 20:25:48 +0000 (17:25 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 21 Nov 2023 19:15:42 +0000 (16:15 -0300)
Its usage can be implied by the GLRO(dl_debug_mask).
Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
elf/dl-main.h
elf/rtld.c

index 92766d0..f876904 100644 (file)
@@ -97,9 +97,6 @@ struct dl_main_state
   /* True if program should be also printed for rtld_mode_trace.  */
   bool mode_trace_program;
 
-  /* True if any of the debugging options is enabled.  */
-  bool any_debug;
-
   /* True if information about versions has to be printed.  */
   bool version_info;
 };
index a09cf2a..7d4c843 100644 (file)
@@ -300,7 +300,6 @@ dl_main_state_init (struct dl_main_state *state)
   state->glibc_hwcaps_prepend = NULL;
   state->glibc_hwcaps_mask = NULL;
   state->mode = rtld_mode_normal;
-  state->any_debug = false;
   state->version_info = false;
 }
 
@@ -2481,7 +2480,6 @@ process_dl_debug (struct dl_main_state *state, const char *dl_debug)
                && memcmp (dl_debug, debopts[cnt].name, len) == 0)
              {
                GLRO(dl_debug_mask) |= debopts[cnt].mask;
-               state->any_debug = true;
                break;
              }
 
@@ -2676,7 +2674,7 @@ process_envvars (struct dl_main_state *state)
   /* If we have to run the dynamic linker in debugging mode and the
      LD_DEBUG_OUTPUT environment variable is given, we write the debug
      messages to this file.  */
-  else if (state->any_debug && debug_output != NULL)
+  else if (GLRO(dl_debug_mask) != 0 && debug_output != NULL)
     {
       const int flags = O_WRONLY | O_APPEND | O_CREAT | O_NOFOLLOW;
       size_t name_len = strlen (debug_output);