public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Adhemerval Zanella <azanella@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc] elf: Remove any_debug from dl_main_state
Date: Tue, 21 Nov 2023 20:49:32 +0000 (GMT)	[thread overview]
Message-ID: <20231121204932.ADDE6385840C@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a0f9bfc3a5cc10920787d70d0653720a8fa013f3

commit a0f9bfc3a5cc10920787d70d0653720a8fa013f3
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Mon Nov 6 17:25:48 2023 -0300

    elf: Remove any_debug from dl_main_state
    
    Its usage can be implied by the GLRO(dl_debug_mask).
    Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>

Diff:
---
 elf/dl-main.h | 3 ---
 elf/rtld.c    | 4 +---
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/elf/dl-main.h b/elf/dl-main.h
index 92766d06b4..f876904cb6 100644
--- a/elf/dl-main.h
+++ b/elf/dl-main.h
@@ -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;
 };
diff --git a/elf/rtld.c b/elf/rtld.c
index a09cf2a9df..7d4c843e7e 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -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);

                 reply	other threads:[~2023-11-21 20:49 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231121204932.ADDE6385840C@sourceware.org \
    --to=azanella@sourceware.org \
    --cc=glibc-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).