This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR libgcc/60790: Avoid IFUNC resolver access to uninitialized data
- From: Jeff Law <law at redhat dot com>
- To: Florian Weimer <fw at deneb dot enyo dot de>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 19 Mar 2019 14:47:22 -0600
- Subject: Re: [PATCH] PR libgcc/60790: Avoid IFUNC resolver access to uninitialized data
- References: <8d5057e2-b0c5-342b-e0f7-9a54b7fdc061@redhat.com> <347eb5c7-65d3-750b-fb7c-65b1daff32be@redhat.com> <87r2gyex9s.fsf@mid.deneb.enyo.de> <87r2b2vri2.fsf@mid.deneb.enyo.de>
On 3/19/19 9:00 AM, Florian Weimer wrote:
> * Florian Weimer:
>
>> * Jeff Law:
>>
>>> On 03/29/2018 08:00 AM, Florian Weimer wrote:
>>>> This patch performs lazy initialization of the relevant CPUID feature
>>>> register value. It will needlessly invoke the CPUID determination code
>>>> on architectures which lack CPUID support or support for the feature
>>>> register, but I think it's not worth to avoid the complexity for that.
>>>>
>>>> I verified manually that the CMPXCHG16B implementation is still selected
>>>> for a 128-bit load after the change. I don't know how to write an
>>>> automated test for that.
>>>>
>>>> Thanks,
>>>> Florian
>>>>
>>>> pr60790.patch
>>>>
>>>>
>>>> Index: libatomic/ChangeLog
>>>> ===================================================================
>>>> --- libatomic/ChangeLog (revision 258952)
>>>> +++ libatomic/ChangeLog (working copy)
>>>> @@ -1,3 +1,18 @@
>>>> +2018-03-29 Florian Weimer <fweimer@tor.usersys.redhat.com>
>>>> +
>>>> + PR libgcc/60790
>>>> + x86: Do not assume ELF constructors run before IFUNC resolvers.
>>>> + * config/x86/host-config.h (libat_feat1_ecx, libat_feat1_edx):
>>>> + Remove declarations.
>>>> + (__libat_feat1, __libat_feat1_init): Declare.
>>>> + (FEAT1_REGISTER): Define.
>>>> + (load_feat1): New function.
>>>> + (IFUNC_COND_1): Adjust.
>>>> + * config/x86/init.c (libat_feat1_ecx, libat_feat1_edx)
>>>> + (init_cpuid): Remove definitions.
>>>> + (__libat_feat1): New variable.
>>>> + (__libat_feat1_init): New function.
>>> OK.
>>
>> Here is the backport to gcc-8-branch.
>
> Ping? <https://gcc.gnu.org/ml/gcc-patches/2018-10/msg00524.html>
OK for the branch as well. I didn't know you were waiting on me :-)
jeff