asminit.def 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. ; asminit.def --
  2. ;
  3. ; This file is part of the LZO real-time data compression library.
  4. ;
  5. ; Copyright (C) 1996-2015 Markus Franz Xaver Johannes Oberhumer
  6. ; All Rights Reserved.
  7. ;
  8. ; The LZO library is free software; you can redistribute it and/or
  9. ; modify it under the terms of the GNU General Public License as
  10. ; published by the Free Software Foundation; either version 2 of
  11. ; the License, or (at your option) any later version.
  12. ;
  13. ; The LZO library is distributed in the hope that it will be useful,
  14. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. ; GNU General Public License for more details.
  17. ;
  18. ; You should have received a copy of the GNU General Public License
  19. ; along with the LZO library; see the file COPYING.
  20. ; If not, write to the Free Software Foundation, Inc.,
  21. ; 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  22. ;
  23. ; Markus F.X.J. Oberhumer
  24. ; <markus@oberhumer.com>
  25. ; http://www.oberhumer.com/opensource/lzo/
  26. ;
  27. bits 32
  28. %ifndef __OUTPUT_FORMAT__
  29. %error "__OUTPUT_FORMAT__ is not defined"
  30. %endif
  31. %ifidni __OUTPUT_FORMAT__,elf
  32. %undef __OUTPUT_FORMAT__
  33. %define __OUTPUT_FORMAT__ elf32
  34. %endif
  35. %ifidni __OUTPUT_FORMAT__,macho
  36. %undef __OUTPUT_FORMAT__
  37. %define __OUTPUT_FORMAT__ macho32
  38. %endif
  39. %ifidni __OUTPUT_FORMAT__,win
  40. %undef __OUTPUT_FORMAT__
  41. %define __OUTPUT_FORMAT__ win32
  42. %endif
  43. %ifdef __YASM_MAJOR__
  44. %ifidni __OUTPUT_FORMAT__,x64
  45. %undef __OUTPUT_FORMAT__
  46. %define __OUTPUT_FORMAT__ win64
  47. %endif
  48. %endif
  49. %ifndef NAME1
  50. %ifidni __OUTPUT_FORMAT__,macho32
  51. %define NAME1(a) _ %+ a
  52. %elifidni __OUTPUT_FORMAT__,macho64
  53. %define NAME1(a) _ %+ a
  54. %else
  55. %define NAME1(a) _ %+ a
  56. %define NAME2(a) a
  57. %endif
  58. %endif
  59. %ifidni __OUTPUT_FORMAT__,elf32
  60. %define globalf(a) global a:function (a %+ _end - a)
  61. ;define globalfh(a) global a:function hidden
  62. %define globalfh(a) global a:function hidden (a %+ _end - a)
  63. %define globalf_end(a) a %+ _end:
  64. %elifidni __OUTPUT_FORMAT__,elf64
  65. %define globalf(a) global a:function (a %+ _end - a)
  66. ;define globalfh(a) global a:function hidden
  67. %define globalfh(a) global a:function hidden (a %+ _end - a)
  68. %define globalf_end(a) a %+ _end:
  69. %else
  70. %define globalf(a) global a
  71. %define globalfh(a) global a
  72. %define globalf_end(a)
  73. %endif
  74. %ifndef LZO_SEH_EXCEPTIONS
  75. %ifidni __OUTPUT_FORMAT__,win64
  76. %define LZO_SEH_EXCEPTIONS 1
  77. %endif
  78. %endif
  79. %ifndef LZO_SEH_EXCEPTIONS
  80. %define LZO_SEH_EXCEPTIONS 0
  81. %endif
  82. %ifidni __OUTPUT_FORMAT__,elf32
  83. section .note.GNU-stack noalloc noexec nowrite progbits
  84. %elifidni __OUTPUT_FORMAT__,elf64
  85. section .note.GNU-stack noalloc noexec nowrite progbits
  86. %endif
  87. %ifidni __OUTPUT_FORMAT__,obj
  88. %if __BITS__==16
  89. segment _TEXT class=CODE public use16
  90. %else
  91. segment _TEXT class=CODE public use32 flat
  92. %endif
  93. %else
  94. section .text
  95. %endif
  96. %ifidni __OUTPUT_FORMAT__,elf32
  97. align 64
  98. %elifidni __OUTPUT_FORMAT__,elf64
  99. align 64
  100. %elifidni __OUTPUT_FORMAT__,macho32
  101. align 64
  102. %elifidni __OUTPUT_FORMAT__,macho64
  103. align 64
  104. %elifidni __OUTPUT_FORMAT__,win32
  105. align 64
  106. %elifidni __OUTPUT_FORMAT__,win64
  107. align 64
  108. %else
  109. align 16
  110. %endif