diff options
Diffstat (limited to 'libc/sysdeps/linux/powerpc')
-rw-r--r-- | libc/sysdeps/linux/powerpc/bits/kernel_stat.h | 6 | ||||
-rw-r--r-- | libc/sysdeps/linux/powerpc/bits/sem.h | 16 | ||||
-rw-r--r-- | libc/sysdeps/linux/powerpc/bits/uClibc_arch_features.h | 3 | ||||
-rw-r--r-- | libc/sysdeps/linux/powerpc/crt1.S | 23 | ||||
-rw-r--r-- | libc/sysdeps/linux/powerpc/sys/procfs.h | 2 |
5 files changed, 43 insertions, 7 deletions
diff --git a/libc/sysdeps/linux/powerpc/bits/kernel_stat.h b/libc/sysdeps/linux/powerpc/bits/kernel_stat.h index ce62b2ba2..023eefeea 100644 --- a/libc/sysdeps/linux/powerpc/bits/kernel_stat.h +++ b/libc/sysdeps/linux/powerpc/bits/kernel_stat.h @@ -39,9 +39,9 @@ struct kernel_stat64 { long long st_size; /* Size of file, in bytes. */ long st_blksize; /* Optimal block size for I/O. */ long long st_blocks; /* Number 512-byte blocks allocated. */ - struct timespec st_atim; /* Time of last access. */ - struct timespec st_mtim; /* Time of last modification. */ - struct timespec st_ctim; /* Time of last status change. */ + struct timespec st_atim; + struct timespec st_mtim; + struct timespec st_ctim; unsigned long int __uclibc_unused4; unsigned long int __uclibc_unused5; }; diff --git a/libc/sysdeps/linux/powerpc/bits/sem.h b/libc/sysdeps/linux/powerpc/bits/sem.h index a9d895374..8d338eac0 100644 --- a/libc/sysdeps/linux/powerpc/bits/sem.h +++ b/libc/sysdeps/linux/powerpc/bits/sem.h @@ -35,6 +35,7 @@ #define SETALL 17 /* set all semval's */ + /* Data structure describing a set of semaphores. */ struct semid_ds { @@ -42,16 +43,31 @@ struct semid_ds #if __WORDSIZE == 32 unsigned int __uclibc_unused1; #endif +#if defined(__UCLIBC_USE_TIME64__) + unsigned long int __sem_otime_internal_1; /* last semop() time */ + unsigned long int __sem_otime_internal_2; +#else __time_t sem_otime; /* last semop() time */ +#endif #if __WORDSIZE == 32 unsigned int __uclibc_unused2; #endif +#if defined(__UCLIBC_USE_TIME64__) + unsigned long int __sem_ctime_internal_1; /* last time changed by semctl() */ + unsigned long int __sem_ctime_internal_2; +#else __time_t sem_ctime; /* last time changed by semctl() */ +#endif unsigned long int sem_nsems; /* number of semaphores in set */ +#if defined(__UCLIBC_USE_TIME64__) + __time_t sem_otime; + __time_t sem_ctime; +#endif unsigned long __uclibc_unused3; unsigned long __uclibc_unused4; }; + /* The user should define a union like the following to use it for arguments for `semctl'. diff --git a/libc/sysdeps/linux/powerpc/bits/uClibc_arch_features.h b/libc/sysdeps/linux/powerpc/bits/uClibc_arch_features.h index bc6ae652e..661069384 100644 --- a/libc/sysdeps/linux/powerpc/bits/uClibc_arch_features.h +++ b/libc/sysdeps/linux/powerpc/bits/uClibc_arch_features.h @@ -11,9 +11,6 @@ /* can your target use syscall6() for mmap ? */ #define __UCLIBC_MMAP_HAS_6_ARGS__ -/* does your target use statx */ -#undef __UCLIBC_HAVE_STATX__ - /* does your target align 64bit values in register pairs ? (32bit arches only) */ #define __UCLIBC_SYSCALL_ALIGN_64BIT__ diff --git a/libc/sysdeps/linux/powerpc/crt1.S b/libc/sysdeps/linux/powerpc/crt1.S index 27bfc5a5a..3ac32636c 100644 --- a/libc/sysdeps/linux/powerpc/crt1.S +++ b/libc/sysdeps/linux/powerpc/crt1.S @@ -41,6 +41,9 @@ .weak _init .weak _fini #endif +#ifdef L_rcrt1 + .type reloc_static_pie,%function +#endif .type main,%function .type __uClibc_main,%function @@ -57,6 +60,26 @@ _start: bl _GLOBAL_OFFSET_TABLE_-4@local mflr r31 # endif + /* in PIC/PIE, plt stubs need r30 to point to the GOT if using secure-plt */ +# ifdef PPC_HAS_SECUREPLT + mr 30,31 +# endif +#ifdef L_rcrt1 + stwu r3, -4(r1) /* Save r3 */ + stwu r9, -16(r1) /* Save r9 */ + bcl 20,31,2f /* Jump to label 2 */ +2: mflr r3 /* Load lr into r3 */ + addis r3, r3, _DYNAMIC-2b@ha /* Add high half of _DYNAMIC to r3 */ + addi r3,r3,_DYNAMIC-2b@l /* Add low half of _DYNAMIC */ + lwz r4, 0(r31) /* load _DYNAMIC from the GOT */ + subf r3, r4, r3 /* sub _DYNAMIC@got and it's actual address */ + bl reloc_static_pie /* Call reloc_static_pie */ + lwzu r9, 0(r1) /* restore r9 */ + addi r1, r1, 16 /* update stack pointer */ + lwzu r3, 0(r1) /* restore r3 */ + addi r1, r1, 4 /* update stack pointer */ + li r5, 0 /* zero r5 */ +#endif #endif /* Set up the small data pointer in r13. */ #ifdef __PIC__ diff --git a/libc/sysdeps/linux/powerpc/sys/procfs.h b/libc/sysdeps/linux/powerpc/sys/procfs.h index 7ae12e3cc..9e6ec191c 100644 --- a/libc/sysdeps/linux/powerpc/sys/procfs.h +++ b/libc/sysdeps/linux/powerpc/sys/procfs.h @@ -34,7 +34,7 @@ __BEGIN_DECLS /* These definitions are normally provided by ucontext.h via asm/sigcontext.h, asm/ptrace.h, and asm/elf.h. Otherwise we define them here. */ -#ifndef __PPC64_ELF_H +#if !defined __PPC64_ELF_H && !defined _ASM_POWERPC_ELF_H #define ELF_NGREG 48 /* includes nip, msr, lr, etc. */ #define ELF_NFPREG 33 /* includes fpscr */ #if __WORDSIZE == 32 |