link.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /* Copyright (C) 2004, 2005, 2009 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3. The GNU C Library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public
  5. License as published by the Free Software Foundation; either
  6. version 2.1 of the License, or (at your option) any later version.
  7. The GNU C Library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public
  12. License along with the GNU C Library; if not, write to the Free
  13. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  14. 02111-1307 USA. */
  15. #ifndef _LINK_H
  16. # error "Never include <bits/link.h> directly; use <link.h> instead."
  17. #endif
  18. #if __ELF_NATIVE_CLASS == 32
  19. /* Registers for entry into PLT on IA-32. */
  20. typedef struct La_i86_regs
  21. {
  22. uint32_t lr_edx;
  23. uint32_t lr_ecx;
  24. uint32_t lr_eax;
  25. uint32_t lr_ebp;
  26. uint32_t lr_esp;
  27. } La_i86_regs;
  28. /* Return values for calls from PLT on IA-32. */
  29. typedef struct La_i86_retval
  30. {
  31. uint32_t lrv_eax;
  32. uint32_t lrv_edx;
  33. long double lrv_st0;
  34. long double lrv_st1;
  35. } La_i86_retval;
  36. __BEGIN_DECLS
  37. extern Elf32_Addr la_i86_gnu_pltenter (Elf32_Sym *__sym, unsigned int __ndx,
  38. uintptr_t *__refcook,
  39. uintptr_t *__defcook,
  40. La_i86_regs *__regs,
  41. unsigned int *__flags,
  42. const char *__symname,
  43. long int *__framesizep);
  44. extern unsigned int la_i86_gnu_pltexit (Elf32_Sym *__sym, unsigned int __ndx,
  45. uintptr_t *__refcook,
  46. uintptr_t *__defcook,
  47. const La_i86_regs *__inregs,
  48. La_i86_retval *__outregs,
  49. const char *symname);
  50. __END_DECLS
  51. #else
  52. /* Registers for entry into PLT on x86-64. */
  53. # if __GNUC_PREREQ (4,0)
  54. typedef float La_x86_64_xmm __attribute__ ((__vector_size__ (16)));
  55. typedef float La_x86_64_ymm __attribute__ ((__vector_size__ (32)));
  56. # else
  57. typedef float La_x86_64_xmm __attribute__ ((__mode__ (__V4SF__)));
  58. # endif
  59. typedef union
  60. {
  61. # if __GNUC_PREREQ (4,0)
  62. La_x86_64_ymm ymm[2];
  63. # endif
  64. La_x86_64_xmm xmm[4];
  65. } La_x86_64_vector __attribute__ ((aligned(16)));
  66. typedef struct La_x86_64_regs
  67. {
  68. uint64_t lr_rdx;
  69. uint64_t lr_r8;
  70. uint64_t lr_r9;
  71. uint64_t lr_rcx;
  72. uint64_t lr_rsi;
  73. uint64_t lr_rdi;
  74. uint64_t lr_rbp;
  75. uint64_t lr_rsp;
  76. La_x86_64_xmm lr_xmm[8];
  77. La_x86_64_vector lr_vector[8];
  78. } La_x86_64_regs;
  79. /* Return values for calls from PLT on x86-64. */
  80. typedef struct La_x86_64_retval
  81. {
  82. uint64_t lrv_rax;
  83. uint64_t lrv_rdx;
  84. La_x86_64_xmm lrv_xmm0;
  85. La_x86_64_xmm lrv_xmm1;
  86. long double lrv_st0;
  87. long double lrv_st1;
  88. La_x86_64_vector lrv_vector0;
  89. La_x86_64_vector lrv_vector1;
  90. } La_x86_64_retval;
  91. __BEGIN_DECLS
  92. extern Elf64_Addr la_x86_64_gnu_pltenter (Elf64_Sym *__sym,
  93. unsigned int __ndx,
  94. uintptr_t *__refcook,
  95. uintptr_t *__defcook,
  96. La_x86_64_regs *__regs,
  97. unsigned int *__flags,
  98. const char *__symname,
  99. long int *__framesizep);
  100. extern unsigned int la_x86_64_gnu_pltexit (Elf64_Sym *__sym,
  101. unsigned int __ndx,
  102. uintptr_t *__refcook,
  103. uintptr_t *__defcook,
  104. const La_x86_64_regs *__inregs,
  105. La_x86_64_retval *__outregs,
  106. const char *__symname);
  107. __END_DECLS
  108. #endif