* [PATCH] elf: Restore how vDSO dependency is printed with LD_TRACE_LOADED_OBJECTS (BZ #29539)
@ 2022-08-30 16:39 Adhemerval Zanella
2022-08-31 6:42 ` Florian Weimer
0 siblings, 1 reply; 3+ messages in thread
From: Adhemerval Zanella @ 2022-08-30 16:39 UTC (permalink / raw)
To: libc-alpha
The d7703d3176d225d5743b21811d888619eba39e82 changed how vDSO like
dependencies are printed, instead of just the name and address it
follows other libraries mode and prints 'name => path'.
Unfortunately, this broke some ldd consumer that uses the output to
filter out the program's dependencies. For instance CMake
bundleutilities module [1], where GetPrequirite uses the regex to filter
out 'name => path' [2].
This patch restore the previous way to print just the name and the
mapping address.
Checked on x86_64-linux-gnu.
[1] https://github.com/Kitware/CMake/tree/master/Tests/BundleUtilities
[2] https://github.com/Kitware/CMake/blob/master/Modules/GetPrerequisites.cmake#L733
---
elf/rtld.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/elf/rtld.c b/elf/rtld.c
index cbbaf4a331..3e771a93d8 100644
--- a/elf/rtld.c
+++ b/elf/rtld.c
@@ -2122,6 +2122,12 @@ dl_main (const ElfW(Phdr) *phdr,
if (l->l_faked)
/* The library was not found. */
_dl_printf ("\t%s => not found\n", l->l_libname->name);
+ else if (strcmp (l->l_libname->name, l->l_name) == 0)
+ /* Print vDSO like libraries without duplicate name. Some
+ consumers depend of this format. */
+ _dl_printf ("\t%s (0x%0*Zx)\n", l->l_libname->name,
+ (int) sizeof l->l_map_start * 2,
+ (size_t) l->l_map_start);
else
_dl_printf ("\t%s => %s (0x%0*Zx)\n",
DSO_FILENAME (l->l_libname->name),
--
2.34.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] elf: Restore how vDSO dependency is printed with LD_TRACE_LOADED_OBJECTS (BZ #29539)
2022-08-30 16:39 [PATCH] elf: Restore how vDSO dependency is printed with LD_TRACE_LOADED_OBJECTS (BZ #29539) Adhemerval Zanella
@ 2022-08-31 6:42 ` Florian Weimer
2022-08-31 6:42 ` Florian Weimer
0 siblings, 1 reply; 3+ messages in thread
From: Florian Weimer @ 2022-08-31 6:42 UTC (permalink / raw)
To: Adhemerval Zanella via Libc-alpha; +Cc: Adhemerval Zanella
* Adhemerval Zanella via Libc-alpha:
> The d7703d3176d225d5743b21811d888619eba39e82 changed how vDSO like
> dependencies are printed, instead of just the name and address it
> follows other libraries mode and prints 'name => path'.
>
> Unfortunately, this broke some ldd consumer that uses the output to
> filter out the program's dependencies. For instance CMake
> bundleutilities module [1], where GetPrequirite uses the regex to filter
> out 'name => path' [2].
>
> This patch restore the previous way to print just the name and the
> mapping address.
>
> Checked on x86_64-linux-gnu.
>
> [1] https://github.com/Kitware/CMake/tree/master/Tests/BundleUtilities
> [2] https://github.com/Kitware/CMake/blob/master/Modules/GetPrerequisites.cmake#L733
> ---
> elf/rtld.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/elf/rtld.c b/elf/rtld.c
> index cbbaf4a331..3e771a93d8 100644
> --- a/elf/rtld.c
> +++ b/elf/rtld.c
> @@ -2122,6 +2122,12 @@ dl_main (const ElfW(Phdr) *phdr,
> if (l->l_faked)
> /* The library was not found. */
> _dl_printf ("\t%s => not found\n", l->l_libname->name);
> + else if (strcmp (l->l_libname->name, l->l_name) == 0)
> + /* Print vDSO like libraries without duplicate name. Some
> + consumers depend of this format. */
> + _dl_printf ("\t%s (0x%0*Zx)\n", l->l_libname->name,
> + (int) sizeof l->l_map_start * 2,
> + (size_t) l->l_map_start);
> else
> _dl_printf ("\t%s => %s (0x%0*Zx)\n",
> DSO_FILENAME (l->l_libname->name),
Looks okay, thanks.
Reviewed-by: Florian Weimer <fweimer@redhat.com>
Florian
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] elf: Restore how vDSO dependency is printed with LD_TRACE_LOADED_OBJECTS (BZ #29539)
2022-08-31 6:42 ` Florian Weimer
@ 2022-08-31 6:42 ` Florian Weimer
0 siblings, 0 replies; 3+ messages in thread
From: Florian Weimer @ 2022-08-31 6:42 UTC (permalink / raw)
To: Adhemerval Zanella via Libc-alpha
* Adhemerval Zanella via Libc-alpha:
> The d7703d3176d225d5743b21811d888619eba39e82 changed how vDSO like
> dependencies are printed, instead of just the name and address it
> follows other libraries mode and prints 'name => path'.
>
> Unfortunately, this broke some ldd consumer that uses the output to
> filter out the program's dependencies. For instance CMake
> bundleutilities module [1], where GetPrequirite uses the regex to filter
> out 'name => path' [2].
>
> This patch restore the previous way to print just the name and the
> mapping address.
>
> Checked on x86_64-linux-gnu.
>
> [1] https://github.com/Kitware/CMake/tree/master/Tests/BundleUtilities
> [2] https://github.com/Kitware/CMake/blob/master/Modules/GetPrerequisites.cmake#L733
> ---
> elf/rtld.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/elf/rtld.c b/elf/rtld.c
> index cbbaf4a331..3e771a93d8 100644
> --- a/elf/rtld.c
> +++ b/elf/rtld.c
> @@ -2122,6 +2122,12 @@ dl_main (const ElfW(Phdr) *phdr,
> if (l->l_faked)
> /* The library was not found. */
> _dl_printf ("\t%s => not found\n", l->l_libname->name);
> + else if (strcmp (l->l_libname->name, l->l_name) == 0)
> + /* Print vDSO like libraries without duplicate name. Some
> + consumers depend of this format. */
> + _dl_printf ("\t%s (0x%0*Zx)\n", l->l_libname->name,
> + (int) sizeof l->l_map_start * 2,
> + (size_t) l->l_map_start);
> else
> _dl_printf ("\t%s => %s (0x%0*Zx)\n",
> DSO_FILENAME (l->l_libname->name),
Looks okay, thanks.
Reviewed-by: Florian Weimer <fweimer@redhat.com>
Florian
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-08-31 6:42 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-30 16:39 [PATCH] elf: Restore how vDSO dependency is printed with LD_TRACE_LOADED_OBJECTS (BZ #29539) Adhemerval Zanella
2022-08-31 6:42 ` Florian Weimer
2022-08-31 6:42 ` Florian Weimer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).