This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] AARCH64: remove asm/prtace.h inclusion in sys/user.h and sys/procfs.h
- From: Will Newton <will dot newton at linaro dot org>
- To: Marcus Shawcroft <marcus dot shawcroft at gmail dot com>
- Cc: Yvan Roux <yvan dot roux at linaro dot org>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Tue, 20 May 2014 13:50:00 +0100
- Subject: Re: [PATCH] AARCH64: remove asm/prtace.h inclusion in sys/user.h and sys/procfs.h
- Authentication-results: sourceware.org; auth=none
- References: <CAD57uCe1eQ-womj1WW2jc6Y6mv+w6pY85dDkLGDcd0Of_6RE5A at mail dot gmail dot com> <CAFqB+PzVYB2aP18u_T36CrDGi7QN1vZJOZOpYT-E5AQFEP6D2g at mail dot gmail dot com>
On 20 May 2014 11:31, Marcus Shawcroft <marcus.shawcroft@gmail.com> wrote:
> On 14 May 2014 12:46, Yvan Roux <yvan.roux@linaro.org> wrote:
>> Hi,
>>
>> this patch fixes an issue observed by the Xen project, where including
>> signal.h exposes various PSR_MODE #defines. This is due to the usage
>> in sys/user.h and sys/procfs.h of the struct user_pt_regs and
>> user_fpsimd_state included via asm/ptrace.h. The namespace pollution
>> this inclusion introduce is already partially fixed with some #undef
>> of the PTRACE_* symbols, but other symbols lile the PSR_MODE ones are
>> still present, and undefining them is not safe since a user can
>> include ptrace.h before user.h.
>>
>> My proposition is to define the 2 structures we need in user.h and get
>> ride of the asm/ptrace.h inclusion.
>>
>> Build + Make check are clean on AArch64.
>>
>> Thanks,
>> Yvan
>>
>> 2014-05-14 Yvan Roux <yvan.roux@linaro.org>
>>
>> * sysdeps/unix/sysv/linux/aarch64/sys/user.h: Remove unused #include of
>> asm/ptrace.h.
>> (PTRACE_GET_THREAD_AREA): Remove #undef.
>> (PTRACE_GETHBPREGS): Likewise.
>> (PTRACE_SETHBPREGS): Likewise.
>> (struct user_regs_struct): New structure.
>> (struct user_fpsimd_struct): New structure
>> * sysdeps/unix/sysv/linux/aarch64/sys/procfs.h: Remove unused #include
>> of asm/ptrace.h and second #include of sys/user.h.
>> (PTRACE_GET_THREAD_AREA): Remove #undef.
>> (PTRACE_GETHBPREGS): Likewise.
>> (PTRACE_SETHBPREGS): Likewise.
>> (ELF_NGREG): Use new struct user_regs_struct.
>> (elf_fpregset_t): Use new struct user_fpsimd_struct.
>
> I think this re-structure is OK and can go in with the corrections
> Will called out.
I committed this patch on Yvan's behalf.
--
Will Newton
Toolchain Working Group, Linaro