From 15be91c2a0f89940d6d6dc69fa698a32f6ee3078 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 16 Apr 2012 22:52:56 -0400 Subject: [PATCH] ia64: add split-out settings into dedicated files Logic specific to ia64 used to live in the main tree in common files. Now that we can't do that (with #ifdef and such), we need to add that logic into dedicated overriding files. Signed-off-by: Mike Frysinger --- ChangeLog.ia64 | 19 ++++++++ sysdeps/ia64/elf/stackguard-macros.h | 3 ++ sysdeps/ia64/ldsodefs.h | 42 ++++++++++++++++ sysdeps/ia64/nptl/shlib-versions | 1 + sysdeps/ia64/preconfigure | 3 ++ sysdeps/ia64/shlib-versions | 6 +++ sysdeps/ia64/stackguard-macros.h | 4 ++ sysdeps/ia64/tls-macros.h | 66 ++++++++++++++++++++++++++ sysdeps/ia64/tst-audit.h | 25 ++++++++++ sysdeps/unix/sysv/linux/ia64/configure | 10 ++++ sysdeps/unix/sysv/linux/ia64/configure.in | 10 ++++ sysdeps/unix/sysv/linux/ia64/kernel-features.h | 58 ++++++++++++++++++++++ 12 files changed, 247 insertions(+) create mode 100644 sysdeps/ia64/elf/stackguard-macros.h create mode 100644 sysdeps/ia64/ldsodefs.h create mode 100644 sysdeps/ia64/nptl/shlib-versions create mode 100644 sysdeps/ia64/preconfigure create mode 100644 sysdeps/ia64/shlib-versions create mode 100644 sysdeps/ia64/stackguard-macros.h create mode 100644 sysdeps/ia64/tls-macros.h create mode 100644 sysdeps/ia64/tst-audit.h create mode 100644 sysdeps/unix/sysv/linux/ia64/configure create mode 100644 sysdeps/unix/sysv/linux/ia64/configure.in create mode 100644 sysdeps/unix/sysv/linux/ia64/kernel-features.h diff --git a/ChangeLog.ia64 b/ChangeLog.ia64 index 07dc47c0a6..24f310ad42 100644 --- a/ChangeLog.ia64 +++ b/ChangeLog.ia64 @@ -1,5 +1,24 @@ 2012-04-27 Mike Frysinger + * sysdeps/ia64/elf/stackguard-macros.h: New stub include file. + * sysdeps/ia64/ldsodefs.h: Move ia64 logic from + sysdeps/generic/ldsodefs.h. + * sysdeps/ia64/nptl/shlib-versions: Move ia64 logic from + nptl/shlib-versions. + * sysdeps/ia64/preconfigure: Move ia64 logic from configure.in. + * sysdeps/ia64/shlib-versions: Move ia64 logic from shlib-versions. + * sysdeps/ia64/stackguard-macros.h: Move ia64 logic from + elf/stackguard-macros.h. + * sysdeps/ia64/tls-macros.h: Move ia64 logic from elf/tls-macros.h. + * sysdeps/ia64/tst-audit.h: Move ia64 logic from elf/tst-auditmod1.c. + * sysdeps/unix/sysv/linux/ia64/configure.in: Move ia64 logic from + sysdeps/unix/sysv/linux/configure. + * sysdeps/unix/sysv/linux/ia64/configure: Generate. + * sysdeps/unix/sysv/linux/ia64/kernel-features.h: Move ia64 logic + from sysdeps/unix/sysv/linux/kernel-features.h. + +2012-04-27 Mike Frysinger + * sysdeps/ia64/backtrace.c: Replace all contents with a single include of sysdeps/x86_64/backtrace.c. * sysdeps/unix/sysv/linux/ia64/nptl/fork.c: Change include path diff --git a/sysdeps/ia64/elf/stackguard-macros.h b/sysdeps/ia64/elf/stackguard-macros.h new file mode 100644 index 0000000000..606ad58596 --- /dev/null +++ b/sysdeps/ia64/elf/stackguard-macros.h @@ -0,0 +1,3 @@ +/* Tests in nptl/ look for while tests + in elf/ look for . Provide both. */ +#include "../stackguard-macros.h" diff --git a/sysdeps/ia64/ldsodefs.h b/sysdeps/ia64/ldsodefs.h new file mode 100644 index 0000000000..269319e841 --- /dev/null +++ b/sysdeps/ia64/ldsodefs.h @@ -0,0 +1,42 @@ +/* Run-time dynamic linker data structures for loaded ELF shared objects. + Copyright (C) 2012 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 + . */ + +#ifndef __LDSODEFS_H + +#include + +struct La_ia64_regs; +struct La_ia64_retval; + +#define ARCH_PLTENTER_MEMBERS \ + Elf64_Addr (*ia64_gnu_pltenter) (Elf64_Sym *, unsigned int, \ + uintptr_t *, uintptr_t *, \ + const struct La_ia64_regs *, \ + unsigned int *, const char *name, \ + long int *framesizep); + +#define ARCH_PLTEXIT_MEMBERS \ + unsigned int (*ia64_gnu_pltexit) (Elf64_Sym *, unsigned int, \ + uintptr_t *, uintptr_t *, \ + const struct La_ia64_regs *, \ + struct La_ia64_retval *, \ + const char *); + +#include_next + +#endif diff --git a/sysdeps/ia64/nptl/shlib-versions b/sysdeps/ia64/nptl/shlib-versions new file mode 100644 index 0000000000..90015eb151 --- /dev/null +++ b/sysdeps/ia64/nptl/shlib-versions @@ -0,0 +1 @@ +ia64.*-.*-linux.* libpthread=0 GLIBC_2.2 diff --git a/sysdeps/ia64/preconfigure b/sysdeps/ia64/preconfigure new file mode 100644 index 0000000000..76cb729fcf --- /dev/null +++ b/sysdeps/ia64/preconfigure @@ -0,0 +1,3 @@ +case "$machine" in +ia64*) libc_commonpagesize=0x4000 ;; +esac diff --git a/sysdeps/ia64/shlib-versions b/sysdeps/ia64/shlib-versions new file mode 100644 index 0000000000..b41f6c2aa3 --- /dev/null +++ b/sysdeps/ia64/shlib-versions @@ -0,0 +1,6 @@ +ia64-.*-linux.* libc=6.1 GLIBC_2.2 +ia64-.*-linux.* libm=6.1 GLIBC_2.2 + +ia64-.*-linux.* ld=ld-linux-ia64.so.2 GLIBC_2.2 + +ia64-.*-.* libBrokenLocale=1 GLIBC_2.2 diff --git a/sysdeps/ia64/stackguard-macros.h b/sysdeps/ia64/stackguard-macros.h new file mode 100644 index 0000000000..dc683c28c5 --- /dev/null +++ b/sysdeps/ia64/stackguard-macros.h @@ -0,0 +1,4 @@ +#include + +#define STACK_CHK_GUARD \ + ({ uintptr_t x; asm ("adds %0 = -8, r13;; ld8 %0 = [%0]" : "=r" (x)); x; }) diff --git a/sysdeps/ia64/tls-macros.h b/sysdeps/ia64/tls-macros.h new file mode 100644 index 0000000000..13b216d85d --- /dev/null +++ b/sysdeps/ia64/tls-macros.h @@ -0,0 +1,66 @@ +/* Macros to support TLS testing in times of missing compiler support. */ + +extern void *__tls_get_addr (void *); + +# define TLS_LE(x) \ + ({ void *__l; \ + asm ("mov r2=r13\n\t" \ + ";;\n\t" \ + "addl %0=@tprel(" #x "),r2\n\t" \ + : "=r" (__l) : : "r2" ); __l; }) + +# define TLS_IE(x) \ + ({ void *__l; \ + register long __gp asm ("gp"); \ + asm (";;\n\t" \ + "addl r16=@ltoff(@tprel(" #x ")),gp\n\t" \ + ";;\n\t" \ + "ld8 r17=[r16]\n\t" \ + ";;\n\t" \ + "add %0=r13,r17\n\t" \ + ";;\n\t" \ + : "=r" (__l) : "r" (__gp) : "r16", "r17" ); __l; }) + +# define __TLS_CALL_CLOBBERS \ + "r2", "r3", "r8", "r9", "r10", "r11", "r14", "r15", "r16", "r17", \ + "r18", "r19", "r20", "r21", "r22", "r23", "r24", "r25", "r26", \ + "r27", "r28", "r29", "r30", "r31", \ + "p6", "p7", "p8", "p9", "p10", "p11", "p12", "p13", "p14", "p15", \ + "f6", "f7", "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \ + "b6", "b7", \ + "out0", "out1", "out2", "out3", "out4", "out5", "out6", "out7" + +# define TLS_LD(x) \ + ({ void *__l; \ + register long __gp asm ("gp"); \ + asm (";;\n\t" \ + "mov loc0=gp\n\t" \ + "addl r16=@ltoff(@dtpmod(" #x ")),gp\n\t" \ + "addl out1=@dtprel(" #x "),r0\n\t" \ + ";;\n\t" \ + "ld8 out0=[r16]\n\t" \ + "br.call.sptk.many b0=__tls_get_addr" \ + ";;\n\t" \ + "mov gp=loc0\n\t" \ + "mov %0=r8\n\t" \ + ";;\n\t" \ + : "=r" (__l) : "r" (__gp) : "loc0", __TLS_CALL_CLOBBERS); \ + __l; }) + +# define TLS_GD(x) \ + ({ void *__l; \ + register long __gp asm ("gp"); \ + asm (";;\n\t" \ + "mov loc0=gp\n\t" \ + "addl r16=@ltoff(@dtpmod(" #x ")),gp\n\t" \ + "addl r17=@ltoff(@dtprel(" #x ")),gp\n\t" \ + ";;\n\t" \ + "ld8 out0=[r16]\n\t" \ + "ld8 out1=[r17]\n\t" \ + "br.call.sptk.many b0=__tls_get_addr" \ + ";;\n\t" \ + "mov gp=loc0\n\t" \ + "mov %0=r8\n\t" \ + ";;\n\t" \ + : "=r" (__l) : "r" (__gp) : "loc0", __TLS_CALL_CLOBBERS); \ + __l; }) diff --git a/sysdeps/ia64/tst-audit.h b/sysdeps/ia64/tst-audit.h new file mode 100644 index 0000000000..cb4af25711 --- /dev/null +++ b/sysdeps/ia64/tst-audit.h @@ -0,0 +1,25 @@ +/* Definitions for testing PLT entry/exit auditing. IA64 version. + + Copyright (C) 2012 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 + . */ + +#define pltenter la_ia64_gnu_pltenter +#define pltexit la_ia64_gnu_pltexit +#define La_regs La_ia64_regs +#define La_retval La_ia64_retval +#define int_retval lrv_r8 diff --git a/sysdeps/unix/sysv/linux/ia64/configure b/sysdeps/unix/sysv/linux/ia64/configure new file mode 100644 index 0000000000..3d025f9dda --- /dev/null +++ b/sysdeps/unix/sysv/linux/ia64/configure @@ -0,0 +1,10 @@ +# This file is generated from configure.in by Autoconf. DO NOT EDIT! + # Local configure fragment for sysdeps/unix/sysv/linux/ia64 + +# There are several bits that no longer compile cleanly without +# realtime signal support (ver 2.2.0). Given that we also now +# require TLS (ver 2.6.0), it seems pointless to fix them. +# ??? Surely this should now be the generic default. +arch_minimum_kernel=2.6.0 + +ldd_rewrite_script=$dir/ldd-rewrite.sed diff --git a/sysdeps/unix/sysv/linux/ia64/configure.in b/sysdeps/unix/sysv/linux/ia64/configure.in new file mode 100644 index 0000000000..99057b8bd1 --- /dev/null +++ b/sysdeps/unix/sysv/linux/ia64/configure.in @@ -0,0 +1,10 @@ +GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. +# Local configure fragment for sysdeps/unix/sysv/linux/ia64 + +# There are several bits that no longer compile cleanly without +# realtime signal support (ver 2.2.0). Given that we also now +# require TLS (ver 2.6.0), it seems pointless to fix them. +# ??? Surely this should now be the generic default. +arch_minimum_kernel=2.6.0 + +ldd_rewrite_script=$dir/ldd-rewrite.sed diff --git a/sysdeps/unix/sysv/linux/ia64/kernel-features.h b/sysdeps/unix/sysv/linux/ia64/kernel-features.h new file mode 100644 index 0000000000..3e972602a1 --- /dev/null +++ b/sysdeps/unix/sysv/linux/ia64/kernel-features.h @@ -0,0 +1,58 @@ +/* Set flags signalling availability of kernel features based on given + kernel version number. + Copyright (C) 2010-2012 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 + . */ + +#ifndef _KERNEL_FEATURES_H +#define _KERNEL_FEATURES_H 1 + +/* The late 2.5 kernels saw a lot of new CLONE_* flags. Summarize + their availability with one define. */ +#if __LINUX_KERNEL_VERSION >= 132416 +# define __ASSUME_CLONE_THREAD_FLAGS 1 +#endif + +/* The utimes syscall has been available for some architectures + forever. */ +#define __ASSUME_UTIMES 1 + +/* pselect/ppoll were introduced just after 2.6.16-rc1. Due to the way + the kernel versions are advertised we can only rely on 2.6.17 to have + the code. */ +#if __LINUX_KERNEL_VERSION >= 0x020616 +# define __ASSUME_PSELECT 1 +# define __ASSUME_PPOLL 1 +#endif + +/* Support for various CLOEXEC and NONBLOCK flags was added in 2.6.23. */ +#if __LINUX_KERNEL_VERSION >= 0x020617 +# define __ASSUME_O_CLOEXEC 1 +#endif + +/* Support for various CLOEXEC and NONBLOCK flags was added in 2.6.27. */ +#if __LINUX_KERNEL_VERSION >= 0x02061b +# define __ASSUME_SOCK_CLOEXEC 1 +# define __ASSUME_IN_NONBLOCK 1 +# define __ASSUME_PIPE2 1 +# define __ASSUME_EVENTFD2 1 +# define __ASSUME_SIGNALFD4 1 +# define __ASSUME_DUP3 1 +#endif + +#include_next + +#endif /* _KERNEL_FEATURES_H */ -- 2.11.4.GIT