| # RUN: %yaml2obj %s -o %t.obj |
| # RUN: %bloaty --raw-map %t.obj | %FileCheck %s |
| |
| --- !ELF |
| FileHeader: |
| Class: ELFCLASS64 |
| Data: ELFDATA2LSB |
| Type: ET_REL |
| Machine: EM_X86_64 |
| Sections: |
| - Name: .text |
| Type: SHT_PROGBITS |
| Flags: [ SHF_ALLOC, SHF_EXECINSTR ] |
| AddressAlign: 0x0000000000000010 |
| Content: 554889E5B8050000005DC3 |
| - Name: .bss |
| Type: SHT_NOBITS |
| Flags: [ SHF_WRITE, SHF_ALLOC ] |
| AddressAlign: 0x0000000000000010 |
| Size: 0x000000000000007B |
| - Name: .data |
| Type: SHT_PROGBITS |
| Flags: [ SHF_WRITE, SHF_ALLOC ] |
| AddressAlign: 0x0000000000000010 |
| Content: '010203000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' |
| - Name: .rodata |
| Type: SHT_PROGBITS |
| Flags: [ SHF_ALLOC ] |
| AddressAlign: 0x0000000000000010 |
| Content: '010203000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000' |
| - Name: .comment |
| Type: SHT_PROGBITS |
| Flags: [ SHF_MERGE, SHF_STRINGS ] |
| AddressAlign: 0x0000000000000001 |
| EntSize: 0x0000000000000001 |
| Content: 0044656269616E20636C616E672076657273696F6E2031312E302E312D3200 |
| - Name: .note.GNU-stack |
| Type: SHT_PROGBITS |
| AddressAlign: 0x0000000000000001 |
| - Name: .eh_frame |
| Type: SHT_X86_64_UNWIND |
| Flags: [ SHF_ALLOC ] |
| AddressAlign: 0x0000000000000008 |
| Content: 1400000000000000017A5200017810011B0C0708900100001C0000001C000000000000000B00000000410E108602430D06460C0708000000 |
| - Name: .rela.eh_frame |
| Type: SHT_RELA |
| Link: .symtab |
| AddressAlign: 0x0000000000000008 |
| Info: .eh_frame |
| Relocations: |
| - Offset: 0x0000000000000020 |
| Symbol: .text |
| Type: R_X86_64_PC32 |
| - Name: .llvm_addrsig |
| Type: SHT_LLVM_ADDRSIG |
| Flags: [ SHF_EXCLUDE ] |
| Link: .symtab |
| AddressAlign: 0x0000000000000001 |
| Symbols: [ ] |
| Symbols: |
| - Name: test.c |
| Type: STT_FILE |
| Index: SHN_ABS |
| - Name: .text |
| Type: STT_SECTION |
| Section: .text |
| - Name: foobar |
| Type: STT_FUNC |
| Section: .text |
| Binding: STB_GLOBAL |
| Size: 0x000000000000000B |
| - Name: x |
| Type: STT_OBJECT |
| Section: .bss |
| Binding: STB_GLOBAL |
| Size: 0x000000000000007B |
| - Name: y |
| Type: STT_OBJECT |
| Section: .data |
| Binding: STB_GLOBAL |
| Size: 0x00000000000001C8 |
| - Name: z |
| Type: STT_OBJECT |
| Section: .rodata |
| Binding: STB_GLOBAL |
| Size: 0x0000000000000315 |
| ... |
| |
| # CHECK: FILE MAP: |
| # CHECK: 000-040 64 [ELF Header] |
| # CHECK: 040-050 16 .text |
| # CHECK: 050-220 464 .data |
| # CHECK: 220-535 789 .rodata |
| # CHECK: 535-558 35 .comment |
| # CHECK: 558-590 56 .eh_frame |
| # CHECK: 590-5a8 24 .rela.eh_frame |
| # CHECK: 5a8-650 168 .symtab |
| # CHECK: 650-66b 27 .strtab |
| # CHECK: 66b-6d8 109 .shstrtab |
| # CHECK: 6d8-a18 832 [ELF Section Headers] |
| |
| # CHECK: VM MAP: |
| # CHECK: 00000000000-10000000000 1099511627776 [-- Nothing mapped --] |
| # CHECK: 10000000000-1000000000b 11 .text |
| # CHECK: 1000000000b-20000000000 1099511627765 [-- Nothing mapped --] |
| # CHECK: 20000000000-2000000007b 123 .bss |
| # CHECK: 2000000007b-30000000000 1099511627653 [-- Nothing mapped --] |
| # CHECK: 30000000000-300000001c8 456 .data |
| # CHECK: 300000001c8-40000000000 1099511627320 [-- Nothing mapped --] |
| # CHECK: 40000000000-40000000315 789 .rodata |
| # CHECK: 40000000315-70000000000 3298534882539 [-- Nothing mapped --] |
| # CHECK: 70000000000-70000000038 56 .eh_frame |