dllprt0.as 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. .section ".note.openbsd.ident", "a"
  2. .p2align 2
  3. .long 8
  4. .long 4
  5. .long 1
  6. .ascii "OpenBSD\0"
  7. .long 0
  8. .previous
  9. .file "crt0.c"
  10. gcc2_compiled.:
  11. .globl __progname
  12. .section .rodata
  13. .LC0:
  14. .string ""
  15. .section .data.rel.local,"aw",@progbits
  16. .align 4
  17. .type __progname, @object
  18. .size __progname, 4
  19. __progname:
  20. .long .LC0
  21. #APP
  22. .text
  23. .align 4
  24. .globl __start
  25. .globl _start
  26. _start:
  27. __start:
  28. pushl %ebx #ps_strings
  29. pushl %ecx # obj
  30. pushl %edx # cleanup
  31. movl 12(%esp),%eax
  32. leal 20(%esp,%eax,4),%ecx
  33. leal 16(%esp),%edx
  34. pushl %ecx
  35. pushl %edx
  36. pushl %eax
  37. call ___start
  38. #NO_APP
  39. .text
  40. .globl ___start
  41. .type ___start, @function
  42. ___start:
  43. pushl %ebp
  44. movl %esp, %ebp
  45. pushl %ebx
  46. subl $36, %esp
  47. call __i686.get_pc_thunk.bx
  48. addl $_GLOBAL_OFFSET_TABLE_, %ebx
  49. movl environ@GOT(%ebx), %edx
  50. movl 16(%ebp), %eax
  51. movl %eax, (%edx)
  52. movl operatingsystem_parameter_envp@GOT(%ebx), %edx
  53. movl 16(%ebp), %eax
  54. movl %eax, (%edx)
  55. movl operatingsystem_parameter_argc@GOT(%ebx), %edx
  56. movl 8(%ebp), %eax
  57. movl %eax, (%edx)
  58. movl operatingsystem_parameter_argv@GOT(%ebx), %edx
  59. movl 12(%ebp), %eax
  60. movl %eax, (%edx)
  61. movl 12(%ebp), %eax
  62. movl (%eax), %eax
  63. movl %eax, -8(%ebp)
  64. cmpl $0, -8(%ebp)
  65. je .L2
  66. movl $47, 4(%esp)
  67. movl -8(%ebp), %eax
  68. movl %eax, (%esp)
  69. call _strrchr
  70. movl %eax, %edx
  71. movl __progname@GOT(%ebx), %eax
  72. movl %edx, (%eax)
  73. movl __progname@GOT(%ebx), %eax
  74. movl (%eax), %eax
  75. testl %eax, %eax
  76. jne .L4
  77. movl __progname@GOT(%ebx), %edx
  78. movl -8(%ebp), %eax
  79. movl %eax, (%edx)
  80. jmp .L6
  81. .L4:
  82. movl __progname@GOT(%ebx), %eax
  83. movl (%eax), %eax
  84. leal 1(%eax), %edx
  85. movl __progname@GOT(%ebx), %eax
  86. movl %edx, (%eax)
  87. .L6:
  88. movl __progname_storage@GOT(%ebx), %eax
  89. movl %eax, -12(%ebp)
  90. jmp .L7
  91. .L8:
  92. movl __progname@GOT(%ebx), %eax
  93. movl (%eax), %ecx
  94. movzbl (%ecx), %edx
  95. movl -12(%ebp), %eax
  96. movb %dl, (%eax)
  97. addl $1, -12(%ebp)
  98. leal 1(%ecx), %edx
  99. movl __progname@GOT(%ebx), %eax
  100. movl %edx, (%eax)
  101. .L7:
  102. movl __progname@GOT(%ebx), %eax
  103. movl (%eax), %eax
  104. movzbl (%eax), %eax
  105. testb %al, %al
  106. je .L9
  107. movl __progname_storage@GOT(%ebx), %eax
  108. leal 255(%eax), %eax
  109. cmpl %eax, -12(%ebp)
  110. jb .L8
  111. .L9:
  112. movl -12(%ebp), %eax
  113. movb $0, (%eax)
  114. movl __progname@GOT(%ebx), %edx
  115. movl __progname_storage@GOT(%ebx), %eax
  116. movl %eax, (%edx)
  117. .L2:
  118. call __init@PLT
  119. movl environ@GOT(%ebx), %eax
  120. movl (%eax), %eax
  121. movl %eax, 8(%esp)
  122. movl 12(%ebp), %eax
  123. movl %eax, 4(%esp)
  124. movl 8(%ebp), %eax
  125. movl %eax, (%esp)
  126. call main@PLT
  127. # pushl environ
  128. # pushl %esi
  129. # pushl 8(%ebp)
  130. finit
  131. fwait
  132. fldcw ___fpucw
  133. xorl %ebp,%ebp
  134. call main
  135. pushl %eax
  136. call exit
  137. .p2align 2,0x90
  138. # movl %eax, (%esp)
  139. # call exit@PLT
  140. .size ___start, .-___start
  141. .globl _haltproc
  142. .type _haltproc,@function
  143. _haltproc:
  144. mov $1,%eax
  145. call __i686.get_pc_thunk.bx
  146. addl $_GLOBAL_OFFSET_TABLE_, %ebx
  147. movl operatingsystem_result@GOT(%ebx), %esi
  148. movzwl (%esi),%edx
  149. pushl %edx
  150. call .Lactualsyscall
  151. addl $4,%esp
  152. jmp _haltproc
  153. .Lactualsyscall:
  154. int $0x80
  155. jb .LErrorcode
  156. xor %ebx,%ebx
  157. ret
  158. .LErrorcode:
  159. mov %eax,%ebx
  160. mov $-1,%eax
  161. ret
  162. .type _strrchr, @function
  163. _strrchr:
  164. pushl %ebp
  165. movl %esp, %ebp
  166. subl $12, %esp
  167. movl 12(%ebp), %eax
  168. movb %al, -9(%ebp)
  169. movl $0, -4(%ebp)
  170. .L13:
  171. movl 8(%ebp), %edx
  172. movzbl (%edx), %eax
  173. cmpb -9(%ebp), %al
  174. jne .L14
  175. movl 8(%ebp), %eax
  176. movl %eax, -4(%ebp)
  177. .L14:
  178. movl 8(%ebp), %edx
  179. movzbl (%edx), %eax
  180. testb %al, %al
  181. jne .L16
  182. movl -4(%ebp), %eax
  183. movl %eax, -8(%ebp)
  184. jmp .L12
  185. .L16:
  186. addl $1, 8(%ebp)
  187. jmp .L13
  188. .L12:
  189. movl -8(%ebp), %eax
  190. leave
  191. ret
  192. .size _strrchr, .-_strrchr
  193. .comm environ,4,4
  194. .comm operatingsystem_parameter_envp,4,4
  195. .comm operatingsystem_parameter_argc,4,4
  196. .comm operatingsystem_parameter_argv,4,4
  197. .comm __progname_storage,256,32
  198. .ident "GCC: (GNU) 4.2.1 20070719 "
  199. .section .gnu.linkonce.t.__i686.get_pc_thunk.bx,"ax",@progbits
  200. .globl __i686.get_pc_thunk.bx
  201. .hidden __i686.get_pc_thunk.bx
  202. .type __i686.get_pc_thunk.bx, @function
  203. __i686.get_pc_thunk.bx:
  204. movl (%esp), %ebx
  205. ret