From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x22f.google.com (mail-oi1-x22f.google.com [IPv6:2607:f8b0:4864:20::22f]) by sourceware.org (Postfix) with ESMTPS id 141B7385D0FA for ; Wed, 26 Oct 2022 14:33:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 141B7385D0FA Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-oi1-x22f.google.com with SMTP id g10so18711113oif.10 for ; Wed, 26 Oct 2022 07:33:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=Hd14/BnXklcWI8aezhyYjxAz9GzQO9kQXKC11gfBHbw=; b=uzr89HxXpIgQdgv+aRMS6v4ttaNklo/8BEqMSVQ3uvwwH2ueXa2AOThndBOg9DvcTU To6ecBCCx6tHcUdCxzu0yxizflpiwFkth8qHRX1WN59rrIV/QcPlcaAOM7ltGEPhZO4M hgER0OPkvy/h6MFwpLRKqI1RZ7op3M1QuiXLTcWvQiYCrTN3bJvJ0SRsmxI4535nmAg6 iPAdUb5kvd27Hdz2YKY02c+JNt6+ixx6B8qNnU9g2k4J638seo9rDsJqg8WISEFxFpOw WEWYP7jFQ7Vdh7rIUd0Ou2sElo/AmX5Yj2oo5CX04FpywEXoWNGjfNnu7oOMTwu0/tcw 41bA== 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:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Hd14/BnXklcWI8aezhyYjxAz9GzQO9kQXKC11gfBHbw=; b=HHg+xBEbpz9yHROzxMQfmSiYuI8UtyhVF2uwFlymsdpIo9QF+ZOQZ1ryUXulSYLPTz OOy3F1PpMjX50qnoYq197ePqaMeYkiP2EBWeEAr9g/0HbHEH9F7vWqZfThgbRNQycXcL Hfgz9UvVoEyQVmyNDdt2DUC3nC09jax8Yqi1CI3KoQ9/daK3lS1DF218hJQWL3D3VWFI k4pgzjizKGYEIqYGT9NwkBUtS3+3IXNuSlQO56VHbsGsDxhroFYaSGP8xffUjxciK1+c J1lV5gJ/B7bC3T0MbI6xiZkNbwT9eejfntRyD3+w8/SAEP7bX0ikE0Xix3l7svb1yWkC k6+A== X-Gm-Message-State: ACrzQf1h0BOzkCgKcUeRWzumU51E8OqBgbZcqhOe5pAIZ+HKz8PIWEmK LNasGD/G3dmNHRpcF/1IjP4GgVajO74nmTV7 X-Google-Smtp-Source: AMsMyM4o6oqz0ltjq56zvmwalfrWj2JMAezCxpKa2REUvtGDJvLIQX8HNrNum9fbdBqkfmHgNCKj0Q== X-Received: by 2002:a05:6808:1446:b0:355:4fad:582f with SMTP id x6-20020a056808144600b003554fad582fmr1926992oiv.237.1666794823167; Wed, 26 Oct 2022 07:33:43 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c0:17c8:6a6b:43f7:824e:663]) by smtp.gmail.com with ESMTPSA id z19-20020a056870e31300b001372c1902afsm3060397oad.52.2022.10.26.07.33.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 07:33:42 -0700 (PDT) From: Adhemerval Zanella To: libc-stable@sourceware.org Subject: [COMMITTED 2.36] elf: Reinstate on DL_DEBUG_BINDINGS _dl_lookup_symbol_x Date: Wed, 26 Oct 2022 11:33:38 -0300 Message-Id: <20221026143338.2552003-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.9 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=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: The prelink removal done by 6628c742b2c16e wrongly removed the debug support. Checked on x86_64-linux-gnu. (cherry picked from commit 891a7958a28eac6d4af1517dd2896fef5e4951d4) --- 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); } -- 2.34.1