objc-sel-table.s 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #include <TargetConditionals.h>
  2. #include <mach/vm_param.h>
  3. #if __LP64__
  4. # define PTR(x) .quad x
  5. #else
  6. # define PTR(x) .long x
  7. #endif
  8. .section __TEXT,__objc_opt_ro
  9. .align 3
  10. .private_extern __objc_opt_data
  11. __objc_opt_data:
  12. .long 15 /* table.version */
  13. .long 0 /* table.flags */
  14. .long 0 /* table.selopt_offset */
  15. .long 0 /* table.headeropt_ro_offset */
  16. .long 0 /* table.clsopt_offset */
  17. .long 0 /* table.protocolopt_offset */
  18. .long 0 /* table.headeropt_rw_offset */
  19. .space PAGE_MAX_SIZE-28
  20. /* space for selopt, smax/capacity=1048576, blen/mask=524287+1 */
  21. .space 4*(8+256) /* header and scramble */
  22. .space 524288 /* mask tab */
  23. .space 1048576 /* checkbytes */
  24. .space 1048576*4 /* offsets */
  25. /* space for clsopt, smax/capacity=131072, blen/mask=32767+1 */
  26. .space 4*(8+256) /* header and scramble */
  27. .space 32768 /* mask tab */
  28. .space 131072 /* checkbytes */
  29. .space 131072*12 /* offsets to name and class and header_info */
  30. .space 512*8 /* some duplicate classes */
  31. /* space for some demangled protocol names */
  32. .space 1024
  33. /* space for protocolopt, smax/capacity=16384, blen/mask=8191+1 */
  34. .space 4*(8+256) /* header and scramble */
  35. .space 8192 /* mask tab */
  36. .space 16384 /* checkbytes */
  37. .space 16384*8 /* offsets */
  38. /* space for 2048 header_info (RO) structures */
  39. .space 8 + (2048*16)
  40. .section __DATA,__objc_opt_rw
  41. .align 3
  42. .private_extern __objc_opt_rw_data
  43. __objc_opt_rw_data:
  44. /* space for 2048 header_info (RW) structures */
  45. .space 8 + (2048*8)
  46. /* space for 16384 protocols */
  47. #if __LP64__
  48. .space 16384 * 12 * 8
  49. #else
  50. .space 16384 * 12 * 4
  51. #endif
  52. /* section of pointers that the shared cache optimizer wants to know about */
  53. .section __DATA,__objc_opt_ptrs
  54. .align 3
  55. #if TARGET_OS_OSX && __i386__
  56. // old ABI
  57. .globl .objc_class_name_Protocol
  58. PTR(.objc_class_name_Protocol)
  59. #else
  60. // new ABI
  61. .globl _OBJC_CLASS_$_Protocol
  62. PTR(_OBJC_CLASS_$_Protocol)
  63. #endif