From patchwork Tue Oct 25 16:22:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 59401 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 5D1393856DF2 for ; Tue, 25 Oct 2022 16:22:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5D1393856DF2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666714949; bh=Ehl5rW0vEdMcEO5kBCU0/dwKLATlEnbp65yEgdQuX+k=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=e3MslqVkEvA6MA+nd1gqIrBPnZOGe3x0b6TIIH46uUINgnZx3Iu4lqUtynN9xBsds 4kidCA4HQFvM36IrYeSEBstEwE0VGMUlsLmyjSLg4od3oWcwndZDpYCXq6xfolMa/W LB05XsWdXYtgxT/uT4zo5gIp/orwQTzFqhikhdzg= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-oa1-x35.google.com (mail-oa1-x35.google.com [IPv6:2001:4860:4864:20::35]) by sourceware.org (Postfix) with ESMTPS id 2E512385AC35 for ; Tue, 25 Oct 2022 16:22:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2E512385AC35 Received: by mail-oa1-x35.google.com with SMTP id 586e51a60fabf-13b23e29e36so15499056fac.8 for ; Tue, 25 Oct 2022 09:22:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Ehl5rW0vEdMcEO5kBCU0/dwKLATlEnbp65yEgdQuX+k=; b=O+1CaOPcQcbJ/sTghAN6pkYgZlGVy9nxM7QWBFbv7+M6KCspPjUaMRMvXkOXH1LYN8 cxY3F8kRBNbQbzbrVqubHJsbtVbyTa+zk7OC9RrkcneyITfHHi1SQxjMZY9kHbSf6BuK ipOT3TyCq6poZXowy4b6Yvxy4mPRmy2t0YUwmmryJfltwMhm8kyXKPy/fIGLeN3V/Xez X1Ciz7NORSaQmpJW1P22hH1IDfd1wyJw2vV4txnfyMjkLIP6YXVTGr4s9MSKU3aiBWEl nbb7ShPFbus4z7wjS6cRDhZ6LI3MgUKIPR6jzjvw+mSS+nmGGmIM3pg2VE/Rdw6zQ+pJ 6DbA== X-Gm-Message-State: ACrzQf01s02FopJmxFE/CS9zvUMsENr9g43tqaSf9zI8k8wXMeg1Jzpk kbKTA+JYtW1Sz2muJgdfoscm2epRZnjvGyPz X-Google-Smtp-Source: AMsMyM5u8n3wiDGKdLNnp7k7melZ5GOf/64b3tby9381pDtl6tzgh8MXyrwy7UlKw2bxkzrB2dAoVQ== X-Received: by 2002:a05:6870:2191:b0:132:a213:3657 with SMTP id l17-20020a056870219100b00132a2133657mr24660625oae.13.1666714925302; Tue, 25 Oct 2022 09:22:05 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c0:17c8:3087:2940:1a7f:a5f3]) by smtp.gmail.com with ESMTPSA id l2-20020a05683016c200b006679a03a753sm390949otr.11.2022.10.25.09.22.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Oct 2022 09:22:04 -0700 (PDT) To: libc-alpha@sourceware.org, Andreas Schwab Subject: [PATCH] elf: Reinstate on DL_DEBUG_BINDINGS _dl_lookup_symbol_x Date: Tue, 25 Oct 2022 13:22:00 -0300 Message-Id: <20221025162200.997613-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-13.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=unavailable 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: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Reply-To: Adhemerval Zanella Cc: Siddhesh Poyarekar Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Sender: "Libc-alpha" The prelink removal done by 6628c742b2c16e wrongly removed the debug support. Checked on x86_64-linux-gnu. --- elf/dl-lookup.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/elf/dl-lookup.c b/elf/dl-lookup.c index 4c86dc694e..67fb2e31e2 100644 --- a/elf/dl-lookup.c +++ b/elf/dl-lookup.c @@ -854,6 +854,23 @@ _dl_lookup_symbol_x (const char *undef_name, struct link_map *undef_map, if (__glibc_unlikely (current_value.m->l_used == 0)) current_value.m->l_used = 1; + if (__glibc_unlikely (GLRO(dl_debug_mask) & DL_DEBUG_BINDINGS)) + { + const char *reference_name = undef_map->l_name; + + _dl_debug_printf ("binding file %s [%lu] to %s [%lu]: %s symbol `%s'", + DSO_FILENAME (reference_name), + undef_map->l_ns, + DSO_FILENAME (current_value.m->l_name), + current_value.m->l_ns, + protected ? "protected" : "normal", undef_name); + if (version) + _dl_debug_printf_c (" [%s]\n", version->name); + else + _dl_debug_printf_c ("\n"); + } + + *ref = current_value.s; return LOOKUP_VALUE (current_value.m); }