[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [PATCH] elf: Fix GL(dl_phdr) and GL(dl_phnum) for static builds [BZ #29864]




On 11/01/23 11:27, Florian Weimer wrote:
> * 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.

It should be since 5355f9ca7b10183ce06e8a18003ba30f43774858, but I will
recheck.  I can move it to another patch, but I think it is a lefover of
the -fno-tree-loop-distribute-patterns removal.

> 
>> 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?

Hum, it might a leftover of development. I will check.


Reply to: