* Use __glibc_reserved convention in mcontext, sigcontext (bug 21457)
@ 2017-05-03 22:43 Joseph Myers
2017-05-04 2:25 ` Carlos O'Donell
0 siblings, 1 reply; 2+ messages in thread
From: Joseph Myers @ 2017-05-03 22:43 UTC (permalink / raw)
To: libc-alpha
This patch implements the most straightforward part of fixing
namespace issues for sys/ucontext.h and related headers: where fields
in sys/ucontext.h or bits/sigcontext.h are named "reserved", "padding"
or similar, they are renamed to use the __glibc_reserved* naming
convention. It does not change fields with a leading underscore, or
even those with a prefix such as uc_ or sc_. It only fixes a small
part of bug 21457, so no XFAILs are removed.
Tested for x86_64 and x86, and with build-many-glibcs.py.
2017-05-03 Joseph Myers <joseph@codesourcery.com>
[BZ #21457]
* sysdeps/unix/sysv/linux/mips/sys/ucontext.h
[_MIPS_SIM != _ABIO32] (mcontext_t): Rename field reserved to
__glibc_reserved1.
* sysdeps/unix/sysv/linux/x86/bits/sigcontext.h
(struct _fpx_sw_bytes): Rename field padding to __glibc_reserved1.
(struct _fpxreg): Likewise.
[!__x86_64__] (struct _fpstate): Rename field reserved to
__glibc_reserved1. Rename field padding to __glibc_reserved2.
[__x86_64__] (struct _fpstate): Rename field padding to
__glibc_reserved1.
(struct _xsave_hdr): Rename field reserved1 to __glibc_reserved1.
Rename field reserved2 to __glibc_reserved2.
* sysdeps/unix/sysv/linux/x86/sys/ucontext.h
[__x86_64__] (struct _libc_fpxreg): Rename field padding to
__glibc_reserved1.
[__x86_64__] (struct _libc_fpstate): Rename field padding to
__glibc_reserved1.
diff --git a/sysdeps/unix/sysv/linux/mips/sys/ucontext.h b/sysdeps/unix/sysv/linux/mips/sys/ucontext.h
index c237a51..f766dac 100644
--- a/sysdeps/unix/sysv/linux/mips/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/mips/sys/ucontext.h
@@ -98,7 +98,7 @@ typedef struct
unsigned int fpc_csr;
unsigned int used_math;
unsigned int dsp;
- unsigned int reserved;
+ unsigned int __glibc_reserved1;
} mcontext_t;
#endif
diff --git a/sysdeps/unix/sysv/linux/x86/bits/sigcontext.h b/sysdeps/unix/sysv/linux/x86/bits/sigcontext.h
index 7d6066c..bc692bc 100644
--- a/sysdeps/unix/sysv/linux/x86/bits/sigcontext.h
+++ b/sysdeps/unix/sysv/linux/x86/bits/sigcontext.h
@@ -32,7 +32,7 @@ struct _fpx_sw_bytes
__uint32_t extended_size;
__uint64_t xstate_bv;
__uint32_t xstate_size;
- __uint32_t padding[7];
+ __uint32_t __glibc_reserved1[7];
};
struct _fpreg
@@ -45,7 +45,7 @@ struct _fpxreg
{
unsigned short significand[4];
unsigned short exponent;
- unsigned short padding[3];
+ unsigned short __glibc_reserved1[3];
};
struct _xmmreg
@@ -74,10 +74,10 @@ struct _fpstate
/* FXSR FPU environment. */
__uint32_t _fxsr_env[6];
__uint32_t mxcsr;
- __uint32_t reserved;
+ __uint32_t __glibc_reserved1;
struct _fpxreg _fxsr_st[8];
struct _xmmreg _xmm[8];
- __uint32_t padding[56];
+ __uint32_t __glibc_reserved2[56];
};
#ifndef sigcontext_struct
@@ -131,7 +131,7 @@ struct _fpstate
__uint32_t mxcr_mask;
struct _fpxreg _st[8];
struct _xmmreg _xmm[16];
- __uint32_t padding[24];
+ __uint32_t __glibc_reserved1[24];
};
struct sigcontext
@@ -175,8 +175,8 @@ struct sigcontext
struct _xsave_hdr
{
__uint64_t xstate_bv;
- __uint64_t reserved1[2];
- __uint64_t reserved2[5];
+ __uint64_t __glibc_reserved1[2];
+ __uint64_t __glibc_reserved2[5];
};
struct _ymmh_state
diff --git a/sysdeps/unix/sysv/linux/x86/sys/ucontext.h b/sysdeps/unix/sysv/linux/x86/sys/ucontext.h
index 0da12f4..6dad48f 100644
--- a/sysdeps/unix/sysv/linux/x86/sys/ucontext.h
+++ b/sysdeps/unix/sysv/linux/x86/sys/ucontext.h
@@ -95,7 +95,7 @@ struct _libc_fpxreg
{
unsigned short int significand[4];
unsigned short int exponent;
- unsigned short int padding[3];
+ unsigned short int __glibc_reserved1[3];
};
struct _libc_xmmreg
@@ -116,7 +116,7 @@ struct _libc_fpstate
__uint32_t mxcr_mask;
struct _libc_fpxreg _st[8];
struct _libc_xmmreg _xmm[16];
- __uint32_t padding[24];
+ __uint32_t __glibc_reserved1[24];
};
/* Structure to describe FPU registers. */
--
Joseph S. Myers
joseph@codesourcery.com
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Use __glibc_reserved convention in mcontext, sigcontext (bug 21457)
2017-05-03 22:43 Use __glibc_reserved convention in mcontext, sigcontext (bug 21457) Joseph Myers
@ 2017-05-04 2:25 ` Carlos O'Donell
0 siblings, 0 replies; 2+ messages in thread
From: Carlos O'Donell @ 2017-05-04 2:25 UTC (permalink / raw)
To: Joseph Myers, libc-alpha
On 05/03/2017 06:43 PM, Joseph Myers wrote:
> This patch implements the most straightforward part of fixing
> namespace issues for sys/ucontext.h and related headers: where fields
> in sys/ucontext.h or bits/sigcontext.h are named "reserved", "padding"
> or similar, they are renamed to use the __glibc_reserved* naming
> convention. It does not change fields with a leading underscore, or
> even those with a prefix such as uc_ or sc_. It only fixes a small
> part of bug 21457, so no XFAILs are removed.
>
> Tested for x86_64 and x86, and with build-many-glibcs.py.
>
> 2017-05-03 Joseph Myers <joseph@codesourcery.com>
>
> [BZ #21457]
> * sysdeps/unix/sysv/linux/mips/sys/ucontext.h
> [_MIPS_SIM != _ABIO32] (mcontext_t): Rename field reserved to
> __glibc_reserved1.
> * sysdeps/unix/sysv/linux/x86/bits/sigcontext.h
> (struct _fpx_sw_bytes): Rename field padding to __glibc_reserved1.
> (struct _fpxreg): Likewise.
> [!__x86_64__] (struct _fpstate): Rename field reserved to
> __glibc_reserved1. Rename field padding to __glibc_reserved2.
> [__x86_64__] (struct _fpstate): Rename field padding to
> __glibc_reserved1.
> (struct _xsave_hdr): Rename field reserved1 to __glibc_reserved1.
> Rename field reserved2 to __glibc_reserved2.
> * sysdeps/unix/sysv/linux/x86/sys/ucontext.h
> [__x86_64__] (struct _libc_fpxreg): Rename field padding to
> __glibc_reserved1.
> [__x86_64__] (struct _libc_fpstate): Rename field padding to
> __glibc_reserved1.
OK.
I looked to see if gdb used any of the named reserved fields, or if any
other low-level program did, like strace, but I couldn't find any.
--
Cheers,
Carlos.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-05-04 2:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-03 22:43 Use __glibc_reserved convention in mcontext, sigcontext (bug 21457) Joseph Myers
2017-05-04 2:25 ` Carlos O'Donell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).