crt_arch.h 678 B

123456789101112131415161718192021222324252627282930313233
  1. __asm__(
  2. ".set push\n"
  3. ".set noreorder\n"
  4. ".text \n"
  5. ".global _" START "\n"
  6. ".global " START "\n"
  7. ".global " START "_data\n"
  8. ".type _" START ", @function\n"
  9. ".type " START ", @function\n"
  10. ".type " START "_data, @function\n"
  11. "_" START ":\n"
  12. "" START ":\n"
  13. ".align 8 \n"
  14. " bal 1f \n"
  15. " move $fp, $0 \n"
  16. "" START "_data: \n"
  17. " .gpdword " START "_data \n"
  18. " .gpdword " START "_c \n"
  19. ".weak _DYNAMIC \n"
  20. ".hidden _DYNAMIC \n"
  21. " .gpdword _DYNAMIC \n"
  22. "1: ld $gp, 0($ra) \n"
  23. " dsubu $gp, $ra, $gp \n"
  24. " move $4, $sp \n"
  25. " ld $5, 16($ra) \n"
  26. " daddu $5, $5, $gp \n"
  27. " ld $25, 8($ra) \n"
  28. " daddu $25, $25, $gp \n"
  29. " and $sp, $sp, -16 \n"
  30. " jalr $25 \n"
  31. " nop \n"
  32. ".set pop \n"
  33. );