mirror of
git://sourceware.org/git/glibc.git
synced 2024-11-27 03:41:23 +08:00
Linux: Avoid conflicting types in ld.so --list-diagnostics
The path auxv[*].a_val could either be an integer or a string, depending on the a_type value. Use a separate field, a_val_string, to simplify mechanical parsing of the --list-diagnostics output. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
This commit is contained in:
parent
f6c8204fd7
commit
65a5112ede
@ -30,16 +30,19 @@ print_auxv (void)
|
|||||||
for (ElfW(auxv_t) *av = GLRO(dl_auxv); av->a_type != AT_NULL; ++av)
|
for (ElfW(auxv_t) *av = GLRO(dl_auxv); av->a_type != AT_NULL; ++av)
|
||||||
{
|
{
|
||||||
_dl_printf ("auxv[0x%x].a_type=0x%lx\n"
|
_dl_printf ("auxv[0x%x].a_type=0x%lx\n"
|
||||||
"auxv[0x%x].a_val=",
|
"auxv[0x%x].a_val",
|
||||||
index, (unsigned long int) av->a_type, index);
|
index, (unsigned long int) av->a_type, index);
|
||||||
if (av->a_type == AT_EXECFN
|
if (av->a_type == AT_EXECFN
|
||||||
|| av->a_type == AT_PLATFORM
|
|| av->a_type == AT_PLATFORM
|
||||||
|| av->a_type == AT_BASE_PLATFORM)
|
|| av->a_type == AT_BASE_PLATFORM)
|
||||||
|
{
|
||||||
/* The address of the strings is not useful at all, so print
|
/* The address of the strings is not useful at all, so print
|
||||||
the strings themselves. */
|
the strings themselves. */
|
||||||
|
_dl_printf ("_string=");
|
||||||
_dl_diagnostics_print_string ((const char *) av->a_un.a_val);
|
_dl_diagnostics_print_string ((const char *) av->a_un.a_val);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
_dl_printf ("0x%lx", (unsigned long int) av->a_un.a_val);
|
_dl_printf ("=0x%lx", (unsigned long int) av->a_un.a_val);
|
||||||
_dl_printf ("\n");
|
_dl_printf ("\n");
|
||||||
++index;
|
++index;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user