strcpy.S 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* Copyright (C) 1996-2026 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. <https://www.gnu.org/licenses/>. */
  14. /* Copy a null-terminated string from SRC to DST. Return a pointer
  15. to the null-terminator in the source. */
  16. #include <sysdep.h>
  17. .text
  18. ENTRY(strcpy)
  19. ldgp gp, 0(pv)
  20. #ifdef PROF
  21. .set noat
  22. lda AT, _mcount
  23. jsr AT, (AT), _mcount
  24. .set at
  25. #endif
  26. .prologue 1
  27. mov a0, v0 # set up return value
  28. mov ra, t9
  29. jmp $31, __stxcpy # do the copy
  30. END(strcpy)
  31. libc_hidden_builtin_def (strcpy)