[PATCH v3] elf: Remove -fno-tree-loop-distribute-patterns usage on dl-support

Adhemerval Zanella Netto adhemerval.zanella@linaro.org
Thu Aug 11 12:18:21 GMT 2022



On 10/08/22 22:58, H.J. Lu wrote:
> On Wed, Aug 10, 2022 at 1:13 PM Adhemerval Zanella
>> diff --git a/elf/dl-symbol-hacks.h b/elf/dl-symbol-hacks.h
>> new file mode 100644
>> index 0000000000..6b9d24ed03
>> --- /dev/null
>> +++ b/elf/dl-symbol-hacks.h
>> @@ -0,0 +1,31 @@
>> +/* Symbol rediretion for loader/static initialization code.
>> +   Copyright (C) 2022 Free Software Foundation, Inc.
>> +   This file is part of the GNU C Library.
>> +
>> +   The GNU C Library is free software; you can redistribute it and/or
>> +   modify it under the terms of the GNU Lesser General Public
>> +   License as published by the Free Software Foundation; either
>> +   version 2.1 of the License, or (at your option) any later version.
>> +
>> +   The GNU C Library is distributed in the hope that it will be useful,
>> +   but WITHOUT ANY WARRANTY; without even the implied warranty of
>> +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
>> +   Lesser General Public License for more details.
>> +
>> +   You should have received a copy of the GNU Lesser General Public
>> +   License along with the GNU C Library; if not, see
>> +   <https://www.gnu.org/licenses/>.  */
>> +
>> +#ifndef _DL_SYMBOL_HACKS_H
>> +#define _DL_SYMBOL_HACKS_H
>> +
>> +#include <dl-ifunc-generic.h>
>> +
>> +/* Some compiler optimizations may transform loops into memset/memmove
>> +   calls and without proper redirection it might call PLT throught
>> +   ifunc without relocations being processed.  */
>> +#if !IS_IN(rtld) && defined HAVE_MEMSET_IFUNC_GENERIC
> 
> Do we need !IS_IN(rtld)?  This header file should only be included when
> it is needed.
> 
It is not strictly necessary, I have added it to avoid wrong inclusion in 
loader code (which would pull a HAVE_MEMSET_IFUNC_GENERIC and make loader 
build fail).  I will remove and send a new version.


More information about the Libc-alpha mailing list