normal-obj.test 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. # RUN: %yaml2obj %s -o %t.obj
  2. # RUN: %bloaty --raw-map %t.obj | %FileCheck %s
  3. --- !ELF
  4. FileHeader:
  5. Class: ELFCLASS64
  6. Data: ELFDATA2LSB
  7. Type: ET_REL
  8. Machine: EM_X86_64
  9. Sections:
  10. - Name: .text
  11. Type: SHT_PROGBITS
  12. Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
  13. AddressAlign: 0x0000000000000010
  14. Content: 554889E5B8050000005DC3
  15. - Name: .bss
  16. Type: SHT_NOBITS
  17. Flags: [ SHF_WRITE, SHF_ALLOC ]
  18. AddressAlign: 0x0000000000000010
  19. Size: 0x000000000000007B
  20. - Name: .data
  21. Type: SHT_PROGBITS
  22. Flags: [ SHF_WRITE, SHF_ALLOC ]
  23. AddressAlign: 0x0000000000000010
  24. Content: '010203000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
  25. - Name: .rodata
  26. Type: SHT_PROGBITS
  27. Flags: [ SHF_ALLOC ]
  28. AddressAlign: 0x0000000000000010
  29. Content: '010203000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
  30. - Name: .comment
  31. Type: SHT_PROGBITS
  32. Flags: [ SHF_MERGE, SHF_STRINGS ]
  33. AddressAlign: 0x0000000000000001
  34. EntSize: 0x0000000000000001
  35. Content: 0044656269616E20636C616E672076657273696F6E2031312E302E312D3200
  36. - Name: .note.GNU-stack
  37. Type: SHT_PROGBITS
  38. AddressAlign: 0x0000000000000001
  39. - Name: .eh_frame
  40. Type: SHT_X86_64_UNWIND
  41. Flags: [ SHF_ALLOC ]
  42. AddressAlign: 0x0000000000000008
  43. Content: 1400000000000000017A5200017810011B0C0708900100001C0000001C000000000000000B00000000410E108602430D06460C0708000000
  44. - Name: .rela.eh_frame
  45. Type: SHT_RELA
  46. Link: .symtab
  47. AddressAlign: 0x0000000000000008
  48. Info: .eh_frame
  49. Relocations:
  50. - Offset: 0x0000000000000020
  51. Symbol: .text
  52. Type: R_X86_64_PC32
  53. - Name: .llvm_addrsig
  54. Type: SHT_LLVM_ADDRSIG
  55. Flags: [ SHF_EXCLUDE ]
  56. Link: .symtab
  57. AddressAlign: 0x0000000000000001
  58. Symbols: [ ]
  59. Symbols:
  60. - Name: test.c
  61. Type: STT_FILE
  62. Index: SHN_ABS
  63. - Name: .text
  64. Type: STT_SECTION
  65. Section: .text
  66. - Name: foobar
  67. Type: STT_FUNC
  68. Section: .text
  69. Binding: STB_GLOBAL
  70. Size: 0x000000000000000B
  71. - Name: x
  72. Type: STT_OBJECT
  73. Section: .bss
  74. Binding: STB_GLOBAL
  75. Size: 0x000000000000007B
  76. - Name: y
  77. Type: STT_OBJECT
  78. Section: .data
  79. Binding: STB_GLOBAL
  80. Size: 0x00000000000001C8
  81. - Name: z
  82. Type: STT_OBJECT
  83. Section: .rodata
  84. Binding: STB_GLOBAL
  85. Size: 0x0000000000000315
  86. ...
  87. # CHECK: FILE MAP:
  88. # CHECK: 000-040 64 [ELF Header]
  89. # CHECK: 040-050 16 .text
  90. # CHECK: 050-220 464 .data
  91. # CHECK: 220-535 789 .rodata
  92. # CHECK: 535-558 35 .comment
  93. # CHECK: 558-590 56 .eh_frame
  94. # CHECK: 590-5a8 24 .rela.eh_frame
  95. # CHECK: 5a8-650 168 .symtab
  96. # CHECK: 650-66b 27 .strtab
  97. # CHECK: 66b-6d8 109 .shstrtab
  98. # CHECK: 6d8-a18 832 [ELF Section Headers]
  99. # CHECK: VM MAP:
  100. # CHECK: 00000000000-10000000000 1099511627776 [-- Nothing mapped --]
  101. # CHECK: 10000000000-1000000000b 11 .text
  102. # CHECK: 1000000000b-20000000000 1099511627765 [-- Nothing mapped --]
  103. # CHECK: 20000000000-2000000007b 123 .bss
  104. # CHECK: 2000000007b-30000000000 1099511627653 [-- Nothing mapped --]
  105. # CHECK: 30000000000-300000001c8 456 .data
  106. # CHECK: 300000001c8-40000000000 1099511627320 [-- Nothing mapped --]
  107. # CHECK: 40000000000-40000000315 789 .rodata
  108. # CHECK: 40000000315-70000000000 3298534882539 [-- Nothing mapped --]
  109. # CHECK: 70000000000-70000000038 56 .eh_frame