ifunc.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* Definitions used by AArch64 indirect function resolvers.
  2. Copyright (C) 2019-2021 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. <https://www.gnu.org/licenses/>. */
  15. #ifndef _SYS_IFUNC_H
  16. #define _SYS_IFUNC_H
  17. /* A second argument is passed to the ifunc resolver. */
  18. #define _IFUNC_ARG_HWCAP (1ULL << 62)
  19. /* The prototype of a gnu indirect function resolver on AArch64 is
  20. ElfW(Addr) ifunc_resolver (uint64_t, const __ifunc_arg_t *);
  21. the first argument should have the _IFUNC_ARG_HWCAP bit set and
  22. the remaining bits should match the AT_HWCAP settings. */
  23. /* Second argument to an ifunc resolver. */
  24. struct __ifunc_arg_t
  25. {
  26. unsigned long _size; /* Size of the struct, so it can grow. */
  27. unsigned long _hwcap;
  28. unsigned long _hwcap2;
  29. };
  30. typedef struct __ifunc_arg_t __ifunc_arg_t;
  31. #endif