resolve.S 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 R11 contain relocation offset and R12 contains
  4. link_map (_DYNAMIC). This must be consistent with the JUMP_SLOT
  5. layout generated by binutils. */
  6. /* Based on microblaze implementation */
  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, write to the Free
  18. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  19. 02111-1307 USA. */
  20. .text
  21. .align 4
  22. .globl _dl_linux_resolver
  23. .globl _dl_linux_resolve
  24. .type _dl_linux_resolve,@function
  25. _dl_linux_resolve:
  26. l.addi r1, r1, -32
  27. l.sw 0(r1), r9
  28. /* save function arguments */
  29. l.sw 8(r1), r3
  30. l.sw 12(r1), r4
  31. l.sw 16(r1), r5
  32. l.sw 20(r1), r6
  33. l.sw 24(r1), r7
  34. l.sw 28(r1), r8
  35. l.ori r3, r12, 0
  36. l.ori r4, r11, 0
  37. l.jal _dl_linux_resolver
  38. l.nop
  39. l.lwz r8, 28(r1)
  40. l.lwz r7, 24(r1)
  41. l.lwz r6, 20(r1)
  42. l.lwz r5, 16(r1)
  43. l.lwz r4, 12(r1)
  44. l.lwz r3, 8(r1)
  45. l.lwz r9, 0(r1)
  46. l.addi r1, r1, 32
  47. l.jr r11
  48. l.nop
  49. .size _dl_linux_resolve, . - _dl_linux_resolve