From 0ecb606cb6cf65de1d9fc8a919bceb4be476c602 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 12 Jul 2007 18:26:36 +0000 Subject: 2.5-18.1 --- sysdeps/hppa/Dist | 5 - sysdeps/hppa/Makefile | 41 -- sysdeps/hppa/Versions | 12 - sysdeps/hppa/__longjmp.S | 72 --- sysdeps/hppa/abort-instr.h | 6 - sysdeps/hppa/add_n.s | 58 --- sysdeps/hppa/bits/endian.h | 7 - sysdeps/hppa/bits/link.h | 6 - sysdeps/hppa/bits/setjmp.h | 41 -- sysdeps/hppa/bsd-_setjmp.S | 39 -- sysdeps/hppa/bsd-setjmp.S | 36 -- sysdeps/hppa/configure | 34 -- sysdeps/hppa/configure.in | 22 - sysdeps/hppa/dl-fptr.h | 35 -- sysdeps/hppa/dl-lookupcfg.h | 69 --- sysdeps/hppa/dl-machine.h | 762 -------------------------------- sysdeps/hppa/dl-symaddr.c | 36 -- sysdeps/hppa/elf/entry.h | 10 - sysdeps/hppa/elf/initfini.c | 139 ------ sysdeps/hppa/elf/start.S | 97 ----- sysdeps/hppa/fpu/bits/fenv.h | 78 ---- sysdeps/hppa/fpu/fclrexcpt.c | 37 -- sysdeps/hppa/fpu/fedisblxcpt.c | 37 -- sysdeps/hppa/fpu/feenablxcpt.c | 37 -- sysdeps/hppa/fpu/fegetenv.c | 33 -- sysdeps/hppa/fpu/fegetexcept.c | 32 -- sysdeps/hppa/fpu/fegetround.c | 32 -- sysdeps/hppa/fpu/feholdexcpt.c | 56 --- sysdeps/hppa/fpu/fesetenv.c | 66 --- sysdeps/hppa/fpu/fesetround.c | 39 -- sysdeps/hppa/fpu/feupdateenv.c | 37 -- sysdeps/hppa/fpu/fgetexcptflg.c | 36 -- sysdeps/hppa/fpu/fraiseexcpt.c | 102 ----- sysdeps/hppa/fpu/fsetexcptflg.c | 40 -- sysdeps/hppa/fpu/ftestexcept.c | 32 -- sysdeps/hppa/fpu/libm-test-ulps | 890 -------------------------------------- sysdeps/hppa/frame.h | 28 -- sysdeps/hppa/gccframe.h | 23 - sysdeps/hppa/hppa1.1/Implies | 4 - sysdeps/hppa/hppa1.1/addmul_1.s | 104 ----- sysdeps/hppa/hppa1.1/mul_1.s | 100 ----- sysdeps/hppa/hppa1.1/submul_1.s | 113 ----- sysdeps/hppa/hppa1.1/udiv_qrnnd.s | 78 ---- sysdeps/hppa/libgcc-compat.c | 43 -- sysdeps/hppa/lshift.s | 66 --- sysdeps/hppa/machine-gmon.h | 25 -- sysdeps/hppa/memusage.h | 22 - sysdeps/hppa/mp_clz_tab.c | 1 - sysdeps/hppa/rshift.s | 63 --- sysdeps/hppa/setjmp.S | 69 --- sysdeps/hppa/stackinfo.h | 28 -- sysdeps/hppa/sub_n.s | 59 --- sysdeps/hppa/sysdep.h | 82 ---- sysdeps/hppa/udiv_qrnnd.s | 286 ------------ 54 files changed, 4305 deletions(-) delete mode 100644 sysdeps/hppa/Dist delete mode 100644 sysdeps/hppa/Makefile delete mode 100644 sysdeps/hppa/Versions delete mode 100644 sysdeps/hppa/__longjmp.S delete mode 100644 sysdeps/hppa/abort-instr.h delete mode 100644 sysdeps/hppa/add_n.s delete mode 100644 sysdeps/hppa/bits/endian.h delete mode 100644 sysdeps/hppa/bits/link.h delete mode 100644 sysdeps/hppa/bits/setjmp.h delete mode 100644 sysdeps/hppa/bsd-_setjmp.S delete mode 100644 sysdeps/hppa/bsd-setjmp.S delete mode 100755 sysdeps/hppa/configure delete mode 100644 sysdeps/hppa/configure.in delete mode 100644 sysdeps/hppa/dl-fptr.h delete mode 100644 sysdeps/hppa/dl-lookupcfg.h delete mode 100644 sysdeps/hppa/dl-machine.h delete mode 100644 sysdeps/hppa/dl-symaddr.c delete mode 100644 sysdeps/hppa/elf/entry.h delete mode 100644 sysdeps/hppa/elf/initfini.c delete mode 100644 sysdeps/hppa/elf/start.S delete mode 100644 sysdeps/hppa/fpu/bits/fenv.h delete mode 100644 sysdeps/hppa/fpu/fclrexcpt.c delete mode 100644 sysdeps/hppa/fpu/fedisblxcpt.c delete mode 100644 sysdeps/hppa/fpu/feenablxcpt.c delete mode 100644 sysdeps/hppa/fpu/fegetenv.c delete mode 100644 sysdeps/hppa/fpu/fegetexcept.c delete mode 100644 sysdeps/hppa/fpu/fegetround.c delete mode 100644 sysdeps/hppa/fpu/feholdexcpt.c delete mode 100644 sysdeps/hppa/fpu/fesetenv.c delete mode 100644 sysdeps/hppa/fpu/fesetround.c delete mode 100644 sysdeps/hppa/fpu/feupdateenv.c delete mode 100644 sysdeps/hppa/fpu/fgetexcptflg.c delete mode 100644 sysdeps/hppa/fpu/fraiseexcpt.c delete mode 100644 sysdeps/hppa/fpu/fsetexcptflg.c delete mode 100644 sysdeps/hppa/fpu/ftestexcept.c delete mode 100644 sysdeps/hppa/fpu/libm-test-ulps delete mode 100644 sysdeps/hppa/frame.h delete mode 100644 sysdeps/hppa/gccframe.h delete mode 100644 sysdeps/hppa/hppa1.1/Implies delete mode 100644 sysdeps/hppa/hppa1.1/addmul_1.s delete mode 100644 sysdeps/hppa/hppa1.1/mul_1.s delete mode 100644 sysdeps/hppa/hppa1.1/submul_1.s delete mode 100644 sysdeps/hppa/hppa1.1/udiv_qrnnd.s delete mode 100644 sysdeps/hppa/libgcc-compat.c delete mode 100644 sysdeps/hppa/lshift.s delete mode 100644 sysdeps/hppa/machine-gmon.h delete mode 100644 sysdeps/hppa/memusage.h delete mode 100644 sysdeps/hppa/mp_clz_tab.c delete mode 100644 sysdeps/hppa/rshift.s delete mode 100644 sysdeps/hppa/setjmp.S delete mode 100644 sysdeps/hppa/stackinfo.h delete mode 100644 sysdeps/hppa/sub_n.s delete mode 100644 sysdeps/hppa/sysdep.h delete mode 100644 sysdeps/hppa/udiv_qrnnd.s (limited to 'sysdeps/hppa') diff --git a/sysdeps/hppa/Dist b/sysdeps/hppa/Dist deleted file mode 100644 index 5a0df47c68..0000000000 --- a/sysdeps/hppa/Dist +++ /dev/null @@ -1,5 +0,0 @@ -libgcc-compat.c -dl-symaddr.c -dl-fptr.c -bits/link.h -elf/entry.h diff --git a/sysdeps/hppa/Makefile b/sysdeps/hppa/Makefile deleted file mode 100644 index 73947031dc..0000000000 --- a/sysdeps/hppa/Makefile +++ /dev/null @@ -1,41 +0,0 @@ -# Copyright (C) 2000, 2001 Free Software Foundation, Inc. -# This file is part of the GNU C Library. -# Contributed by David Huggins-Daines (dhd@debian.org) - -# 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, write to the Free -# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -# 02111-1307 USA. - -# We used to need this since the build process uses ld -r. Now we use -# ld -r --unique=.text* which does more or less the same thing, but better. -# CFLAGS-.os += -ffunction-sections -LDFLAGS-c_pic.os += -Wl,--unique=.text* - -ifeq ($(subdir),elf) -CFLAGS-rtld.c += -mdisable-fpregs -sysdep-dl-routines += dl-symaddr dl-fptr -sysdep_routines += $(sysdep-dl-routines) -sysdep-rtld-routines += $(sysdep-dl-routines) -endif - -ifeq ($(subdir),csu) -ifeq (yes,$(build-shared)) -# Compatibility -ifeq (yes,$(have-protected)) -CPPFLAGS-libgcc-compat.c = -DHAVE_DOT_HIDDEN -endif -sysdep_routines += libgcc-compat -shared-only-routines += libgcc-compat -endif -endif diff --git a/sysdeps/hppa/Versions b/sysdeps/hppa/Versions deleted file mode 100644 index 2ae3cbdf17..0000000000 --- a/sysdeps/hppa/Versions +++ /dev/null @@ -1,12 +0,0 @@ -ld { - GLIBC_PRIVATE { - # hppa specific functions in the dynamic linker, but used by libc.so. - _dl_symbol_address; _dl_unmap; _dl_lookup_address; - _dl_function_address; - } -} -libc { - GLIBC_2.2 { - __clz_tab; - } -} diff --git a/sysdeps/hppa/__longjmp.S b/sysdeps/hppa/__longjmp.S deleted file mode 100644 index dee4d9f7b5..0000000000 --- a/sysdeps/hppa/__longjmp.S +++ /dev/null @@ -1,72 +0,0 @@ -/* longjmp for PA-RISC. - Copyright (C) 1997, 1998 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, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include -#define _SETJMP_H -#define _ASM -#include - -/* __longjmp(jmpbuf, val) */ - - .text - .align 4 - .globl __longjmp - .export __longjmp, code - .proc - .callinfo -__longjmp: - /* set return value */ - copy %r25, %r28 - - ldw 0(%r26), %r3 - ldw 8(%r26), %r4 - ldw 12(%r26), %r5 - ldw 16(%r26), %r6 - ldw 20(%r26), %r7 - ldw 24(%r26), %r8 - ldw 28(%r26), %r9 - ldw 32(%r26), %r10 - ldw 36(%r26), %r11 - ldw 40(%r26), %r12 - ldw 44(%r26), %r13 - ldw 48(%r26), %r14 - ldw 52(%r26), %r15 - ldw 56(%r26), %r16 - ldw 60(%r26), %r17 - ldw 64(%r26), %r18 - ldw 68(%r26), %r19 - ldw 72(%r26), %r27 - ldw 76(%r26), %r30 - - ldw 80(%r26), %rp - - ldo 88(%r26),%r20 - fldds,ma 8(%r20), %fr12 - fldds,ma 8(%r20), %fr13 - fldds,ma 8(%r20), %fr14 - fldds,ma 8(%r20), %fr15 - fldds,ma 8(%r20), %fr16 - fldds,ma 8(%r20), %fr17 - fldds,ma 8(%r20), %fr18 - fldds,ma 8(%r20), %fr19 - fldds,ma 8(%r20), %fr20 - fldds 0(%r20), %fr21 - - bv,n %r0(%r2) - .procend diff --git a/sysdeps/hppa/abort-instr.h b/sysdeps/hppa/abort-instr.h deleted file mode 100644 index f1afea46de..0000000000 --- a/sysdeps/hppa/abort-instr.h +++ /dev/null @@ -1,6 +0,0 @@ -/* An instruction privileged instruction to crash a userspace program. - - We go with iitlbp because it has a history of being used to crash - programs. */ - -#define ABORT_INSTRUCTION asm ("iitlbp %r0,(%r0)") diff --git a/sysdeps/hppa/add_n.s b/sysdeps/hppa/add_n.s deleted file mode 100644 index aaabd72e20..0000000000 --- a/sysdeps/hppa/add_n.s +++ /dev/null @@ -1,58 +0,0 @@ -;! HP-PA __mpn_add_n -- Add two limb vectors of the same length > 0 and store -;! sum in a third limb vector. - -;! Copyright (C) 1992, 1994 Free Software Foundation, Inc. - -;! This file is part of the GNU MP Library. - -;! The GNU MP 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 MP 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 MP Library; see the file COPYING.LIB. If not, write to -;! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, -;! MA 02111-1307, USA. - - -;! INPUT PARAMETERS -;! res_ptr gr26 -;! s1_ptr gr25 -;! s2_ptr gr24 -;! size gr23 - -;! One might want to unroll this as for other processors, but it turns -;! out that the data cache contention after a store makes such -;! unrolling useless. We can't come under 5 cycles/limb anyway. - - .text - .export __mpn_add_n -__mpn_add_n: - .proc - .callinfo frame=0,no_calls - .entry - - ldws,ma 4(0,%r25),%r21 - ldws,ma 4(0,%r24),%r20 - - addib,= -1,%r23,L$end ;! check for (SIZE == 1) - add %r21,%r20,%r28 ;! add first limbs ignoring cy - -L$loop: ldws,ma 4(0,%r25),%r21 - ldws,ma 4(0,%r24),%r20 - stws,ma %r28,4(0,%r26) - addib,<> -1,%r23,L$loop - addc %r21,%r20,%r28 - -L$end: stws %r28,0(0,%r26) - bv 0(%r2) - addc %r0,%r0,%r28 - - .exit - .procend diff --git a/sysdeps/hppa/bits/endian.h b/sysdeps/hppa/bits/endian.h deleted file mode 100644 index 585db0c0fa..0000000000 --- a/sysdeps/hppa/bits/endian.h +++ /dev/null @@ -1,7 +0,0 @@ -/* hppa1.1 big-endian. */ - -#ifndef _ENDIAN_H -# error "Never use directly; include instead." -#endif - -#define __BYTE_ORDER __BIG_ENDIAN diff --git a/sysdeps/hppa/bits/link.h b/sysdeps/hppa/bits/link.h deleted file mode 100644 index 54842b2299..0000000000 --- a/sysdeps/hppa/bits/link.h +++ /dev/null @@ -1,6 +0,0 @@ -/* Used to store the function descriptor table */ -struct link_map_machine - { - size_t fptr_table_len; - ElfW(Addr) *fptr_table; - }; diff --git a/sysdeps/hppa/bits/setjmp.h b/sysdeps/hppa/bits/setjmp.h deleted file mode 100644 index 7fb2af77d0..0000000000 --- a/sysdeps/hppa/bits/setjmp.h +++ /dev/null @@ -1,41 +0,0 @@ -/* Copyright (C) 2000 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, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -/* Define the machine-dependent type `jmp_buf'. HPPA version. */ - -#ifndef _SETJMP_H -# error "Never include directly; use instead." -#endif - -/* The previous bits/setjmp.h had __jmp_buf defined as a structure. - We use an array of 'double' instead, to make writing the assembler - easier, and to ensure proper alignment. Naturally, user code should - not depend on either representation. */ - -#if defined __USE_MISC || defined _ASM -#define JB_SP (76/4) -#endif - -#ifndef _ASM -typedef double __jmp_buf[21]; -#endif - -/* Test if longjmp to JMPBUF would unwind the frame containing a local - variable at ADDRESS. */ -#define _JMPBUF_UNWINDS(_jmpbuf, _address) \ - ((void *)(_address) > (void *)(((unsigned long *) _jmpbuf)[JB_SP])) diff --git a/sysdeps/hppa/bsd-_setjmp.S b/sysdeps/hppa/bsd-_setjmp.S deleted file mode 100644 index e5ec94c122..0000000000 --- a/sysdeps/hppa/bsd-_setjmp.S +++ /dev/null @@ -1,39 +0,0 @@ -/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. HPPA version. - Copyright (C) 2001, 2002 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, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include - -/* This just does a tail-call to `__sigsetjmp (ARG, 1)'. - We cannot do it in C because it must be a tail-call, so frame-unwinding - in setjmp doesn't clobber the state restored by longjmp. */ - - .text - .align 4 - .globl _setjmp - .export _setjmp, code - .level 2.0 - .proc - .callinfo - .import __sigsetjmp -_setjmp: - b __sigsetjmp - ldi 0, %r25 - - .procend -libc_hidden_def (_setjmp) diff --git a/sysdeps/hppa/bsd-setjmp.S b/sysdeps/hppa/bsd-setjmp.S deleted file mode 100644 index 04ddba4652..0000000000 --- a/sysdeps/hppa/bsd-setjmp.S +++ /dev/null @@ -1,36 +0,0 @@ -/* BSD `setjmp' entry point to `sigsetjmp (..., 1)'. HPPA version. - Copyright (C) 2001 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, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -/* This just does a tail-call to `__sigsetjmp (ARG, 1)'. - We cannot do it in C because it must be a tail-call, so frame-unwinding - in setjmp doesn't clobber the state restored by longjmp. */ - - .text - .align 4 - .globl setjmp - .export setjmp, code - .level 2.0 - .proc - .callinfo - .import __sigsetjmp -setjmp: - b __sigsetjmp - ldi 1, %r25 - - .procend diff --git a/sysdeps/hppa/configure b/sysdeps/hppa/configure deleted file mode 100755 index 07bde0e0ee..0000000000 --- a/sysdeps/hppa/configure +++ /dev/null @@ -1,34 +0,0 @@ -# This file is generated from configure.in by Autoconf. DO NOT EDIT! - -hppa*linux*) -echo "$as_me:$LINENO: checking for assembler line separator" >&5 -echo $ECHO_N "checking for assembler line separator... $ECHO_C" >&6 -if test "${libc_cv_asm_line_sep+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat > conftest.s <&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - libc_cv_asm_line_sep='!' -else - if test -z "$enable_hacker_mode"; then - echo "*** You need a newer assembler to compile glibc" - rm -f conftest* - exit 1 - fi - libc_cv_asm_line_sep=';' -fi -rm -f conftest* -fi -echo "$as_me:$LINENO: result: $libc_cv_asm_line_sep" >&5 -echo "${ECHO_T}$libc_cv_asm_line_sep" >&6 -cat >>confdefs.h <<_ACEOF -#define ASM_LINE_SEP $libc_cv_asm_line_sep -_ACEOF - diff --git a/sysdeps/hppa/configure.in b/sysdeps/hppa/configure.in deleted file mode 100644 index 1ec6780835..0000000000 --- a/sysdeps/hppa/configure.in +++ /dev/null @@ -1,22 +0,0 @@ -GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory. - -dnl The standard hppa assembler uses `;' to start comments and `!' -dnl as a line separator. -hppa*linux*) -AC_CACHE_CHECK(for assembler line separator, - libc_cv_asm_line_sep, [dnl -cat > conftest.s <&AS_MESSAGE_LOG_FD); then - libc_cv_asm_line_sep='!' -else - if test -z "$enable_hacker_mode"; then - echo "*** You need a newer assembler to compile glibc" - rm -f conftest* - exit 1 - fi - libc_cv_asm_line_sep=';' -fi -rm -f conftest*]) -AC_DEFINE_UNQUOTED(ASM_LINE_SEP, $libc_cv_asm_line_sep) diff --git a/sysdeps/hppa/dl-fptr.h b/sysdeps/hppa/dl-fptr.h deleted file mode 100644 index 2ac9740e30..0000000000 --- a/sysdeps/hppa/dl-fptr.h +++ /dev/null @@ -1,35 +0,0 @@ -/* Function descriptors. HPPA version. - Copyright (C) 2003 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, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef dl_hppa_fptr_h -#define dl_hppa_fptr_h 1 - -#include - -/* There are currently 20 dynamic symbols in ld.so. - ELF_MACHINE_BOOT_FPTR_TABLE_LEN needs to be at least that big. */ -#define ELF_MACHINE_BOOT_FPTR_TABLE_LEN 200 - -#define ELF_MACHINE_LOAD_ADDRESS(var, symbol) \ - asm (" addil LT%%" #symbol ", %%r19\n" \ - " ldw RT%%" #symbol "(%%sr0,%%r1), %0\n" \ - : "=&r" (var)); - - -#endif /* !dl_hppa_fptr_h */ diff --git a/sysdeps/hppa/dl-lookupcfg.h b/sysdeps/hppa/dl-lookupcfg.h deleted file mode 100644 index d393b3e427..0000000000 --- a/sysdeps/hppa/dl-lookupcfg.h +++ /dev/null @@ -1,69 +0,0 @@ -/* Configuration of lookup functions. - Copyright (C) 2000 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, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -/* Like IA-64, PA-RISC needs more information from the symbol lookup - function than just the address. */ -#define DL_LOOKUP_RETURNS_MAP -#define ELF_FUNCTION_PTR_IS_SPECIAL -#define DL_UNMAP_IS_SPECIAL - -/* Forward declaration. */ -struct link_map; - -void *_dl_symbol_address (struct link_map *map, const ElfW(Sym) *ref); - -#define DL_SYMBOL_ADDRESS(map, ref) _dl_symbol_address(map, ref) - -Elf32_Addr _dl_lookup_address (const void *address); - -/* Clear the bottom two bits so generic code can find the fdesc entry */ -#define DL_LOOKUP_ADDRESS(addr) \ - (_dl_lookup_address ((void *)((unsigned long)addr & ~3))) - -void _dl_unmap (struct link_map *map); - -#define DL_UNMAP(map) _dl_unmap (map) - -#define DL_AUTO_FUNCTION_ADDRESS(map, addr) \ -({ \ - unsigned int fptr[2]; \ - fptr[0] = (unsigned int) (addr); \ - fptr[1] = (map)->l_info[DT_PLTGOT]->d_un.d_ptr; \ - /* Set bit 30 to indicate to $$dyncall that this is a PLABEL. */ \ - (ElfW(Addr))((unsigned int)fptr | 2); \ -}) - -#define DL_STATIC_FUNCTION_ADDRESS(map, addr) \ -({ \ - static unsigned int fptr[2]; \ - fptr[0] = (unsigned int) (addr); \ - fptr[1] = (map)->l_info[DT_PLTGOT]->d_un.d_ptr; \ - /* Set bit 30 to indicate to $$dyncall that this is a PLABEL. */ \ - (ElfW(Addr))((unsigned int)fptr | 2); \ -}) - - -/* The test for "addr & 2" below is to accomodate old binaries which - violated the ELF ABI by pointing DT_INIT and DT_FINI at a function - descriptor. */ -#define DL_DT_INIT_ADDRESS(map, addr) \ - ((Elf32_Addr)(addr) & 2 ? (addr) : DL_AUTO_FUNCTION_ADDRESS (map, addr)) -#define DL_DT_FINI_ADDRESS(map, addr) \ - ((Elf32_Addr)(addr) & 2 ? (addr) : DL_AUTO_FUNCTION_ADDRESS (map, addr)) - diff --git a/sysdeps/hppa/dl-machine.h b/sysdeps/hppa/dl-machine.h deleted file mode 100644 index d29501d306..0000000000 --- a/sysdeps/hppa/dl-machine.h +++ /dev/null @@ -1,762 +0,0 @@ -/* Machine-dependent ELF dynamic relocation inline functions. PA-RISC version. - Copyright (C) 1995-1997,1999-2003 - Free Software Foundation, Inc. - Contributed by David Huggins-Daines - 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, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef dl_machine_h -#define dl_machine_h 1 - -#define ELF_MACHINE_NAME "hppa" - -#include -#include -#include -#include -#include -#include -#include - -# define VALID_ELF_OSABI(osabi) ((osabi == ELFOSABI_SYSV) || (osabi == ELFOSABI_LINUX)) -# define VALID_ELF_ABIVERSION(ver) (ver == 0) -# define VALID_ELF_HEADER(hdr,exp,size) \ - memcmp (hdr,exp,size-2) == 0 \ - && VALID_ELF_OSABI (hdr[EI_OSABI]) \ - && VALID_ELF_ABIVERSION (hdr[EI_ABIVERSION]) - -/* These two definitions must match the definition of the stub in - bfd/elf32-hppa.c (see plt_stub[]). - - a. Define the size of the *entire* stub we place at the end of the PLT - table (right up against the GOT). - - b. Define the number of bytes back from the GOT to the entry point of - the PLT stub. You see the PLT stub must be entered in the middle - so it can depwi to find it's own address (long jump stub) - - c. Define the size of a single PLT entry so we can jump over the - last entry to get the stub address */ - -#define SIZEOF_PLT_STUB (7*4) -#define GOT_FROM_PLT_STUB (4*4) -#define PLT_ENTRY_SIZE (2*4) - -/* Initialize the function descriptor table before relocations */ -static inline void -__hppa_init_bootstrap_fdesc_table (struct link_map *map) -{ - ElfW(Addr) *boot_table; - - /* Careful: this will be called before got has been relocated... */ - ELF_MACHINE_LOAD_ADDRESS(boot_table,_dl_boot_fptr_table); - - map->l_mach.fptr_table_len = ELF_MACHINE_BOOT_FPTR_TABLE_LEN; - map->l_mach.fptr_table = boot_table; -} - -#define ELF_MACHINE_BEFORE_RTLD_RELOC(dynamic_info) \ - __hppa_init_bootstrap_fdesc_table (&bootstrap_map); - -/* Return nonzero iff ELF header is compatible with the running host. */ -static inline int -elf_machine_matches_host (const Elf32_Ehdr *ehdr) -{ - return ehdr->e_machine == EM_PARISC; -} - -/* Return the link-time address of _DYNAMIC. */ -static inline Elf32_Addr -elf_machine_dynamic (void) __attribute__ ((const)); - -static inline Elf32_Addr -elf_machine_dynamic (void) -{ - Elf32_Addr dynamic; - - asm ("b,l 1f,%0\n" -" depi 0,31,2,%0\n" -"1: addil L'_GLOBAL_OFFSET_TABLE_ - ($PIC_pcrel$0 - 8),%0\n" -" ldw R'_GLOBAL_OFFSET_TABLE_ - ($PIC_pcrel$0 - 12)(%%r1),%0\n" - : "=r" (dynamic) : : "r1"); - - return dynamic; -} - -/* Return the run-time load address of the shared object. */ -static inline Elf32_Addr -elf_machine_load_address (void) __attribute__ ((const)); - -static inline Elf32_Addr -elf_machine_load_address (void) -{ - Elf32_Addr dynamic; - - asm ( -" b,l 1f,%0\n" -" depi 0,31,2,%0\n" -"1: addil L'_DYNAMIC - ($PIC_pcrel$0 - 8),%0\n" -" ldo R'_DYNAMIC - ($PIC_pcrel$0 - 12)(%%r1),%0\n" - : "=r" (dynamic) : : "r1"); - - return dynamic - elf_machine_dynamic (); -} - -/* Fixup a PLT entry to bounce directly to the function at VALUE. - Optimized non-profile version. */ -static inline Elf32_Addr -elf_machine_fixup_plt (struct link_map *map, lookup_t t, - const Elf32_Rela *reloc, - Elf32_Addr *reloc_addr, Elf32_Addr value) -{ - /* map is the link_map for the caller, t is the link_map for the object - being called */ - reloc_addr[1] = D_PTR (t, l_info[DT_PLTGOT]); - reloc_addr[0] = value; - /* Return the PLT slot rather than the function value so that the - trampoline can load the new LTP. */ - return (Elf32_Addr) reloc_addr; -} - -/* Fixup a PLT entry to bounce directly to the function at VALUE. */ -#define ELF_MACHINE_PROFILE_FIXUP_PLT elf_machine_profile_fixup_plt -static inline Elf32_Addr -elf_machine_profile_fixup_plt (struct link_map *map, lookup_t t, - const Elf32_Rela *reloc, - Elf32_Addr *reloc_addr, Elf32_Addr value) -{ - if(__builtin_expect (t == NULL, 1)) - return (Elf32_Addr) reloc_addr; - /* Return the PLT slot rather than the function value so that the - trampoline can load the new LTP. */ - return (Elf32_Addr) elf_machine_fixup_plt(map, t, reloc, reloc_addr, value); -} - -/* Return the final value of a plt relocation. */ -static inline Elf32_Addr -elf_machine_plt_value (struct link_map *map, const Elf32_Rela *reloc, - Elf32_Addr value) -{ - /* We are rela only */ - return value + reloc->r_addend; -} - -/* Set up the loaded object described by L so its unrelocated PLT - entries will jump to the on-demand fixup code in dl-runtime.c. */ - -static inline int -elf_machine_runtime_setup (struct link_map *l, int lazy, int profile) -{ - Elf32_Addr *got = NULL; - Elf32_Addr l_addr, iplt, jmprel, end_jmprel, r_type, r_sym; - const Elf32_Rela *reloc; - struct fdesc *fptr; - static union { - unsigned char c[8]; - Elf32_Addr i[2]; - } sig = {{0x00,0xc0,0xff,0xee, 0xde,0xad,0xbe,0xef}}; - - /* If we don't have a PLT we can just skip all this... */ - if (__builtin_expect (l->l_info[DT_JMPREL] == NULL,0)) - return lazy; - - /* All paths use these values */ - l_addr = l->l_addr; - jmprel = D_PTR(l, l_info[DT_JMPREL]); - end_jmprel = jmprel + l->l_info[DT_PLTRELSZ]->d_un.d_val; - - extern void _dl_runtime_resolve (void); - extern void _dl_runtime_profile (void); - - /* Linking lazily */ - if (lazy) - { - /* FIXME: Search for the got, but backwards through the relocs, technically we should - find it on the first try. However, assuming the relocs got out of order the - routine is made a bit more robust by searching them all in case of failure. */ - for (iplt = (end_jmprel - sizeof(Elf32_Rela)); iplt >= jmprel; iplt -= sizeof (Elf32_Rela)) - { - - reloc = (const Elf32_Rela *) iplt; - r_type = ELF32_R_TYPE (reloc->r_info); - r_sym = ELF32_R_SYM (reloc->r_info); - - got = (Elf32_Addr *) (reloc->r_offset + l_addr + PLT_ENTRY_SIZE + SIZEOF_PLT_STUB); - - /* If we aren't an IPLT, and we aren't NONE then it's a bad reloc */ - if (__builtin_expect (r_type != R_PARISC_IPLT, 0)) - { - if (__builtin_expect (r_type != R_PARISC_NONE, 0)) - _dl_reloc_bad_type (l, r_type, 1); - continue; - } - - /* Check for the plt_stub that binutils placed here for us - to use with _dl_runtime_resolve */ - if (got[-2] != sig.i[0] || got[-1] != sig.i[1]) - { - got = NULL; /* Not the stub... keep looking */ - } - else - { - /* Found the GOT! */ - register Elf32_Addr ltp __asm__ ("%r19"); - /* Identify this shared object. */ - got[1] = (Elf32_Addr) l; - - /* This function will be called to perform the relocation. */ - if (__builtin_expect (!profile, 1)) - { - /* If a static application called us, then _dl_runtime_resolve is not - a function descriptor, but the *real* address of the function... */ - if((unsigned long) &_dl_runtime_resolve & 3) - { - got[-2] = (Elf32_Addr) ((struct fdesc *) - ((unsigned long) &_dl_runtime_resolve & ~3))->ip; - } - else - { - /* Static executable! */ - got[-2] = (Elf32_Addr) &_dl_runtime_resolve; - } - } - else - { - if (_dl_name_match_p (GLRO(dl_profile), l)) - { - /* This is the object we are looking for. Say that - we really want profiling and the timers are - started. */ - GL(dl_profile_map) = l; - } - - if((unsigned long) &_dl_runtime_resolve & 3) - { - got[-2] = (Elf32_Addr) ((struct fdesc *) - ((unsigned long) &_dl_runtime_profile & ~3))->ip; - } - else - { - /* Static executable */ - got[-2] = (Elf32_Addr) &_dl_runtime_profile; - } - } - /* Plunk in the gp of this function descriptor so we - can make the call to _dl_runtime_xxxxxx */ - got[-1] = ltp; - break; - /* Done looking for the GOT, and stub is setup */ - } /* else we found the GOT */ - } /* for, walk the relocs backwards */ - - if(!got) - return 0; /* No lazy linking for you! */ - - /* Process all the relocs, now that we know the GOT... */ - for (iplt = jmprel; iplt < end_jmprel; iplt += sizeof (Elf32_Rela)) - { - reloc = (const Elf32_Rela *) iplt; - r_type = ELF32_R_TYPE (reloc->r_info); - r_sym = ELF32_R_SYM (reloc->r_info); - - if (__builtin_expect (r_type == R_PARISC_IPLT, 1)) - { - fptr = (struct fdesc *) (reloc->r_offset + l_addr); - if (r_sym != 0) - { - /* Relocate the pointer to the stub. */ - fptr->ip = (Elf32_Addr) got - GOT_FROM_PLT_STUB; - - /* Instead of the LTP value, we put the reloc offset - here. The trampoline code will load the proper - LTP and pass the reloc offset to the fixup - function. */ - fptr->gp = iplt - jmprel; - } /* r_sym != 0 */ - else - { - /* Relocate this *ABS* entry. */ - fptr->ip = reloc->r_addend + l_addr; - fptr->gp = D_PTR (l, l_info[DT_PLTGOT]); - } - } /* r_type == R_PARISC_IPLT */ - } /* for all the relocations */ - } /* if lazy */ - else - { - for (iplt = jmprel; iplt < end_jmprel; iplt += sizeof (Elf32_Rela)) - { - reloc = (const Elf32_Rela *) iplt; - r_type = ELF32_R_TYPE (reloc->r_info); - r_sym = ELF32_R_SYM (reloc->r_info); - - if (__builtin_expect ((r_type == R_PARISC_IPLT) && (r_sym == 0), 1)) - { - fptr = (struct fdesc *) (reloc->r_offset + l_addr); - /* Relocate this *ABS* entry, set only the gp, the rest is set later - when elf_machine_rela_relative is called (WITHOUT the linkmap) */ - fptr->gp = D_PTR (l, l_info[DT_PLTGOT]); - } /* r_type == R_PARISC_IPLT */ - } /* for all the relocations */ - } - return lazy; -} - -/* Initial entry point code for the dynamic linker. - The C function `_dl_start' is the real entry point; - its return value is the user program's entry point. */ - -#define RTLD_START \ -/* Set up dp for any non-PIC lib constructors that may be called. */ \ -static struct link_map * __attribute__((used)) \ -set_dp (struct link_map *map) \ -{ \ - register Elf32_Addr dp asm ("%r27"); \ - dp = D_PTR (map, l_info[DT_PLTGOT]); \ - asm volatile ("" : : "r" (dp)); \ - return map; \ -} \ - \ -asm ( \ -" .text\n" \ -" .globl _start\n" \ -" .type _start,@function\n" \ -"_start:\n" \ - /* The kernel does not give us an initial stack frame. */ \ -" ldo 64(%sp),%sp\n" \ - /* Save the relevant arguments (yes, those are the correct \ - registers, the kernel is weird) in their stack slots. */ \ -" stw %r25,-40(%sp)\n" /* argc */ \ -" stw %r24,-44(%sp)\n" /* argv */ \ - \ - /* We need the LTP, and we need it now. \ - $PIC_pcrel$0 points 8 bytes past the current instruction, \ - just like a branch reloc. This sequence gets us the \ - runtime address of _DYNAMIC. */ \ -" bl 0f,%r19\n" \ -" depi 0,31,2,%r19\n" /* clear priviledge bits */ \ -"0: addil L'_DYNAMIC - ($PIC_pcrel$0 - 8),%r19\n" \ -" ldo R'_DYNAMIC - ($PIC_pcrel$0 - 12)(%r1),%r26\n" \ - \ - /* The link time address is stored in the first entry of the \ - GOT. */ \ -" addil L'_GLOBAL_OFFSET_TABLE_ - ($PIC_pcrel$0 - 16),%r19\n" \ -" ldw R'_GLOBAL_OFFSET_TABLE_ - ($PIC_pcrel$0 - 20)(%r1),%r20\n" \ - \ -" sub %r26,%r20,%r20\n" /* Calculate load offset */ \ - \ - /* Rummage through the dynamic entries, looking for \ - DT_PLTGOT. */ \ -" ldw,ma 8(%r26),%r19\n" \ -"1: cmpib,=,n 3,%r19,2f\n" /* tag == DT_PLTGOT? */ \ -" cmpib,<>,n 0,%r19,1b\n" \ -" ldw,ma 8(%r26),%r19\n" \ - \ - /* Uh oh! We didn't find one. Abort. */ \ -" iitlbp %r0,(%r0)\n" \ - \ -"2: ldw -4(%r26),%r19\n" /* Found it, load value. */ \ -" add %r19,%r20,%r19\n" /* And add the load offset. */ \ - \ - /* Our initial stack layout is rather different from everyone \ - else's due to the unique PA-RISC ABI. As far as I know it \ - looks like this: \ - \ - ----------------------------------- (this frame created above) \ - | 32 bytes of magic | \ - |---------------------------------| \ - | 32 bytes argument/sp save area | \ - |---------------------------------| ((current->mm->env_end) \ - | N bytes of slack | + 63 & ~63) \ - |---------------------------------| \ - | envvar and arg strings | \ - |---------------------------------| \ - | ELF auxiliary info | \ - | (up to 28 words) | \ - |---------------------------------| \ - | Environment variable pointers | \ - | upwards to NULL | \ - |---------------------------------| \ - | Argument pointers | \ - | upwards to NULL | \ - |---------------------------------| \ - | argc (1 word) | \ - ----------------------------------- \ - \ - So, obviously, we can't just pass %sp to _dl_start. That's \ - okay, argv-4 will do just fine. \ - \ - The pleasant part of this is that if we need to skip \ - arguments we can just decrement argc and move argv, because \ - the stack pointer is utterly unrelated to the location of \ - the environment and argument vectors. */ \ - \ - /* This is always within range so we'll be okay. */ \ -" bl _dl_start,%rp\n" \ -" ldo -4(%r24),%r26\n" \ - \ -" .globl _dl_start_user\n" \ -" .type _dl_start_user,@function\n" \ -"_dl_start_user:\n" \ - /* Save the entry point in %r3. */ \ -" copy %ret0,%r3\n" \ - \ - /* Remember the lowest stack address. */ \ -" addil LT'__libc_stack_end,%r19\n" \ -" ldw RT'__libc_stack_end(%r1),%r20\n" \ -" stw %sp,0(%r20)\n" \ - \ - /* See if we were called as a command with the executable file \ - name as an extra leading argument. */ \ -" addil LT'_dl_skip_args,%r19\n" \ -" ldw RT'_dl_skip_args(%r1),%r20\n" \ -" ldw 0(%r20),%r20\n" \ - \ -" ldw -40(%sp),%r25\n" /* argc */ \ -" comib,= 0,%r20,.Lnofix\n" /* FIXME: Mispredicted branch */\ -" ldw -44(%sp),%r24\n" /* argv (delay slot) */ \ - \ -" sub %r25,%r20,%r25\n" \ -" stw %r25,-40(%sp)\n" \ -" sh2add %r20,%r24,%r24\n" \ -" stw %r24,-44(%sp)\n" \ - \ -".Lnofix:\n" \ -" addil LT'_rtld_local,%r19\n" \ -" ldw RT'_rtld_local(%r1),%r26\n" \ -" bl set_dp, %r2\n" \ -" ldw 0(%r26),%r26\n" \ - \ - /* Call _dl_init(_dl_loaded, argc, argv, envp). */ \ -" copy %r28,%r26\n" \ - \ - /* envp = argv + argc + 1 */ \ -" sh2add %r25,%r24,%r23\n" \ -" bl _dl_init_internal,%r2\n" \ -" ldo 4(%r23),%r23\n" /* delay slot */ \ - \ - /* Reload argc, argv to the registers start.S expects. */ \ -" ldw -40(%sp),%r25\n" \ -" ldw -44(%sp),%r24\n" \ - \ - /* _dl_fini does have a PLT slot now. I don't know how to get \ - to it though, so this hack will remain. */ \ -" .section .data\n" \ -"__dl_fini_plabel:\n" \ -" .word _dl_fini\n" \ -" .word 0xdeadbeef\n" \ -" .previous\n" \ - \ - /* %r3 contains a function pointer, we need to mask out the \ - lower bits and load the gp and jump address. */ \ -" depi 0,31,2,%r3\n" \ -" ldw 0(%r3),%r2\n" \ -" addil LT'__dl_fini_plabel,%r19\n" \ -" ldw RT'__dl_fini_plabel(%r1),%r23\n" \ -" stw %r19,4(%r23)\n" \ -" ldw 4(%r3),%r19\n" /* load the object's gp */ \ -" bv %r0(%r2)\n" \ -" depi 2,31,2,%r23\n" /* delay slot */ \ - ); - - -/* This code gets called via the .plt stub, and is used in - dl-runtime.c to call the `fixup' function and then redirect to the - address it returns. - - WARNING: This template is also used by gcc's __cffc, and expects - that the "bl" for fixup() exist at a particular offset. - Do not change this template without changing gcc, while the prefix - "bl" should fix everything so gcc finds the right spot, it will - slow down __cffc when it attempts to call fixup to resolve function - descriptor references. Please refer to gcc/gcc/config/pa/fptr.c - - Enter with r19 = reloc offset, r20 = got-8, r21 = fixup ltp. */ -#define TRAMPOLINE_TEMPLATE(tramp_name, fixup_name) \ - extern void tramp_name (void); \ - asm ( \ - " .text\n" \ - /* FAKE bl to provide gcc's __cffc with fixup's address */ \ - " bl " #fixup_name ",%r2\n" /* Runtime address of fixup */ \ - " .globl " #tramp_name "\n" \ - " .type " #tramp_name ",@function\n" \ - #tramp_name ":\n" \ - " .proc\n" \ - " .callinfo frame=64,calls,save_rp\n" \ - " .entry\n" \ - /* Save return pointer */ \ - " stw %r2,-20(%sp)\n" \ - /* Save argument registers in the call stack frame. */ \ - " stw %r26,-36(%sp)\n" \ - " stw %r25,-40(%sp)\n" \ - " stw %r24,-44(%sp)\n" \ - " stw %r23,-48(%sp)\n" \ - /* Build a call frame, and save structure pointer. */ \ - " stwm %r28,64(%sp)\n" \ - \ - /* Set up args to fixup func. */ \ - " ldw 8+4(%r20),%r26\n" /* (1) got[1] == struct link_map */ \ - " copy %r19,%r25\n" /* (2) reloc offset */ \ - " copy %r2,%r24\n" /* (3) profile_fixup needs rp */ \ - \ - /* Call the real address resolver. */ \ - " bl " #fixup_name ",%r2\n" \ - " copy %r21,%r19\n" /* set fixup func ltp (DELAY SLOT)*/ \ - \ - " ldw 0(%r28),%r22\n" /* load up the returned func ptr */ \ - " ldw 4(%r28),%r19\n" \ - " ldwm -64(%sp),%r28\n" \ - /* Arguments. */ \ - " ldw -36(%sp),%r26\n" \ - " ldw -40(%sp),%r25\n" \ - " ldw -44(%sp),%r24\n" \ - " ldw -48(%sp),%r23\n" \ - /* Call the real function. */ \ - " bv %r0(%r22)\n" \ - /* Return pointer. */ \ - " ldw -20(%sp),%r2\n" \ - " .exit\n" \ - " .procend\n"); - -#ifndef PROF -#define ELF_MACHINE_RUNTIME_TRAMPOLINE \ - TRAMPOLINE_TEMPLATE (_dl_runtime_resolve, fixup); \ - TRAMPOLINE_TEMPLATE (_dl_runtime_profile, profile_fixup); -#else -#define ELF_MACHINE_RUNTIME_TRAMPOLINE \ - TRAMPOLINE_TEMPLATE (_dl_runtime_resolve, fixup); \ - strong_alias (_dl_runtime_resolve, _dl_runtime_profile); -#endif - -/* ELF_RTYPE_CLASS_PLT iff TYPE describes relocation of a PLT entry, so - PLT entries should not be allowed to define the value. - ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one - of the main executable's symbols, as for a COPY reloc. */ -#define elf_machine_type_class(type) \ - ((((type) == R_PARISC_IPLT || (type) == R_PARISC_EPLT) \ - * ELF_RTYPE_CLASS_PLT) \ - | (((type) == R_PARISC_COPY) * ELF_RTYPE_CLASS_COPY)) - -/* Used by the runtime in fixup to figure out if reloc is *really* PLT */ -#define ELF_MACHINE_JMP_SLOT R_PARISC_IPLT -#define ELF_MACHINE_SIZEOF_JMP_SLOT PLT_ENTRY_SIZE - -/* We only use RELA. */ -#define ELF_MACHINE_NO_REL 1 - -/* Return the address of the entry point. */ -#define ELF_MACHINE_START_ADDRESS(map, start) \ - DL_STATIC_FUNCTION_ADDRESS (map, start) - -/* We define an initialization functions. This is called very early in - * _dl_sysdep_start. */ -#define DL_PLATFORM_INIT dl_platform_init () - -static inline void __attribute__ ((unused)) -dl_platform_init (void) -{ - if (GLRO(dl_platform) != NULL && *GLRO(dl_platform) == '\0') - /* Avoid an empty string which would disturb us. */ - GLRO(dl_platform) = NULL; -} - -#endif /* !dl_machine_h */ - -/* These are only actually used where RESOLVE_MAP is defined, anyway. */ -#ifdef RESOLVE_MAP - -auto void __attribute__((always_inline)) -elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc, - const Elf32_Sym *sym, const struct r_found_version *version, - void *const reloc_addr_arg) -{ - Elf32_Addr *const reloc_addr = reloc_addr_arg; - const Elf32_Sym *const refsym = sym; - unsigned long const r_type = ELF32_R_TYPE (reloc->r_info); - struct link_map *sym_map; - Elf32_Addr value; - -# if !defined RTLD_BOOTSTRAP && !defined SHARED - /* This is defined in rtld.c, but nowhere in the static libc.a; make the - reference weak so static programs can still link. This declaration - cannot be done when compiling rtld.c (i.e. #ifdef RTLD_BOOTSTRAP) - because rtld.c contains the common defn for _dl_rtld_map, which is - incompatible with a weak decl in the same file. */ - weak_extern (GL(dl_rtld_map)); -# endif - - /* RESOLVE_MAP will return a null value for undefined syms, and - non-null for all other syms. In particular, relocs with no - symbol (symbol index of zero), also called *ABS* relocs, will be - resolved to MAP. (The first entry in a symbol table is all - zeros, and an all zero Elf32_Sym has a binding of STB_LOCAL.) - See RESOLVE_MAP definition in elf/dl-reloc.c */ -# ifdef RTLD_BOOTSTRAP - /* RESOLVE_MAP in rtld.c doesn't have the local sym test. */ - sym_map = (ELF32_ST_BIND (sym->st_info) != STB_LOCAL - ? RESOLVE_MAP (&sym, version, r_type) : map); -# else - sym_map = RESOLVE_MAP (&sym, version, r_type); -# endif - if (sym_map) - { - value = sym ? sym_map->l_addr + sym->st_value : 0; - value += reloc->r_addend; - } - else - value = 0; - - switch (r_type) - { - case R_PARISC_DIR32: - /* .eh_frame can have unaligned relocs. */ - if ((unsigned long) reloc_addr_arg & 3) - { - char *rel_addr = (char *) reloc_addr_arg; - rel_addr[0] = value >> 24; - rel_addr[1] = value >> 16; - rel_addr[2] = value >> 8; - rel_addr[3] = value; - return; - } - break; - - case R_PARISC_PLABEL32: - /* Easy rule: If there is a symbol and it is global, then we - need to make a dynamic function descriptor. Otherwise we - have the address of a PLT slot for a local symbol which we - know to be unique. */ - if (sym == NULL - || sym_map == NULL - || ELF32_ST_BIND (sym->st_info) == STB_LOCAL) - { - break; - } - /* Set bit 30 to indicate to $$dyncall that this is a PLABEL. - We have to do this outside of the generic function descriptor - code, since it doesn't know about our requirement for setting - protection bits */ - value = (Elf32_Addr)((unsigned int)_dl_make_fptr (sym_map, sym, value) | 2); - break; - - case R_PARISC_IPLT: - if (__builtin_expect (sym_map != NULL, 1)) - { - elf_machine_fixup_plt (NULL, sym_map, reloc, reloc_addr, value); - } - else - { - /* If we get here, it's a (weak) undefined sym. */ - elf_machine_fixup_plt (NULL, map, reloc, reloc_addr, value); - } - return; - - case R_PARISC_COPY: - if (__builtin_expect (sym == NULL, 0)) - /* This can happen in trace mode if an object could not be - found. */ - break; - if (__builtin_expect (sym->st_size > refsym->st_size, 0) - || (__builtin_expect (sym->st_size < refsym->st_size, 0) - && __builtin_expect (GLRO(dl_verbose), 0))) - { - const char *strtab; - - strtab = (const char *) D_PTR (map, l_info[DT_STRTAB]); - _dl_error_printf ("%s: Symbol `%s' has different size in shared object, " - "consider re-linking\n", - rtld_progname ?: "", - strtab + refsym->st_name); - } - memcpy (reloc_addr_arg, (void *) value, - MIN (sym->st_size, refsym->st_size)); - return; - - case R_PARISC_NONE: /* Alright, Wilbur. */ - return; - - default: - _dl_reloc_bad_type (map, r_type, 0); - } - - *reloc_addr = value; -} - -/* hppa doesn't have an R_PARISC_RELATIVE reloc, but uses relocs with - ELF32_R_SYM (info) == 0 for a similar purpose. */ -auto void __attribute__((always_inline)) -elf_machine_rela_relative (Elf32_Addr l_addr, - const Elf32_Rela *reloc, - void *const reloc_addr_arg) -{ - unsigned long const r_type = ELF32_R_TYPE (reloc->r_info); - Elf32_Addr *const reloc_addr = reloc_addr_arg; - static char msgbuf[] = { "Unknown" }; - struct link_map map; - Elf32_Addr value; - - value = l_addr + reloc->r_addend; - - if (ELF32_R_SYM (reloc->r_info) != 0){ - _dl_error_printf ("%s: In elf_machine_rela_relative " - "ELF32_R_SYM (reloc->r_info) != 0. Aborting.", - rtld_progname ?: ""); - ABORT_INSTRUCTION; /* Crash. */ - } - - switch (r_type) - { - case R_PARISC_DIR32: - /* .eh_frame can have unaligned relocs. */ - if ((unsigned long) reloc_addr_arg & 3) - { - char *rel_addr = (char *) reloc_addr_arg; - rel_addr[0] = value >> 24; - rel_addr[1] = value >> 16; - rel_addr[2] = value >> 8; - rel_addr[3] = value; - return; - } - break; - - case R_PARISC_PLABEL32: - break; - - case R_PARISC_IPLT: /* elf_machine_runtime_setup already set gp */ - break; - - case R_PARISC_NONE: - return; - - default: /* Bad reloc, map unknown (really it's the current map) */ - map.l_name = msgbuf; - _dl_reloc_bad_type (&map, r_type, 0); - return; - } - - *reloc_addr = value; -} - -auto void __attribute__((always_inline)) -elf_machine_lazy_rel (struct link_map *map, - Elf32_Addr l_addr, const Elf32_Rela *reloc) -{ - /* We don't have anything to do here. elf_machine_runtime_setup has - done all the relocs already. */ -} - -#endif /* RESOLVE_MAP */ diff --git a/sysdeps/hppa/dl-symaddr.c b/sysdeps/hppa/dl-symaddr.c deleted file mode 100644 index e5ce6a9c03..0000000000 --- a/sysdeps/hppa/dl-symaddr.c +++ /dev/null @@ -1,36 +0,0 @@ -/* Get the symbol address. HPPA version. - Copyright (C) 1999, 2000 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, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#include -#include - -void * -_dl_symbol_address (struct link_map *map, const ElfW(Sym) *ref) -{ - /* Find the "ip" from the "map" and symbol "ref" */ - Elf32_Addr value = (map ? map->l_addr : 0) + ref->st_value; - - /* On hppa, we have to return the pointer to function descriptor. - This involves an "| 2" to inform $$dyncall that this is a plabel32 */ - if (ELFW(ST_TYPE) (ref->st_info) == STT_FUNC){ - return (void *)((unsigned long)_dl_make_fptr (map, ref, value) | 2); - } - else - return (void *) value; -} diff --git a/sysdeps/hppa/elf/entry.h b/sysdeps/hppa/elf/entry.h deleted file mode 100644 index b024db2be7..0000000000 --- a/sysdeps/hppa/elf/entry.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef __ASSEMBLY__ -extern void _start (void); -#endif - -/* The function's entry point is stored in the first word of the - function descriptor (plabel) of _start(). */ -#define ENTRY_POINT __canonicalize_funcptr_for_compare(_start) - -/* We have to provide a special declaration. */ -#define ENTRY_POINT_DECL(class) class void _start (void); diff --git a/sysdeps/hppa/elf/initfini.c b/sysdeps/hppa/elf/initfini.c deleted file mode 100644 index 35f5dd52fe..0000000000 --- a/sysdeps/hppa/elf/initfini.c +++ /dev/null @@ -1,139 +0,0 @@ -/* Special .init and .fini section support for HPPA - Copyright (C) 2000, 2002 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. - - In addition to the permissions in the GNU Lesser General Public - License, the Free Software Foundation gives you unlimited - permission to link the compiled version of this file with other - programs, and to distribute those programs without any restriction - coming from the use of this file. (The GNU Lesser General Public - License restrictions do apply in other respects; for example, they - cover modification of the file, and distribution when not linked - into another program.) - - Note that people who make modified versions of this file are not - obligated to grant this special exception for their modified - versions; it is their choice whether to do so. The GNU Lesser - General Public License gives permission to release a modified - version without this exception; this exception also makes it - possible to release a modified version which carries forward this - exception. - - 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, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -/* This file is compiled into assembly code which is then munged by a sed - script into two files: crti.s and crtn.s. - - * crti.s puts a function prologue at the beginning of the - .init and .fini sections and defines global symbols for - those addresses, so they can be called as functions. - - * crtn.s puts the corresponding function epilogues - in the .init and .fini sections. */ - -/* If we use the standard C version, the linkage table pointer won't - be properly preserved due to the splitting up of function prologues - and epilogues. Therefore we write these in assembly to make sure - they do the right thing. - - Note that we cannot have a weak undefined __gmon_start__, because - that would require this to be PIC, and the linker is currently not - able to generate a proper procedure descriptor for _init. Sad but - true. Anyway, HPPA is one of those horrible architectures where - making the comparison and indirect call is quite expensive (see the - comment in sysdeps/generic/initfini.c). */ - -__asm__ ("\ -\n\ -#include \"defs.h\"\n\ -\n\ -/*@HEADER_ENDS*/\n\ -\n\ -/*@_init_PROLOG_BEGINS*/\n\ - .section .init\n\ - .align 4\n\ - .globl _init\n\ - .type _init,@function\n\ -_init:\n\ - stw %rp,-20(%sp)\n\ - stwm %r4,64(%sp)\n\ - stw %r19,-32(%sp)\n\ - bl __gmon_start__,%rp\n\ - copy %r19,%r4 /* delay slot */\n\ - copy %r4,%r19\n\ -/*@_init_PROLOG_ENDS*/\n\ -\n\ -/*@_init_EPILOG_BEGINS*/\n\ - .text\n\ - .align 4\n\ - .weak __gmon_start__\n\ - .type __gmon_start__,@function\n\ -__gmon_start__:\n\ - .proc\n\ - .callinfo\n\ - .entry\n\ - bv,n %r0(%r2)\n\ - .exit\n\ - .procend\n\ -\n\ -/* Here is the tail end of _init. We put __gmon_start before this so\n\ - that the assembler creates the .PARISC.unwind section for us, ie.\n\ - with the right attributes. */\n\ - .section .init\n\ - ldw -84(%sp),%rp\n\ - copy %r4,%r19\n\ - bv %r0(%rp)\n\ -_end_init:\n\ - ldwm -64(%sp),%r4\n\ -\n\ -/* Our very own unwind info, because the assembler can't handle\n\ - functions split into two or more pieces. */\n\ - .section .PARISC.unwind\n\ - .extern _init\n\ - .word _init, _end_init\n\ - .byte 0x08, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08\n\ -\n\ -/*@_init_EPILOG_ENDS*/\n\ -\n\ -/*@_fini_PROLOG_BEGINS*/\n\ - .section .fini\n\ - .align 4\n\ - .globl _fini\n\ - .type _fini,@function\n\ -_fini:\n\ - stw %rp,-20(%sp)\n\ - stwm %r4,64(%sp)\n\ - stw %r19,-32(%sp)\n\ - copy %r19,%r4\n\ -/*@_fini_PROLOG_ENDS*/\n\ -\n\ -/*@_fini_EPILOG_BEGINS*/\n\ - .section .fini\n\ - ldw -84(%sp),%rp\n\ - copy %r4,%r19\n\ - bv %r0(%rp)\n\ -_end_fini:\n\ - ldwm -64(%sp),%r4\n\ -\n\ - .section .PARISC.unwind\n\ - .extern _fini\n\ - .word _fini, _end_fini\n\ - .byte 0x08, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08\n\ -\n\ -/*@_fini_EPILOG_ENDS*/\n\ -\n\ -/*@TRAILER_BEGINS*/\ -"); diff --git a/sysdeps/hppa/elf/start.S b/sysdeps/hppa/elf/start.S deleted file mode 100644 index 4cf832a2f6..0000000000 --- a/sysdeps/hppa/elf/start.S +++ /dev/null @@ -1,97 +0,0 @@ -/* ELF startup code for HPPA. - Copyright (C) 2002 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. - - In addition to the permissions in the GNU Lesser General Public - License, the Free Software Foundation gives you unlimited - permission to link the compiled version of this file with other - programs, and to distribute those programs without any restriction - coming from the use of this file. (The GNU Lesser General Public - License restrictions do apply in other respects; for example, they - cover modification of the file, and distribution when not linked - into another program.) - - Note that people who make modified versions of this file are not - obligated to grant this special exception for their modified - versions; it is their choice whether to do so. The GNU Lesser - General Public License gives permission to release a modified - version without this exception; this exception also makes it - possible to release a modified version which carries forward this - exception. - - 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, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - - .text - - .align 4 - - .import main, code - .import $global$, data - .import __libc_start_main, code - .import __libc_csu_fini, code - .import __libc_csu_init, code - - .globl _start - .export _start, ENTRY - .type _start,@function -_start: - - .proc - .callinfo - - /* load main */ - ldil LP%main, %r26 - ldo RP%main(%r26), %r26 - - /* argc and argv should be in 25 and 24 */ - - /* Expand the stack to store the 5th through 7th args */ - ldo 64(%sp), %sp - - /* void (*rtld_fini) (void) (actually the 6th arg) */ - stw %r23, -56(%sp) - - /* void (*init) (void) */ - ldil LP%__libc_csu_init, %r23 - ldo RP%__libc_csu_init(%r23), %r23 - - /* void (*fini) (void) */ - ldil LP%__libc_csu_fini, %r22 - ldo RP%__libc_csu_fini(%r22), %r22 - stw %r22, -52(%sp) - - /* void *stack_end */ - stw %sp, -60(%sp) - - /* load global */ - ldil L%$global$, %dp - ldo R%$global$(%dp), %dp - - bl __libc_start_main,%r2 - nop - /* die horribly if it returned (it shouldn't) */ - iitlbp %r0,(%r0) - nop - - .procend - -/* Define a symbol for the first piece of initialized data. */ - .data - .globl __data_start -__data_start: - .long 0 - .weak data_start - data_start = __data_start diff --git a/sysdeps/hppa/fpu/bits/fenv.h b/sysdeps/hppa/fpu/bits/fenv.h deleted file mode 100644 index c5f8c43459..0000000000 --- a/sysdeps/hppa/fpu/bits/fenv.h +++ /dev/null @@ -1,78 +0,0 @@ -/* Copyright (C) 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David Huggins-Daines - - 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, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifndef _FENV_H -# error "Never use directly; include instead." -#endif - -/* Define bits representing the exception. We use the values of the - appropriate enable bits in the FPU status word (which, - coincidentally, are the same as the flag bits, but shifted right by - 27 bits). */ -enum -{ - FE_INVALID = 1<<4, /* V */ -#define FE_INVALID FE_INVALID - FE_DIVBYZERO = 1<<3, /* Z */ -#define FE_DIVBYZERO FE_DIVBYZERO - FE_OVERFLOW = 1<<2, /* O */ -#define FE_OVERFLOW FE_OVERFLOW - FE_UNDERFLOW = 1<<1, /* U */ -#define FE_UNDERFLOW FE_UNDERFLOW - FE_INEXACT = 1<<0, /* I */ -#define FE_INEXACT FE_INEXACT -}; - -#define FE_ALL_EXCEPT \ - (FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID) - -/* The PA-RISC FPU supports all of the four defined rounding modes. - We use the values of the RM field in the floating point status - register for the appropriate macros. */ -enum - { - FE_TONEAREST = 0 << 9, -#define FE_TONEAREST FE_TONEAREST - FE_TOWARDZERO = 1 << 9, -#define FE_TOWARDZERO FE_TOWARDZERO - FE_UPWARD = 2 << 9, -#define FE_UPWARD FE_UPWARD - FE_DOWNWARD = 3 << 9, -#define FE_DOWNWARD FE_DOWNWARD - }; - -/* Type representing exception flags. */ -typedef unsigned int fexcept_t; - -/* Type representing floating-point environment. This structure - corresponds to the layout of the status and exception words in the - register file. */ -typedef struct -{ - unsigned int __status_word; - unsigned int __exception[7]; -} fenv_t; - -/* If the default argument is used we use this value. */ -#define FE_DFL_ENV ((fenv_t *) -1) - -#ifdef __USE_GNU -/* Floating-point environment where none of the exceptions are masked. */ -# define FE_NOMASK_ENV ((fenv_t *) -2) -#endif diff --git a/sysdeps/hppa/fpu/fclrexcpt.c b/sysdeps/hppa/fpu/fclrexcpt.c deleted file mode 100644 index a7c698206e..0000000000 --- a/sysdeps/hppa/fpu/fclrexcpt.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Clear given exceptions in current floating-point environment. - Copyright (C) 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by David Huggins-Daines , 2000 - - 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 -