lib2funcs.S 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. ; Subroutines for calling unbound dynamic functions from within GDB for HPPA.
  2. ; Subroutines for out of line prologues and epilogues on for the HPPA
  3. ; Copyright (C) 1994-2022 Free Software Foundation, Inc.
  4. ; This file is part of GCC.
  5. ; GCC is free software; you can redistribute it and/or modify
  6. ; it under the terms of the GNU General Public License as published by
  7. ; the Free Software Foundation; either version 3, or (at your option)
  8. ; any later version.
  9. ; GCC is distributed in the hope that it will be useful,
  10. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. ; GNU General Public License for more details.
  13. ; Under Section 7 of GPL version 3, you are granted additional
  14. ; permissions described in the GCC Runtime Library Exception, version
  15. ; 3.1, as published by the Free Software Foundation.
  16. ; You should have received a copy of the GNU General Public License and
  17. ; a copy of the GCC Runtime Library Exception along with this program;
  18. ; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  19. ; <http://www.gnu.org/licenses/>.
  20. #if !defined(__pro__) && !defined(__rtems__)
  21. .SPACE $PRIVATE$
  22. .SUBSPA $DATA$,QUAD=1,ALIGN=8,ACCESS=31
  23. .SUBSPA $BSS$,QUAD=1,ALIGN=8,ACCESS=31,ZERO,SORT=82
  24. .SPACE $TEXT$
  25. .SUBSPA $LIT$,QUAD=0,ALIGN=8,ACCESS=44
  26. .SUBSPA $CODE$,QUAD=0,ALIGN=8,ACCESS=44,CODE_ONLY
  27. .SUBSPA $MILLICODE$,QUAD=0,ALIGN=8,ACCESS=44,SORT=8
  28. #endif
  29. .IMPORT $$dyncall,MILLICODE
  30. #if !defined(__pro__) && !defined(__rtems__)
  31. .SPACE $TEXT$
  32. .SUBSPA $CODE$
  33. #else
  34. .text
  35. #endif
  36. ; Simply call with the address of the desired import stub in %r22 and
  37. ; arguments in the normal place (%r26-%r23 and stack slots).
  38. ;
  39. .align 4
  40. .EXPORT __gcc_plt_call,ENTRY,PRIV_LEV=3,RTNVAL=GR
  41. __gcc_plt_call
  42. .PROC
  43. .CALLINFO
  44. .ENTRY
  45. ; Our return address comes in %r31, not %r2!
  46. stw %r31,-8(%r30)
  47. ; An inline version of dyncall so we don't have to worry
  48. ; about long calls to millicode, PIC and other complexities.
  49. bb,>=,n %r22,30,L$foo
  50. depi 0,31,2,%r22
  51. ldw 0(%r22),%r21
  52. ldw 4(%r22),%r19
  53. L$foo
  54. ldsid (%r21),%r1
  55. mtsp %r1,%sr0
  56. ble 0(%sr0,%r21)
  57. copy %r31,%r2
  58. ldw -8(%r30),%r2
  59. ; We're going to be returning to a stack address, so we
  60. ; need to do an intra-space return.
  61. ldsid (%rp),%r1
  62. mtsp %r1,%sr0
  63. be,n 0(%sr0,%rp)
  64. .EXIT
  65. .PROCEND