sotruss-lib.c 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* Override generic sotruss-lib.c to define actual functions for Nios II.
  2. Copyright (C) 2015-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. #define HAVE_ARCH_PLTENTER
  16. #define HAVE_ARCH_PLTEXIT
  17. #include <elf/sotruss-lib.c>
  18. ElfW(Addr)
  19. la_nios2_gnu_pltenter (ElfW(Sym) *sym __attribute__ ((unused)),
  20. unsigned int ndx __attribute__ ((unused)),
  21. uintptr_t *refcook, uintptr_t *defcook,
  22. La_nios2_regs *regs, unsigned int *flags,
  23. const char *symname, long int *framesizep)
  24. {
  25. print_enter (refcook, defcook, symname,
  26. regs->lr_reg[0], regs->lr_reg[1], regs->lr_reg[2],
  27. *flags);
  28. /* No need to copy anything, we will not need the parameters in any case. */
  29. *framesizep = 0;
  30. return sym->st_value;
  31. }
  32. unsigned int
  33. la_nios2_gnu_pltexit (ElfW(Sym) *sym, unsigned int ndx, uintptr_t *refcook,
  34. uintptr_t *defcook,
  35. const struct La_nios2_regs *inregs,
  36. struct La_nios2_retval *outregs, const char *symname)
  37. {
  38. print_exit (refcook, defcook, symname, outregs->lrv_r2);
  39. return 0;
  40. }