mach 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. #------------------------------------------------------------------------------
  2. # mach file description
  3. #
  4. # Since Java bytecode and Mach-O fat-files have the same magic number the test
  5. # must be preformed in the same "magic" sequence to get both right. The long
  6. # at offset 4 in a fat file tells the number of architectures. The short at
  7. # offset 4 in a Java bytecode file is the compiler minor version and the
  8. # short at offset 6 is the compiler major version. Since there are only
  9. # only 18 labeled Mach-O architectures at current, and the first released
  10. # Java class format was version 43.0, we can safely choose any number
  11. # between 18 and 39 to test the number of architectures against
  12. # (and use as a hack).
  13. #
  14. 0 belong 0xcafebabe
  15. >4 belong >19 compiled Java class data,
  16. >>6 beshort x version %d.
  17. >>4 beshort x \b%d
  18. >4 belong 1 Mach-O fat file with 1 architecture
  19. >4 belong >1
  20. # The following is necessary to support java class files.
  21. >>4 belong <20 Mach-O fat file with %ld architectures
  22. #>>4 belong <0xffff Mach-O fat file with %ld architectures
  23. #
  24. 0 lelong&0xfeffffff 0xfeedface Mach-O
  25. >0 byte 0xcf 64-bit
  26. >12 lelong 1 object
  27. >12 lelong 2 executable
  28. >12 lelong 3 fixed virtual memory shared library
  29. >12 lelong 4 core
  30. >12 lelong 5 preload executable
  31. >12 lelong 6 dynamically linked shared library
  32. >12 lelong 7 dynamic linker
  33. >12 lelong 8 bundle
  34. >12 lelong 9 dynamically linked shared library stub
  35. >12 lelong >9
  36. >>12 lelong x filetype=%ld
  37. >4 lelong <0
  38. >>4 lelong x architecture=%ld
  39. >4 lelong 1 vax
  40. >4 lelong 2 romp
  41. >4 lelong 3 architecture=3
  42. >4 lelong 4 ns32032
  43. >4 lelong 5 ns32332
  44. >4 lelong 6 m68k
  45. >4 lelong 7 i386
  46. >4 lelong 8 mips
  47. >4 lelong 9 ns32532
  48. >4 lelong 10 architecture=10
  49. >4 lelong 11 hppa
  50. >4 lelong 12 acorn
  51. >4 lelong 13 m88k
  52. >4 lelong 14 sparc
  53. >4 lelong 15 i860-big
  54. >4 lelong 16 i860
  55. >4 lelong 17 rs6000
  56. >4 lelong 18 ppc
  57. >4 lelong 16777234 ppc64
  58. >4 lelong >16777234
  59. >>4 lelong x architecture=%ld
  60. #
  61. 0 belong&0xfffffffe 0xfeedface Mach-O
  62. >3 byte 0xcf 64-bit
  63. >12 belong 1 object
  64. >12 belong 2 executable
  65. >12 belong 3 fixed virtual memory shared library
  66. >12 belong 4 core
  67. >12 belong 5 preload executable
  68. >12 belong 6 dynamically linked shared library
  69. >12 belong 7 dynamic linker
  70. >12 belong 8 bundle
  71. >12 belong 9 dynamically linked shared library stub
  72. >12 belong >9
  73. >>12 belong x filetype=%ld
  74. >4 belong <0
  75. >>4 belong x architecture=%ld
  76. >4 belong 1 vax
  77. >4 belong 2 romp
  78. >4 belong 3 architecture=3
  79. >4 belong 4 ns32032
  80. >4 belong 5 ns32332
  81. >4 belong 6 for m68k architecture
  82. # from NeXTstep 3.0 <mach/machine.h>
  83. # i.e. mc680x0_all, ignore
  84. # >>8 belong 1 (mc68030)
  85. >>8 belong 2 (mc68040)
  86. >>8 belong 3 (mc68030 only)
  87. >4 belong 7 i386
  88. >4 belong 8 mips
  89. >4 belong 9 ns32532
  90. >4 belong 10 architecture=10
  91. >4 belong 11 hppa
  92. >4 belong 12 acorn
  93. >4 belong 13 m88k
  94. >4 belong 14 sparc
  95. >4 belong 15 i860-big
  96. >4 belong 16 i860
  97. >4 belong 17 rs6000
  98. >4 belong 18 ppc
  99. >4 belong 16777234 ppc64
  100. >4 belong >16777234
  101. >>4 belong x architecture=%ld