dw2-ranges.S 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. /* Copyright (C) 2015-2017 Free Software Foundation, Inc.
  2. This program is free software; you can redistribute it and/or modify
  3. it under the terms of the GNU General Public License as published by
  4. the Free Software Foundation; either version 3 of the License, or
  5. (at your option) any later version.
  6. This program is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9. GNU General Public License for more details.
  10. You should have received a copy of the GNU General Public License
  11. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  12. /* This tests makes use of the .debug_ranges section, especially,
  13. making sure that the base address encoding scheme is used. */
  14. /* Dummy function to provide debug information for. */
  15. .text
  16. .globl _start
  17. _start:
  18. .4byte 0
  19. .Lbegin_text1:
  20. .globl func_cu1
  21. .type func_cu1, %function
  22. func_cu1:
  23. .Lbegin_func_cu1:
  24. .4byte 0
  25. .Lend_func_cu1:
  26. .size func_cu1, .-func_cu1
  27. .Lend_text1:
  28. .Lbegin_text2:
  29. .globl func_cu2
  30. .type func_cu2, %function
  31. func_cu2:
  32. .Lbegin_func_cu2:
  33. .4byte 0
  34. .Lend_func_cu2:
  35. .size func_cu2, .-func_cu2
  36. .Lend_text2:
  37. /* Debug information */
  38. .section .debug_info
  39. .Lcu1_begin:
  40. /* CU header */
  41. .4byte .Lcu1_end - .Lcu1_start /* Length of Compilation Unit */
  42. .Lcu1_start:
  43. .2byte 2 /* DWARF Version */
  44. .4byte .Labbrev1_begin /* Offset into abbrev section */
  45. .byte 4 /* Pointer size */
  46. /* CU die */
  47. .uleb128 1 /* Abbrev: DW_TAG_compile_unit */
  48. .4byte .Lrange1_begin
  49. .ascii "file1.c\0" /* DW_AT_name */
  50. .byte 1 /* DW_AT_language (C) */
  51. /* func_cu1 */
  52. .uleb128 2 /* Abbrev: DW_TAG_subprogram */
  53. .ascii "func_cu1\0" /* DW_AT_name */
  54. .4byte .Ltype_int-.Lcu1_begin /* DW_AT_type */
  55. .4byte .Lbegin_func_cu1 /* DW_AT_low_pc */
  56. .4byte .Lend_func_cu1 /* DW_AT_high_pc */
  57. /* func_cu1 */
  58. .uleb128 2 /* Abbrev: DW_TAG_subprogram */
  59. .ascii "func_cu2\0" /* DW_AT_name */
  60. .4byte .Ltype_int-.Lcu1_begin /* DW_AT_type */
  61. .4byte .Lbegin_func_cu2 /* DW_AT_low_pc */
  62. .4byte .Lend_func_cu2 /* DW_AT_high_pc */
  63. .Ltype_int:
  64. .uleb128 3 /* Abbrev: DW_TAG_base_type */
  65. .ascii "int\0" /* DW_AT_name */
  66. .byte 4 /* DW_AT_byte_size */
  67. .byte 5 /* DW_AT_encoding */
  68. .byte 0 /* End of children of CU */
  69. .Lcu1_end:
  70. .section .debug_ranges
  71. .Lrange1_begin:
  72. .4byte 0xffffffff /* base address marker */
  73. .4byte .Lbegin_text1 /* base address */
  74. .4byte 0 /* start offset */
  75. .4byte .Lend_text1 - .Lbegin_text1 /* end offset */
  76. .4byte 0xffffffff /* base address marker */
  77. .4byte .Lbegin_text2 /* base address */
  78. .4byte 0 /* start offset */
  79. .4byte .Lend_text2 - .Lbegin_text2 /* end offset */
  80. .4byte 0 /* End marker (Part 1) */
  81. .4byte 0 /* End marker (Part 2) */
  82. .section .debug_abbrev
  83. .Labbrev1_begin:
  84. .uleb128 1 /* Abbrev code */
  85. .uleb128 0x11 /* DW_TAG_compile_unit */
  86. .byte 1 /* has_children */
  87. .uleb128 0x55 /* DW_AT_ranges */
  88. .uleb128 0x17 /* DW_FORM_sec_offset */
  89. .uleb128 0x3 /* DW_AT_name */
  90. .uleb128 0x8 /* DW_FORM_string */
  91. .uleb128 0x13 /* DW_AT_language */
  92. .uleb128 0xb /* DW_FORM_data1 */
  93. .byte 0x0 /* Terminator */
  94. .byte 0x0 /* Terminator */
  95. .uleb128 2 /* Abbrev code */
  96. .uleb128 0x2e /* DW_TAG_subprogram */
  97. .byte 0 /* has_children */
  98. .uleb128 0x3 /* DW_AT_name */
  99. .uleb128 0x8 /* DW_FORM_string */
  100. .uleb128 0x49 /* DW_AT_type */
  101. .uleb128 0x13 /* DW_FORM_ref4 */
  102. .uleb128 0x11 /* DW_AT_low_pc */
  103. .uleb128 0x1 /* DW_FORM_addr */
  104. .uleb128 0x12 /* DW_AT_high_pc */
  105. .uleb128 0x1 /* DW_FORM_addr */
  106. .byte 0x0 /* Terminator */
  107. .byte 0x0 /* Terminator */
  108. .uleb128 3 /* Abbrev code */
  109. .uleb128 0x24 /* DW_TAG_base_type */
  110. .byte 0 /* has_children */
  111. .uleb128 0x3 /* DW_AT_name */
  112. .uleb128 0x8 /* DW_FORM_string */
  113. .uleb128 0xb /* DW_AT_byte_size */
  114. .uleb128 0xb /* DW_FORM_data1 */
  115. .uleb128 0x3e /* DW_AT_encoding */
  116. .uleb128 0xb /* DW_FORM_data1 */
  117. .byte 0x0 /* Terminator */
  118. .byte 0x0 /* Terminator */
  119. .byte 0x0 /* Terminator */
  120. .byte 0x0 /* Terminator */