From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1791) id 2EF41385E013; Wed, 26 Oct 2022 14:32:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2EF41385E013 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1666794772; bh=GuT0jJHkcuERG5U0AtIys2uK0UMH1NNJROtfioUQJ+k=; h=From:To:Subject:Date:From; b=Bw86+UeMR+Z8TWWveiMwR+ccxxuOJ0IGQZEqZDyJ/ntmggjEyGxHpuuWxJpXfFLyG 4mNNLZwfK387RquOxv5cSOagtzhlIgGfFmSRea3P6thA+vcKnskwUWvv8zwHvkVkPM kmZzjkxuXqLAJU+XvH0D5N5f4rWF7q+QQWych7eo= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Adhemerval Zanella To: glibc-cvs@sourceware.org Subject: [glibc/release/2.36/master] elf: Reinstate on DL_DEBUG_BINDINGS _dl_lookup_symbol_x X-Act-Checkin: glibc X-Git-Author: Adhemerval Zanella X-Git-Refname: refs/heads/release/2.36/master X-Git-Oldrev: 7b7dfbb0cbdffebf0233c650627a4861212fbb60 X-Git-Newrev: a1dc0be03c9dd850b864bd7a9c03cf8e396eb7ca Message-Id: <20221026143252.2EF41385E013@sourceware.org> Date: Wed, 26 Oct 2022 14:32:51 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a1dc0be03c9dd850b864bd7a9c03cf8e396eb7ca commit a1dc0be03c9dd850b864bd7a9c03cf8e396eb7ca Author: Adhemerval Zanella Date: Tue Oct 25 13:19:16 2022 -0300 elf: Reinstate on DL_DEBUG_BINDINGS _dl_lookup_symbol_x The prelink removal done by 6628c742b2c16e wrongly removed the debug support. Checked on x86_64-linux-gnu. (cherry picked from commit 891a7958a28eac6d4af1517dd2896fef5e4951d4) Diff: --- 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); }