Re: [PATCH] elf: Fix GL(dl_phdr) and GL(dl_phnum) for static builds [BZ #29864]
* Adhemerval Zanella:
> diff --git a/elf/dl-support.c b/elf/dl-support.c
> index 614b5b3e0c..b5ec5bd6d1 100644
> --- a/elf/dl-support.c
> +++ b/elf/dl-support.c
> @@ -250,12 +250,27 @@ _dl_aux_init (ElfW(auxv_t) *av)
> #endif
>
> _dl_auxv = av;
> - dl_parse_auxv_t auxv_values;
> - /* Use an explicit initialization loop here because memset may not
> - be available yet. */
> - for (int i = 0; i < array_length (auxv_values); ++i)
> - auxv_values[i] = 0;
> + dl_parse_auxv_t auxv_values = { 0, };
Is this really safe? If so, it should still be in a separate commit.
> diff --git a/sysdeps/unix/sysv/linux/dl-parse_auxv.h b/sysdeps/unix/sysv/linux/dl-parse_auxv.h
> index bf9374371e..2bf3a0ca6b 100644
> --- a/sysdeps/unix/sysv/linux/dl-parse_auxv.h
> +++ b/sysdeps/unix/sysv/linux/dl-parse_auxv.h
> @@ -21,6 +21,7 @@
> #include <fpu_control.h>
> #include <ldsodefs.h>
> #include <link.h>
> +#include <dl-auxv.h> /* For DL_PLATFORM_AUXV */
>
> typedef ElfW(Addr) dl_parse_auxv_t[AT_MINSIGSTKSZ + 1];
Why is this change needed?
Thanks,
Florian
Reply to: