From patchwork Fri Aug 4 18:16:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 73633 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A7087385703C for ; Fri, 4 Aug 2023 18:16:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A7087385703C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1691173008; bh=DPv7whwnJAK6BzXkdGPDgyiDlTF62bSkONJ8q80W33c=; h=To:Subject:In-Reply-To:References:Date:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=xcFZZ7GnAh4/W2vii1b3htDB+sJ20g9k6Xx5wSomu+5b+1wdJ7auguXoZRISedF20 OKC13nvZxeFAYZeotA9SutxdUd8bDTXXJEWZCebLoebd3nyI6xNwqduBv5YvYHadX4 uyzV3ZteJn31t9+NFICsUivVkXLCS9DcFxuFGGL8= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 96385385772E for ; Fri, 4 Aug 2023 18:16:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 96385385772E Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-605-m4J597-3O_WMPw70lW5PGA-1; Fri, 04 Aug 2023 14:16:23 -0400 X-MC-Unique: m4J597-3O_WMPw70lW5PGA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 897C0101A528 for ; Fri, 4 Aug 2023 18:16:23 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.9]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3346F2166B25 for ; Fri, 4 Aug 2023 18:16:23 +0000 (UTC) To: libc-alpha@sourceware.org Subject: [PATCH 1/3] Linux: Avoid conflicting types in ld.so --list-diagnostics In-Reply-To: Message-ID: References: X-From-Line: a2c08b57a253edc65f05ef325ff9fcd04cc419d5 Mon Sep 17 00:00:00 2001 Date: Fri, 04 Aug 2023 20:16:22 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Florian Weimer via Libc-alpha From: Florian Weimer Reply-To: Florian Weimer Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" 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 --- 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; }