resolve.S 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* This code is used in dl-runtime.c to call the `fixup' function
  2. and then redirect to the address it returns. */
  3. /* We assume that R3 contain relocation offset and R4 contains
  4. link_map (_DYNAMIC). This must be consistent with the JUMP_SLOT
  5. layout generated by binutils. */
  6. /* Based on glibc 2.3.6, dl-machine.h */
  7. /*
  8. The GNU C Library is free software; you can redistribute it and/or
  9. modify it under the terms of the GNU Lesser General Public
  10. License as published by the Free Software Foundation; either
  11. version 2.1 of the License, or (at your option) any later version.
  12. The GNU C Library is distributed in the hope that it will be useful,
  13. but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. Lesser General Public License for more details.
  16. You should have received a copy of the GNU Lesser General Public
  17. License along with the GNU C Library; if not, see
  18. <http://www.gnu.org/licenses/>. */
  19. .text
  20. .align 4
  21. .globl _dl_linux_resolver
  22. .globl _dl_linux_resolve
  23. .type _dl_linux_resolve,@function
  24. _dl_linux_resolve:
  25. addik r1,r1,-40
  26. swi r5,r1,12
  27. swi r6,r1,16
  28. swi r7,r1,20
  29. swi r8,r1,24
  30. swi r9,r1,28
  31. swi r10,r1,32
  32. swi r15,r1,0
  33. addk r5,r0,r4
  34. brlid r15, _dl_linux_resolver
  35. addk r6,r0,r3; /* delay slot */
  36. lwi r10,r1,32
  37. lwi r9,r1,28
  38. lwi r8,r1,24
  39. lwi r7,r1,20
  40. lwi r6,r1,16
  41. lwi r5,r1,12
  42. lwi r15,r1,0
  43. brad r3
  44. addik r1,r1,40; /* delay slot */
  45. .size _dl_linux_resolve, . - _dl_linux_resolve