public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Florian Weimer <fw@sourceware.org>
To: glibc-cvs@sourceware.org
Subject: [glibc] Linux: Avoid conflicting types in ld.so --list-diagnostics
Date: Wed, 23 Aug 2023 06:52:18 +0000 (GMT)	[thread overview]
Message-ID: <20230823065218.2E5343858296@sourceware.org> (raw)

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

commit 65a5112ede9ba3e37e165cf6c9c432f46b903936
Author: Florian Weimer <fweimer@redhat.com>
Date:   Fri Aug 4 12:44:01 2023 +0200

    Linux: Avoid conflicting types in ld.so --list-diagnostics
    
    The path auxv[*].a_val could either be an integer or a string,
    depending on the a_type value.  Use a separate field, a_val_string, to
    simplify mechanical parsing of the --list-diagnostics output.
    
    Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>

Diff:
---
 sysdeps/unix/sysv/linux/dl-diagnostics-kernel.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/dl-diagnostics-kernel.c b/sysdeps/unix/sysv/linux/dl-diagnostics-kernel.c
index e0cfa63da6..d522e2797e 100644
--- a/sysdeps/unix/sysv/linux/dl-diagnostics-kernel.c
+++ b/sysdeps/unix/sysv/linux/dl-diagnostics-kernel.c
@@ -30,16 +30,19 @@ print_auxv (void)
   for (ElfW(auxv_t) *av = GLRO(dl_auxv); av->a_type != AT_NULL; ++av)
     {
       _dl_printf ("auxv[0x%x].a_type=0x%lx\n"
-                  "auxv[0x%x].a_val=",
+                  "auxv[0x%x].a_val",
                   index, (unsigned long int) av->a_type, index);
       if (av->a_type == AT_EXECFN
           || av->a_type == AT_PLATFORM
           || av->a_type == AT_BASE_PLATFORM)
-        /* The address of the strings is not useful at all, so print
-           the strings themselves.  */
-        _dl_diagnostics_print_string ((const char *) av->a_un.a_val);
+        {
+          /* The address of the strings is not useful at all, so print
+             the strings themselves.  */
+          _dl_printf ("_string=");
+          _dl_diagnostics_print_string ((const char *) av->a_un.a_val);
+        }
       else
-        _dl_printf ("0x%lx", (unsigned long int) av->a_un.a_val);
+        _dl_printf ("=0x%lx", (unsigned long int) av->a_un.a_val);
       _dl_printf ("\n");
       ++index;
     }

                 reply	other threads:[~2023-08-23  6:52 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=20230823065218.2E5343858296@sourceware.org \
    --to=fw@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).