From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2178) id 2E5343858296; Wed, 23 Aug 2023 06:52:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2E5343858296 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1692773538; bh=x6IpGbTs3q27umt5avZ/gsuvQV4SS2CReGIzyuNPN4Y=; h=From:To:Subject:Date:From; b=k3oV4q7/3rcR1D/GjuMfL9MgxIvUrCXb63IJfBgZHczyg9MMCRRVBxfAAdn49TcII SgH3SvV66bymSVtaC2B/eVasaKb22G4c+bP5FrFwr49SOmSWo9tLJqIZH1KcJq/XgT OarGE0KeA0RcPHx4KNg2u57v5gnVZG4L5qgCeuO0= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Florian Weimer To: glibc-cvs@sourceware.org Subject: [glibc] Linux: Avoid conflicting types in ld.so --list-diagnostics X-Act-Checkin: glibc X-Git-Author: Florian Weimer X-Git-Refname: refs/heads/master X-Git-Oldrev: f6c8204fd7fabf0cf4162eaf10ccf23258e4d10e X-Git-Newrev: 65a5112ede9ba3e37e165cf6c9c432f46b903936 Message-Id: <20230823065218.2E5343858296@sourceware.org> Date: Wed, 23 Aug 2023 06:52:18 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=65a5112ede9ba3e37e165cf6c9c432f46b903936 commit 65a5112ede9ba3e37e165cf6c9c432f46b903936 Author: Florian Weimer 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 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; }