tlsbin.s 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. .section ".tbss", "awT", @nobits
  2. .globl bg1, bg2, bg3, bg4, bg5, bg6, bg7, bg8
  3. bg1: .space 4
  4. bg2: .space 4
  5. bg3: .space 4
  6. bg4: .space 4
  7. bg5: .space 4
  8. bg6: .space 4
  9. bg7: .space 4
  10. bg8: .space 4
  11. bl1: .space 4
  12. bl2: .space 4
  13. bl3: .space 4
  14. bl4: .space 4
  15. bl5: .space 4
  16. bl6: .space 4
  17. bl7: .space 4
  18. bl8: .space 4
  19. .text
  20. .globl _start
  21. .type _start,@function
  22. _start:
  23. pushq %rbp
  24. movq %rsp, %rbp
  25. /* IE against global var */
  26. movq %fs:0, %r11
  27. nop;nop
  28. addq sG6@gottpoff(%rip), %r11
  29. nop;nop;nop;nop
  30. /* IE -> LE against global var defined in exec */
  31. movq %fs:0, %rdx
  32. nop;nop
  33. addq bg6@gottpoff(%rip), %rdx
  34. nop;nop;nop;nop
  35. /* IE -> LE against local var */
  36. movq %fs:0, %r12
  37. nop;nop
  38. addq bl6@gottpoff(%rip), %r12
  39. nop;nop;nop;nop
  40. /* direct %fs access IE -> LE against local var */
  41. movq bl8@gottpoff(%rip), %rdx
  42. nop;nop
  43. movq %fs:(%rdx), %rax
  44. nop;nop;nop;nop
  45. /* IE -> LE against hidden but not local var */
  46. movq %fs:0, %rdx
  47. nop;nop
  48. addq sh6@gottpoff(%rip), %rdx
  49. nop;nop;nop;nop
  50. /* direct %fs access IE -> LE against hidden but not local var */
  51. movq sh8@gottpoff(%rip), %rdx
  52. nop;nop
  53. movq %fs:(%rdx), %rax
  54. nop;nop;nop;nop
  55. /* LE, global var defined in exec */
  56. movq %fs:0, %rax
  57. nop;nop
  58. leaq sg2@tpoff(%rax), %rdx
  59. nop;nop;nop;nop
  60. /* LE, local var, non-canonical sequence */
  61. movq $2+bl2@tpoff, %r9
  62. nop;nop
  63. movq %fs:0, %rdx
  64. nop;nop
  65. addq %r9, %rdx
  66. nop;nop;nop;nop
  67. /* LE, hidden var defined in exec, non-canonical sequence */
  68. movq %fs:0, %rdx
  69. nop;nop
  70. addq $sh2@tpoff+1, %rdx
  71. nop;nop;nop;nop
  72. /* Direct %fs access */
  73. /* LE, global var defined in exec */
  74. movq %fs:sg3@tpoff, %rax
  75. nop;nop;nop;nop
  76. /* LE, local var */
  77. movq %fs:bl3@tpoff+3, %r10
  78. nop;nop;nop;nop
  79. /* LE, hidden var defined in exec */
  80. movq %fs:1+sh3@tpoff, %rdx
  81. nop;nop;nop;nop
  82. /* LE, large model */
  83. movabsq $sh2@tpoff+1, %rdx
  84. leave
  85. ret