dl-fptr.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /* Function descriptors. IA64 version.
  2. Copyright (C) 2003-2019 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, see
  14. <http://www.gnu.org/licenses/>. */
  15. #ifndef dl_ia64_fptr_h
  16. #define dl_ia64_fptr_h 1
  17. #include <ia64intrin.h>
  18. #include <sysdeps/generic/dl-fptr.h>
  19. #define COMPARE_AND_SWAP(ptr, old, new) \
  20. __sync_bool_compare_and_swap (ptr, old, new)
  21. /* There are currently 123 dynamic symbols in ld.so.
  22. ELF_MACHINE_BOOT_FPTR_TABLE_LEN needs to be at least that big. */
  23. #define ELF_MACHINE_BOOT_FPTR_TABLE_LEN 200
  24. #define ELF_MACHINE_LOAD_ADDRESS(var, symbol) \
  25. asm ("movl %0 = @gprel (" #symbol ");; add %0 = %0, gp" : "=&r" (var));
  26. /* We don't have a gcc helper to extract the plabel info. */
  27. #define ELF_PTR_TO_FDESC(ptr) \
  28. ({ union { \
  29. void *_ptr; \
  30. struct fdesc *_fdesc; \
  31. } _u; \
  32. _u._ptr = ptr; \
  33. _u._fdesc; \
  34. })
  35. #endif /* !dl_ia64_fptr_h */