diff options
Diffstat (limited to 'sysdeps/unix/sysv/linux/powerpc/bits')
-rw-r--r-- | sysdeps/unix/sysv/linux/powerpc/bits/ipc.h | 4 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h | 32 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/powerpc/bits/msq.h | 10 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/powerpc/bits/sem.h | 8 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/powerpc/bits/shm.h | 20 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/powerpc/bits/sigstack.h | 54 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/powerpc/bits/stat.h | 20 |
7 files changed, 111 insertions, 37 deletions
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/ipc.h b/sysdeps/unix/sysv/linux/powerpc/bits/ipc.h index f2bb635a54..889bbcdb4a 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/ipc.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/ipc.h @@ -49,8 +49,8 @@ struct ipc_perm __mode_t mode; /* Read/write permission. */ __uint32_t __seq; /* Sequence number. */ __uint32_t __pad1; - __uint64_t __unused1; - __uint64_t __unused2; + __uint64_t __glibc_reserved1; + __uint64_t __glibc_reserved2; }; diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h b/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h index ba54de4eb0..31dd15ecc4 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/libc-vdso.h @@ -41,12 +41,32 @@ extern void *__vdso_sigtramp32; extern void *__vdso_sigtramp_rt32; #endif -/* This macro is needed for PPC64 to return a skeleton OPD entry of a vDSO - symbol. This works because _dl_vdso_vsym always return the function - address, and no vDSO symbols use the TOC or chain pointers from the OPD - so we can allow them to be garbage. */ -#if defined(__PPC64__) || defined(__powerpc64__) -#define VDSO_IFUNC_RET(value) ((void *) &(value)) +#if (defined(__PPC64__) || defined(__powerpc64__)) && _CALL_ELF != 2 +/* The correct solution is for _dl_vdso_vsym to return the address of the OPD + for the kernel VDSO function. That address would then be stored in the + __vdso_* variables and returned as the result of the IFUNC resolver function. + Yet, the kernel does not contain any OPD entries for the VDSO functions + (incomplete implementation). However, PLT relocations for IFUNCs still expect + the address of an OPD to be returned from the IFUNC resolver function (since + PLT entries on PPC64 are just copies of OPDs). The solution for now is to + create an artificial static OPD for each VDSO function returned by a resolver + function. The TOC value is set to a non-zero value to avoid triggering lazy + symbol resolution via .glink0/.plt0 for a zero TOC (requires thread-safe PLT + sequences) when the dynamic linker isn't prepared for it e.g. RTLD_NOW. None + of the kernel VDSO routines use the TOC or AUX values so any non-zero value + will work. Note that function pointer comparisons will not use this artificial + static OPD since those are resolved via ADDR64 relocations and will point at + the non-IFUNC default OPD for the symbol. Lastly, because the IFUNC relocations + are processed immediately at startup the resolver functions and this code need + not be thread-safe, but if the caller writes to a PLT slot it must do so in a + thread-safe manner with all the required barriers. */ +#define VDSO_IFUNC_RET(value) \ + ({ \ + static Elf64_FuncDesc vdso_opd = { .fd_toc = ~0x0 }; \ + vdso_opd.fd_func = (Elf64_Addr)value; \ + &vdso_opd; \ + }) + #else #define VDSO_IFUNC_RET(value) ((void *) (value)) #endif diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/msq.h b/sysdeps/unix/sysv/linux/powerpc/bits/msq.h index 59147c268c..b22fa72e84 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/msq.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/msq.h @@ -39,15 +39,15 @@ struct msqid_ds { struct ipc_perm msg_perm; /* structure describing operation permission */ #if __WORDSIZE == 32 - unsigned int __unused1; + unsigned int __glibc_reserved1; #endif __time_t msg_stime; /* time of last msgsnd command */ #if __WORDSIZE == 32 - unsigned int __unused2; + unsigned int __glibc_reserved2; #endif __time_t msg_rtime; /* time of last msgrcv command */ #if __WORDSIZE == 32 - unsigned int __unused3; + unsigned int __glibc_reserved3; #endif __time_t msg_ctime; /* time of last change */ unsigned long __msg_cbytes; /* current number of bytes on queue */ @@ -55,8 +55,8 @@ struct msqid_ds msglen_t msg_qbytes; /* max number of bytes allowed on queue */ __pid_t msg_lspid; /* pid of last msgsnd() */ __pid_t msg_lrpid; /* pid of last msgrcv() */ - unsigned long __unused4; - unsigned long __unused5; + unsigned long __glibc_reserved4; + unsigned long __glibc_reserved5; }; #ifdef __USE_MISC diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/sem.h b/sysdeps/unix/sysv/linux/powerpc/bits/sem.h index 3847a3377e..56f47f118f 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/sem.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/sem.h @@ -39,16 +39,16 @@ struct semid_ds { struct ipc_perm sem_perm; /* operation permission struct */ #if __WORDSIZE == 32 - unsigned int __unused1; + unsigned int __glibc_reserved1; #endif __time_t sem_otime; /* last semop() time */ #if __WORDSIZE == 32 - unsigned int __unused2; + unsigned int __glibc_reserved2; #endif __time_t sem_ctime; /* last time changed by semctl() */ unsigned long int sem_nsems; /* number of semaphores in set */ - unsigned long __unused3; - unsigned long __unused4; + unsigned long __glibc_reserved3; + unsigned long __glibc_reserved4; }; /* The user should define a union like the following to use it for arguments diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/shm.h b/sysdeps/unix/sysv/linux/powerpc/bits/shm.h index e43d2fd168..a343335bd0 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/shm.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/shm.h @@ -50,26 +50,26 @@ struct shmid_ds { struct ipc_perm shm_perm; /* operation permission struct */ #if __WORDSIZE == 32 - unsigned int __unused1; + unsigned int __glibc_reserved1; #endif __time_t shm_atime; /* time of last shmat() */ #if __WORDSIZE == 32 - unsigned int __unused2; + unsigned int __glibc_reserved2; #endif __time_t shm_dtime; /* time of last shmdt() */ #if __WORDSIZE == 32 - unsigned int __unused3; + unsigned int __glibc_reserved3; #endif __time_t shm_ctime; /* time of last change by shmctl() */ #if __WORDSIZE == 32 - unsigned int __unused4; + unsigned int __glibc_reserved4; #endif size_t shm_segsz; /* size of segment in bytes */ __pid_t shm_cpid; /* pid of creator */ __pid_t shm_lpid; /* pid of last shmop */ shmatt_t shm_nattch; /* number of current attaches */ - unsigned long __unused5; - unsigned long __unused6; + unsigned long __glibc_reserved5; + unsigned long __glibc_reserved6; }; #ifdef __USE_MISC @@ -91,10 +91,10 @@ struct shminfo unsigned long int shmmni; unsigned long int shmseg; unsigned long int shmall; - unsigned long int __unused1; - unsigned long int __unused2; - unsigned long int __unused3; - unsigned long int __unused4; + unsigned long int __glibc_reserved1; + unsigned long int __glibc_reserved2; + unsigned long int __glibc_reserved3; + unsigned long int __glibc_reserved4; }; struct shm_info diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/sigstack.h b/sysdeps/unix/sysv/linux/powerpc/bits/sigstack.h new file mode 100644 index 0000000000..33be9e8dbb --- /dev/null +++ b/sysdeps/unix/sysv/linux/powerpc/bits/sigstack.h @@ -0,0 +1,54 @@ +/* sigstack, sigaltstack definitions. + Copyright (C) 1998-2013 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 + <http://www.gnu.org/licenses/>. */ + +#ifndef _SIGNAL_H +# error "Never include this file directly. Use <signal.h> instead" +#endif + + +/* Structure describing a signal stack (obsolete). */ +struct sigstack + { + void *ss_sp; /* Signal stack pointer. */ + int ss_onstack; /* Nonzero if executing on this stack. */ + }; + + +/* Possible values for `ss_flags.'. */ +enum +{ + SS_ONSTACK = 1, +#define SS_ONSTACK SS_ONSTACK + SS_DISABLE +#define SS_DISABLE SS_DISABLE +}; + +/* Minimum stack size for a signal handler. */ +#define MINSIGSTKSZ 4096 + +/* System default stack size. */ +#define SIGSTKSZ 16384 + + +/* Alternate, preferred interface. */ +typedef struct sigaltstack + { + void *ss_sp; + int ss_flags; + size_t ss_size; + } stack_t; diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/stat.h b/sysdeps/unix/sysv/linux/powerpc/bits/stat.h index e5faec0106..252aae9eac 100644 --- a/sysdeps/unix/sysv/linux/powerpc/bits/stat.h +++ b/sysdeps/unix/sysv/linux/powerpc/bits/stat.h @@ -91,8 +91,8 @@ struct stat __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ # endif - unsigned long int __unused4; - unsigned long int __unused5; + unsigned long int __glibc_reserved4; + unsigned long int __glibc_reserved5; }; @@ -131,8 +131,8 @@ struct stat64 __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ # endif - unsigned long int __unused4; - unsigned long int __unused5; + unsigned long int __glibc_reserved4; + unsigned long int __glibc_reserved5; }; # endif /* __USE_LARGEFILE64 */ @@ -185,9 +185,9 @@ struct stat __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ # endif - unsigned long int __unused4; - unsigned long int __unused5; - unsigned long int __unused6; + unsigned long int __glibc_reserved4; + unsigned long int __glibc_reserved5; + unsigned long int __glibc_reserved6; }; # ifdef __USE_LARGEFILE64 @@ -225,9 +225,9 @@ struct stat64 __time_t st_ctime; /* Time of last status change. */ unsigned long int st_ctimensec; /* Nsecs of last status change. */ # endif - unsigned long int __unused4; - unsigned long int __unused5; - unsigned long int __unused6; + unsigned long int __glibc_reserved4; + unsigned long int __glibc_reserved5; + unsigned long int __glibc_reserved6; }; # endif /* __USE_LARGEFILE64 */ #endif |