From patchwork Tue Jul 5 07:00:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1652310 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=fezsGJSN; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LcYVS4x2Fz9s1l for ; Tue, 5 Jul 2022 17:01:04 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 734D33857426 for ; Tue, 5 Jul 2022 07:01:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 734D33857426 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1657004462; bh=Q9HaUwZr4hNC5WvGPWZ1gkl/DOSuXlOmqjooUlsMWQ4=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=fezsGJSNsTild4duFa/9Yp3rZh19Tq77L06tIaN64/LZ4MSLLX9b2H1dW/HL9HnaP 168WCZe+1arTz8poQjVzCCQJAcaGDXGXWdfe+Dr0V4rMH9QQyPhBDbAAtSWiFPDihO OT1ezHAC0Q6odV9JdL4DzvXVU925u/e/3gkqWRlw= 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 758B9385828E for ; Tue, 5 Jul 2022 07:00:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 758B9385828E Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-637-tjue7V_ZMHGM66yYmYtI_A-1; Tue, 05 Jul 2022 03:00:42 -0400 X-MC-Unique: tjue7V_ZMHGM66yYmYtI_A-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 434223800C2D for ; Tue, 5 Jul 2022 07:00:42 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.103]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9D28F492C3B for ; Tue, 5 Jul 2022 07:00:41 +0000 (UTC) To: libc-alpha@sourceware.org Subject: [PATCH] elf: Fix direction of NODELETE log messages during symbol lookup Date: Tue, 05 Jul 2022 09:00:39 +0200 Message-ID: <87pmik59ig.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.9 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_LOW, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE 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+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" NODELETE status is propagated from the referencing object to the referenced object, not the other way round. The code is correct, only the log message has the wrong direction. Tested on i686-linux-gnu and x86_64-linux-gnu. Reviewed-by: Adhemerval Zanella --- elf/dl-lookup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c index 8cb32321da..4c86dc694e 100644 --- a/elf/dl-lookup.c +++ b/elf/dl-lookup.c @@ -646,11 +646,11 @@ add_dependency (struct link_map *undef_map, struct link_map *map, int flags) { if (undef_map->l_name[0] == '\0') _dl_debug_printf ("\ -marking %s [%lu] as NODELETE due to reference to main program\n", +marking %s [%lu] as NODELETE due to reference from main program\n", map->l_name, map->l_ns); else _dl_debug_printf ("\ -marking %s [%lu] as NODELETE due to reference to %s [%lu]\n", +marking %s [%lu] as NODELETE due to reference from %s [%lu]\n", map->l_name, map->l_ns, undef_map->l_name, undef_map->l_ns); }