resolve.S 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Linux dynamic resolving code for MIPS. Fixes up the GOT entry as
  3. * indicated in register t8 and jumps to the resolved address. Shamelessly
  4. * ripped from 'sysdeps/mips/dl-machine.h' in glibc-2.2.5.
  5. *
  6. * This file is subject to the terms and conditions of the GNU General Public
  7. * License. See the file "COPYING.LIB" in the main directory of this archive
  8. * for more details.
  9. *
  10. * Copyright (C) 1996-2001 Kazumoto Kojima <kkojima@info.kanagawa-u.ac.jp>
  11. * Copyright (C) 2002 Steven J. Hill <sjhill@realitydiluted.com>
  12. *
  13. */
  14. .text
  15. .align 2
  16. .globl _dl_linux_resolve
  17. .type _dl_linux_resolve,@function
  18. .ent _dl_linux_resolve
  19. _dl_linux_resolve:
  20. .frame $29, 40, $31
  21. .set noreorder
  22. move $3, $28 # Save GP
  23. addu $25, 8 # t9 ($25) now points at .cpload instruction
  24. .cpload $25 # Compute GP
  25. .set reorder
  26. subu $29, 32
  27. .cprestore 28
  28. sw $4, 16($29)
  29. sw $5, 20($29)
  30. sw $15, 24($29)
  31. move $4, $24
  32. move $5, $3
  33. jal _dl_linux_resolver
  34. lw $31, 24($29)
  35. lw $4, 16($29)
  36. lw $5, 20($29)
  37. addu $29, 32
  38. move $25, $2
  39. jr $25
  40. .size _dl_linux_resolve,.-_dl_linux_resolve
  41. .end _dl_linux_resolve