gprt0.as 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. .include "mips/cprt0.as"
  2. .option pic2
  3. .text
  4. .set nomips16
  5. .set noreorder
  6. .globl __gmon_start__
  7. .type __gmon_start__,@function
  8. __gmon_start__:
  9. .ent __gmon_start__
  10. .frame $sp,32,$ra
  11. .mask 0x80000000,-4
  12. .fmask 0x00000000,0
  13. .cpload $25
  14. addiu $sp,$sp,-32
  15. sw $ra,28($sp)
  16. .cprestore 16
  17. lui $v0,%hi(called)
  18. lw $v1,%lo(called)($v0)
  19. bne $v1,$zero,10f
  20. lw $a0,%got(__start)($gp)
  21. lw $a1,%got(etext)($gp)
  22. li $v1,1
  23. lw $t9,%call16(__monstartup)($gp)
  24. jalr $t9
  25. sw $v1,%lo(called)($v0) /* in delay slot */
  26. lw $gp,16($sp)
  27. lw $a0,%got(_mcleanup)($gp)
  28. lw $t9,%call16(atexit)($gp)
  29. jalr $t9
  30. nop
  31. 10:
  32. lw $ra,28($sp)
  33. jr $ra
  34. addiu $sp,$sp,32
  35. .end __gmon_start__
  36. .size __gmon_start__,.-__gmon_start__
  37. .bss
  38. called: .space 4