alloca86-bt.S 807 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* ---------------------------------------------- */
  2. /* alloca86-bt.S */
  3. .globl __bound_alloca
  4. __bound_alloca:
  5. pop %edx
  6. pop %eax
  7. mov %eax, %ecx
  8. add $3,%eax
  9. and $-4,%eax
  10. jz p6
  11. #ifdef _WIN32
  12. p4:
  13. cmp $4096,%eax
  14. jbe p5
  15. test %eax,-4096(%esp)
  16. sub $4096,%esp
  17. sub $4096,%eax
  18. jmp p4
  19. p5:
  20. #endif
  21. sub %eax,%esp
  22. mov %esp,%eax
  23. push %edx
  24. push %eax
  25. push %ecx
  26. push %eax
  27. call __bound_new_region
  28. add $8, %esp
  29. pop %eax
  30. pop %edx
  31. p6:
  32. push %edx
  33. push %edx
  34. ret
  35. /* mark stack as nonexecutable */
  36. #if defined __ELF__ && defined __linux__
  37. .section .note.GNU-stack,"",@progbits
  38. #endif
  39. /* ---------------------------------------------- */