resolve.S 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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; see the file COPYING.LIB. If
  18. not, see <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. l.addi r1, r1, -32
  26. l.sw 0(r1), r9
  27. /* save function arguments */
  28. l.sw 8(r1), r3
  29. l.sw 12(r1), r4
  30. l.sw 16(r1), r5
  31. l.sw 20(r1), r6
  32. l.sw 24(r1), r7
  33. l.sw 28(r1), r8
  34. l.ori r3, r12, 0
  35. l.ori r4, r11, 0
  36. l.jal _dl_linux_resolver
  37. l.nop
  38. l.lwz r8, 28(r1)
  39. l.lwz r7, 24(r1)
  40. l.lwz r6, 20(r1)
  41. l.lwz r5, 16(r1)
  42. l.lwz r4, 12(r1)
  43. l.lwz r3, 8(r1)
  44. l.lwz r9, 0(r1)
  45. l.addi r1, r1, 32
  46. l.jr r11
  47. l.nop
  48. .size _dl_linux_resolve, . - _dl_linux_resolve