link.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. /* Copyright (C) 2004-2016 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, see
  13. <http://www.gnu.org/licenses/>. */
  14. #ifndef _LINK_H
  15. # error "Never include <bits/link.h> directly; use <link.h> instead."
  16. #endif
  17. #ifndef __x86_64__
  18. /* Registers for entry into PLT on IA-32. */
  19. typedef struct La_i86_regs
  20. {
  21. uint32_t lr_edx;
  22. uint32_t lr_ecx;
  23. uint32_t lr_eax;
  24. uint32_t lr_ebp;
  25. uint32_t lr_esp;
  26. } La_i86_regs;
  27. /* Return values for calls from PLT on IA-32. */
  28. typedef struct La_i86_retval
  29. {
  30. uint32_t lrv_eax;
  31. uint32_t lrv_edx;
  32. long double lrv_st0;
  33. long double lrv_st1;
  34. uint64_t lrv_bnd0;
  35. uint64_t lrv_bnd1;
  36. } La_i86_retval;
  37. __BEGIN_DECLS
  38. extern Elf32_Addr la_i86_gnu_pltenter (Elf32_Sym *__sym, unsigned int __ndx,
  39. uintptr_t *__refcook,
  40. uintptr_t *__defcook,
  41. La_i86_regs *__regs,
  42. unsigned int *__flags,
  43. const char *__symname,
  44. long int *__framesizep);
  45. extern unsigned int la_i86_gnu_pltexit (Elf32_Sym *__sym, unsigned int __ndx,
  46. uintptr_t *__refcook,
  47. uintptr_t *__defcook,
  48. const La_i86_regs *__inregs,
  49. La_i86_retval *__outregs,
  50. const char *symname);
  51. __END_DECLS
  52. #else
  53. /* Registers for entry into PLT on x86-64. */
  54. # if __GNUC_PREREQ (4,0)
  55. typedef float La_x86_64_xmm __attribute__ ((__vector_size__ (16)));
  56. typedef float La_x86_64_ymm
  57. __attribute__ ((__vector_size__ (32), __aligned__ (16)));
  58. typedef double La_x86_64_zmm
  59. __attribute__ ((__vector_size__ (64), __aligned__ (16)));
  60. # else
  61. typedef float La_x86_64_xmm __attribute__ ((__mode__ (__V4SF__)));
  62. # endif
  63. typedef union
  64. {
  65. # if __GNUC_PREREQ (4,0)
  66. La_x86_64_ymm ymm[2];
  67. La_x86_64_zmm zmm[1];
  68. # endif
  69. La_x86_64_xmm xmm[4];
  70. } La_x86_64_vector __attribute__ ((__aligned__ (16)));
  71. typedef struct La_x86_64_regs
  72. {
  73. uint64_t lr_rdx;
  74. uint64_t lr_r8;
  75. uint64_t lr_r9;
  76. uint64_t lr_rcx;
  77. uint64_t lr_rsi;
  78. uint64_t lr_rdi;
  79. uint64_t lr_rbp;
  80. uint64_t lr_rsp;
  81. La_x86_64_xmm lr_xmm[8];
  82. La_x86_64_vector lr_vector[8];
  83. #ifndef __ILP32__
  84. __int128_t lr_bnd[4];
  85. #endif
  86. } La_x86_64_regs;
  87. /* Return values for calls from PLT on x86-64. */
  88. typedef struct La_x86_64_retval
  89. {
  90. uint64_t lrv_rax;
  91. uint64_t lrv_rdx;
  92. La_x86_64_xmm lrv_xmm0;
  93. La_x86_64_xmm lrv_xmm1;
  94. long double lrv_st0;
  95. long double lrv_st1;
  96. La_x86_64_vector lrv_vector0;
  97. La_x86_64_vector lrv_vector1;
  98. #ifndef __ILP32__
  99. __int128_t lrv_bnd0;
  100. __int128_t lrv_bnd1;
  101. #endif
  102. } La_x86_64_retval;
  103. #define La_x32_regs La_x86_64_regs
  104. #define La_x32_retval La_x86_64_retval
  105. __BEGIN_DECLS
  106. extern Elf64_Addr la_x86_64_gnu_pltenter (Elf64_Sym *__sym,
  107. unsigned int __ndx,
  108. uintptr_t *__refcook,
  109. uintptr_t *__defcook,
  110. La_x86_64_regs *__regs,
  111. unsigned int *__flags,
  112. const char *__symname,
  113. long int *__framesizep);
  114. extern unsigned int la_x86_64_gnu_pltexit (Elf64_Sym *__sym,
  115. unsigned int __ndx,
  116. uintptr_t *__refcook,
  117. uintptr_t *__defcook,
  118. const La_x86_64_regs *__inregs,
  119. La_x86_64_retval *__outregs,
  120. const char *__symname);
  121. extern Elf32_Addr la_x32_gnu_pltenter (Elf32_Sym *__sym,
  122. unsigned int __ndx,
  123. uintptr_t *__refcook,
  124. uintptr_t *__defcook,
  125. La_x32_regs *__regs,
  126. unsigned int *__flags,
  127. const char *__symname,
  128. long int *__framesizep);
  129. extern unsigned int la_x32_gnu_pltexit (Elf32_Sym *__sym,
  130. unsigned int __ndx,
  131. uintptr_t *__refcook,
  132. uintptr_t *__defcook,
  133. const La_x32_regs *__inregs,
  134. La_x32_retval *__outregs,
  135. const char *__symname);
  136. __END_DECLS
  137. #endif