dl-lookupcfg.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* Configuration of lookup functions. SPARC64 version.
  2. Copyright (C) 2023-2026 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. /* The type of the return value of fixup/profile_fixup. */
  16. #define DL_FIXUP_VALUE_TYPE ElfW(Addr)
  17. /* Construct a value of type DL_FIXUP_VALUE_TYPE from a code address
  18. and a link map. */
  19. #define DL_FIXUP_MAKE_VALUE(map, addr) (addr)
  20. /* Extract the code address from a value of type DL_FIXUP_MAKE_VALUE.
  21. */
  22. #define DL_FIXUP_VALUE_CODE_ADDR(value) (value)
  23. #define DL_FIXUP_VALUE_ADDR(value) (value)
  24. #define DL_FIXUP_ADDR_VALUE(addr) (addr)
  25. #define DL_FIXUP_BINDNOW_ADDR_VALUE(addr) (addr)
  26. /* For bindnow, _dl_audit_symbind will be responsible to setup the final value
  27. while for lazy binding _dl_fixup/_dl_profile_fixup will call the audit
  28. callbacks and tail cail elf_machine_fixup_plt. */
  29. #ifdef __arch64__
  30. # define DL_SPARC_FIXUP(l, r, value, new_value) \
  31. sparc64_fixup_plt (l, r, value, new_value, (r)->r_addend, 0)
  32. #else
  33. # define DL_SPARC_FIXUP(l, r, value, new_value) \
  34. sparc_fixup_plt (r, value, new_value, 0, 1)
  35. #endif
  36. #define DL_FIXUP_BINDNOW_RELOC(l, reloc, value, new_value, st_value, lazy) \
  37. ({ \
  38. if (lazy) \
  39. (*value) = st_value; \
  40. else \
  41. { \
  42. const PLTREL *__r = (reloc); \
  43. DL_SPARC_FIXUP (l, __r, value, new_value); \
  44. } \
  45. })