566 lines · yaml
1## Test loading an ELF file with split DWARF.2## First we make the ELF file and dwo file from yaml,3## then we test converting the ELF file with and without a valid dwo4 5## RUN: yaml2obj %s -o %t6## RUN: llvm-gsymutil --convert=%t -o %t.gsym | FileCheck %s --check-prefix=WARNING7## RUN: llvm-gsymutil --convert=%t -o %t.gsym --quiet | FileCheck %s --check-prefix=WARNING-QUIET8 9## WARNING: Input file: {{.*\.yaml\.tmp}}10## WARNING: Output file (x86_64): {{.*\.yaml\.tmp\.gsym}}11## WARNING: warning: Unable to retrieve DWO .debug_info section for main_split-main.dwo12## WARNING: Loaded 0 functions from DWARF.13## WARNING: Loaded 10 functions from symbol table.14## WARNING: Pruned 0 functions, ended with 10 total15 16## WARNING-QUIET: Input file: {{.*\.yaml\.tmp}}17## WARNING-QUIET: Output file (x86_64): {{.*\.yaml\.tmp\.gsym}}18## WARNING-QUIET: Pruned 0 functions, ended with 10 total19## WARNING-QUIET: warning: Unable to retrieve DWO .debug_info section for some object files. (Remove the --quiet flag for full output)20 21 22 23--- !ELF24FileHeader:25 Class: ELFCLASS6426 Data: ELFDATA2LSB27 Type: ET_EXEC28 Machine: EM_X86_6429 Entry: 0x40102030ProgramHeaders:31 - Type: PT_PHDR32 Flags: [ PF_R ]33 VAddr: 0x40004034 Align: 0x835 - Type: PT_INTERP36 Flags: [ PF_R ]37 FirstSec: .interp38 LastSec: .interp39 VAddr: 0x40031840 - Type: PT_LOAD41 Flags: [ PF_R ]42 FirstSec: .interp43 LastSec: .rela.dyn44 VAddr: 0x40000045 Align: 0x100046 - Type: PT_LOAD47 Flags: [ PF_X, PF_R ]48 FirstSec: .init49 LastSec: .fini50 VAddr: 0x40100051 Align: 0x100052 - Type: PT_LOAD53 Flags: [ PF_R ]54 FirstSec: .rodata55 LastSec: .eh_frame56 VAddr: 0x40200057 Align: 0x100058 - Type: PT_LOAD59 Flags: [ PF_W, PF_R ]60 FirstSec: .init_array61 LastSec: .bss62 VAddr: 0x403DF863 Align: 0x100064 - Type: PT_DYNAMIC65 Flags: [ PF_W, PF_R ]66 FirstSec: .dynamic67 LastSec: .dynamic68 VAddr: 0x403E0869 Align: 0x870 - Type: PT_NOTE71 Flags: [ PF_R ]72 FirstSec: .note.gnu.property73 LastSec: .note.gnu.property74 VAddr: 0x40033875 Align: 0x876 - Type: PT_NOTE77 Flags: [ PF_R ]78 FirstSec: .note.gnu.build-id79 LastSec: .note.ABI-tag80 VAddr: 0x40035881 Align: 0x482 - Type: PT_GNU_PROPERTY83 Flags: [ PF_R ]84 FirstSec: .note.gnu.property85 LastSec: .note.gnu.property86 VAddr: 0x40033887 Align: 0x888 - Type: PT_GNU_EH_FRAME89 Flags: [ PF_R ]90 FirstSec: .eh_frame_hdr91 LastSec: .eh_frame_hdr92 VAddr: 0x40201093 Align: 0x494 - Type: PT_GNU_STACK95 Flags: [ PF_W, PF_R ]96 Align: 0x1097 - Type: PT_GNU_RELRO98 Flags: [ PF_R ]99 FirstSec: .init_array100 LastSec: .got.plt101 VAddr: 0x403DF8102Sections:103 - Name: .interp104 Type: SHT_PROGBITS105 Flags: [ SHF_ALLOC ]106 Address: 0x400318107 AddressAlign: 0x1108 Content: 2F6C696236342F6C642D6C696E75782D7838362D36342E736F2E3200109 - Name: .note.gnu.property110 Type: SHT_NOTE111 Flags: [ SHF_ALLOC ]112 Address: 0x400338113 AddressAlign: 0x8114 Notes:115 - Name: GNU116 Desc: 028000C0040000000300000000000000117 Type: NT_GNU_PROPERTY_TYPE_0118 - Name: .note.gnu.build-id119 Type: SHT_NOTE120 Flags: [ SHF_ALLOC ]121 Address: 0x400358122 AddressAlign: 0x4123 Notes:124 - Name: GNU125 Desc: 250FD8246225C95E81C87BE2EEB38DD068A42DEE126 Type: NT_PRPSINFO127 - Name: .note.ABI-tag128 Type: SHT_NOTE129 Flags: [ SHF_ALLOC ]130 Address: 0x40037C131 AddressAlign: 0x4132 Notes:133 - Name: GNU134 Desc: '00000000030000000200000000000000'135 Type: NT_VERSION136 - Name: .gnu.hash137 Type: SHT_GNU_HASH138 Flags: [ SHF_ALLOC ]139 Address: 0x4003A0140 Link: .dynsym141 AddressAlign: 0x8142 Header:143 SymNdx: 0x1144 Shift2: 0x0145 BloomFilter: [ 0x0 ]146 HashBuckets: [ 0x0 ]147 HashValues: [ ]148 - Name: .dynsym149 Type: SHT_DYNSYM150 Flags: [ SHF_ALLOC ]151 Address: 0x4003C0152 Link: .dynstr153 AddressAlign: 0x8154 - Name: .dynstr155 Type: SHT_STRTAB156 Flags: [ SHF_ALLOC ]157 Address: 0x400438158 AddressAlign: 0x1159 - Name: .gnu.version160 Type: SHT_GNU_versym161 Flags: [ SHF_ALLOC ]162 Address: 0x4004CC163 Link: .dynsym164 AddressAlign: 0x2165 Entries: [ 0, 2, 1, 1, 1 ]166 - Name: .gnu.version_r167 Type: SHT_GNU_verneed168 Flags: [ SHF_ALLOC ]169 Address: 0x4004D8170 Link: .dynstr171 AddressAlign: 0x8172 Dependencies:173 - Version: 1174 File: libc.so.6175 Entries:176 - Name: GLIBC_2.34177 Hash: 110530996178 Flags: 0179 Other: 2180 - Name: .rela.dyn181 Type: SHT_RELA182 Flags: [ SHF_ALLOC ]183 Address: 0x4004F8184 Link: .dynsym185 AddressAlign: 0x8186 Relocations:187 - Offset: 0x403FC8188 Symbol: __libc_start_main189 Type: R_X86_64_GLOB_DAT190 - Offset: 0x403FD0191 Symbol: _ITM_deregisterTMCloneTable192 Type: R_X86_64_GLOB_DAT193 - Offset: 0x403FD8194 Symbol: __gmon_start__195 Type: R_X86_64_GLOB_DAT196 - Offset: 0x403FE0197 Symbol: _ITM_registerTMCloneTable198 Type: R_X86_64_GLOB_DAT199 - Name: .init200 Type: SHT_PROGBITS201 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]202 Address: 0x401000203 AddressAlign: 0x4204 Offset: 0x1000205 Content: F30F1EFA4883EC08488B05C92F00004885C07402FFD04883C408C3206 - Name: .text207 Type: SHT_PROGBITS208 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]209 Address: 0x401020210 AddressAlign: 0x10211 Content: F30F1EFA31ED4989D15E4889E24883E4F050544531C031C948C7C720114000FF15832F0000F4662E0F1F840000000000F30F1EFAC3662E0F1F84000000000090488D3DA12F0000488D059A2F00004839F87415488B05562F00004885C07409FFE00F1F8000000000C30F1F8000000000488D3D712F0000488D356A2F00004829FE4889F048C1EE3F48C1F8034801C648D1FE7414488B05252F00004885C07408FFE0660F1F440000C30F1F8000000000F30F1EFA803D292F0000007513554889E5E87AFFFFFFC605172F0000015DC390C366662E0F1F8400000000000F1F4000F30F1EFAEB8A662E0F1F840000000000554889E55DC3662E0F1F840000000000554889E54883EC10C745FC00000000E8DCFFFFFF31C04883C4105DC3212 - Name: .fini213 Type: SHT_PROGBITS214 Flags: [ SHF_ALLOC, SHF_EXECINSTR ]215 Address: 0x40113C216 AddressAlign: 0x4217 Content: F30F1EFA4883EC084883C408C3218 - Name: .rodata219 Type: SHT_PROGBITS220 Flags: [ SHF_ALLOC ]221 Address: 0x402000222 AddressAlign: 0x8223 Offset: 0x2000224 Content: '01000200000000000000000000000000'225 - Name: .eh_frame_hdr226 Type: SHT_PROGBITS227 Flags: [ SHF_ALLOC ]228 Address: 0x402010229 AddressAlign: 0x4230 Content: 011B033B2C0000000400000010F0FFFF4800000040F0FFFF5C00000000F1FFFF7000000010F1FFFF90000000231 - Name: .eh_frame232 Type: SHT_PROGBITS233 Flags: [ SHF_ALLOC ]234 Address: 0x402040235 AddressAlign: 0x8236 Content: 1400000000000000017A5200017810011B0C070890010000100000001C000000C0EFFFFF26000000004407101000000030000000DCEFFFFF05000000000000001C0000004400000088F0FFFF0600000000410E108602430D06410C07080000001C0000006400000078F0FFFF1C00000000410E108602430D06570C070800000000000000237 - Name: .init_array238 Type: SHT_INIT_ARRAY239 Flags: [ SHF_WRITE, SHF_ALLOC ]240 Address: 0x403DF8241 AddressAlign: 0x8242 EntSize: 0x8243 Offset: 0x2DF8244 Content: '0011400000000000'245 - Name: .fini_array246 Type: SHT_FINI_ARRAY247 Flags: [ SHF_WRITE, SHF_ALLOC ]248 Address: 0x403E00249 AddressAlign: 0x8250 EntSize: 0x8251 Content: D010400000000000252 - Name: .dynamic253 Type: SHT_DYNAMIC254 Flags: [ SHF_WRITE, SHF_ALLOC ]255 Address: 0x403E08256 Link: .dynstr257 AddressAlign: 0x8258 Entries:259 - Tag: DT_NEEDED260 Value: 0x58261 - Tag: DT_NEEDED262 Value: 0x67263 - Tag: DT_NEEDED264 Value: 0x71265 - Tag: DT_NEEDED266 Value: 0x7F267 - Tag: DT_INIT268 Value: 0x401000269 - Tag: DT_FINI270 Value: 0x40113C271 - Tag: DT_INIT_ARRAY272 Value: 0x403DF8273 - Tag: DT_INIT_ARRAYSZ274 Value: 0x8275 - Tag: DT_FINI_ARRAY276 Value: 0x403E00277 - Tag: DT_FINI_ARRAYSZ278 Value: 0x8279 - Tag: DT_GNU_HASH280 Value: 0x4003A0281 - Tag: DT_STRTAB282 Value: 0x400438283 - Tag: DT_SYMTAB284 Value: 0x4003C0285 - Tag: DT_STRSZ286 Value: 0x94287 - Tag: DT_SYMENT288 Value: 0x18289 - Tag: DT_DEBUG290 Value: 0x0291 - Tag: DT_RELA292 Value: 0x4004F8293 - Tag: DT_RELASZ294 Value: 0x60295 - Tag: DT_RELAENT296 Value: 0x18297 - Tag: DT_VERNEED298 Value: 0x4004D8299 - Tag: DT_VERNEEDNUM300 Value: 0x1301 - Tag: DT_VERSYM302 Value: 0x4004CC303 - Tag: DT_NULL304 Value: 0x0305 - Tag: DT_NULL306 Value: 0x0307 - Tag: DT_NULL308 Value: 0x0309 - Tag: DT_NULL310 Value: 0x0311 - Tag: DT_NULL312 Value: 0x0313 - Tag: DT_NULL314 Value: 0x0315 - Name: .got316 Type: SHT_PROGBITS317 Flags: [ SHF_WRITE, SHF_ALLOC ]318 Address: 0x403FC8319 AddressAlign: 0x8320 EntSize: 0x8321 Content: '0000000000000000000000000000000000000000000000000000000000000000'322 - Name: .got.plt323 Type: SHT_PROGBITS324 Flags: [ SHF_WRITE, SHF_ALLOC ]325 Address: 0x403FE8326 AddressAlign: 0x8327 EntSize: 0x8328 Content: '083E40000000000000000000000000000000000000000000'329 - Name: .data330 Type: SHT_PROGBITS331 Flags: [ SHF_WRITE, SHF_ALLOC ]332 Address: 0x404000333 AddressAlign: 0x1334 Content: '00000000'335 - Name: .bss336 Type: SHT_NOBITS337 Flags: [ SHF_WRITE, SHF_ALLOC ]338 Address: 0x404004339 AddressAlign: 0x1340 Size: 0x4341 - Name: .comment342 Type: SHT_PROGBITS343 Flags: [ SHF_MERGE, SHF_STRINGS ]344 AddressAlign: 0x1345 EntSize: 0x1346 Content: 4743433A2028474E55292031312E342E312032303233303630352028526564204861742031312E342E312D3229004743433A2028474E55292031332E322E312032303233313131302028526564204861742031332E322E312D352900636C616E672076657273696F6E2031372E302E31202843656E744F532031372E302E312D322E656C392900347 - Name: .gnu.build.attributes348 Type: SHT_NOTE349 Address: 0x406008350 AddressAlign: 0x4351 Notes:352 - Name: "GA$\x013a1"353 Desc: '20104000000000004610400000000000'354 Type: NT_GNU_BUILD_ATTRIBUTE_OPEN355 - Name: "GA$\x013a1"356 Desc: '55104000000000005510400000000000'357 Type: NT_GNU_BUILD_ATTRIBUTE_OPEN358 - Name: "GA$\x013a1"359 Desc: '00104000000000001610400000000000'360 Type: NT_GNU_BUILD_ATTRIBUTE_OPEN361 - Name: "GA$\x013a1"362 Desc: 3C114000000000004411400000000000363 Type: NT_GNU_BUILD_ATTRIBUTE_OPEN364 - Name: "GA$\x013a1"365 Desc: '60104000000000000611400000000000'366 Type: NT_GNU_BUILD_ATTRIBUTE_OPEN367 - Name: "GA$\x013a1"368 Desc: 3C114000000000003C11400000000000369 Type: NT_GNU_BUILD_ATTRIBUTE_OPEN370 - Name: "GA$\x013a1"371 Desc: 3C114000000000003C11400000000000372 Type: NT_GNU_BUILD_ATTRIBUTE_OPEN373 - Name: "GA$\x013a1"374 Desc: 16104000000000001B10400000000000375 Type: NT_GNU_BUILD_ATTRIBUTE_OPEN376 - Name: "GA$\x013a1"377 Desc: '44114000000000004911400000000000'378 Type: NT_GNU_BUILD_ATTRIBUTE_OPEN379 - Name: .debug_info380 Type: SHT_PROGBITS381 AddressAlign: 0x1382 Content: 2C000000040000000000080100000000000000000E000000939F5FCB7816797B10114000000000002C00000000000000383 - Name: .debug_abbrev384 Type: SHT_PROGBITS385 AddressAlign: 0x1386 Content: 01110010171B0EB44219B0420EB1420711011206B34217000000387 - Name: .debug_line388 Type: SHT_PROGBITS389 AddressAlign: 0x1390 Content: 47000000040020000000010101FB0E0D000101010100000001000001006D61696E2E637070000000000000090210114000000000000105050A0B4B0500BD05050AE559060B2E0206000101391 - Name: .debug_addr392 Type: SHT_PROGBITS393 AddressAlign: 0x1394 Content: '10114000000000002011400000000000'395 - Name: .debug_gnu_pubnames396 Type: SHT_PROGBITS397 AddressAlign: 0x1398 Content: 21000000020000000000300000001900000030666F6F0025000000306D61696E0000000000399 - Name: .debug_gnu_pubtypes400 Type: SHT_PROGBITS401 AddressAlign: 0x1402 Content: '17000000020000000000300000003400000090696E740000000000'403Symbols:404 - Name: crt1.o405 Type: STT_FILE406 Index: SHN_ABS407 - Name: __abi_tag408 Type: STT_OBJECT409 Section: .note.ABI-tag410 Value: 0x40037C411 Size: 0x20412 - Name: crtstuff.c413 Type: STT_FILE414 Index: SHN_ABS415 - Name: deregister_tm_clones416 Type: STT_FUNC417 Section: .text418 Value: 0x401060419 - Name: register_tm_clones420 Type: STT_FUNC421 Section: .text422 Value: 0x401090423 - Name: __do_global_dtors_aux424 Type: STT_FUNC425 Section: .text426 Value: 0x4010D0427 - Name: completed.0428 Type: STT_OBJECT429 Section: .bss430 Value: 0x404004431 Size: 0x1432 - Name: __do_global_dtors_aux_fini_array_entry433 Type: STT_OBJECT434 Section: .fini_array435 Value: 0x403E00436 - Name: frame_dummy437 Type: STT_FUNC438 Section: .text439 Value: 0x401100440 - Name: __frame_dummy_init_array_entry441 Type: STT_OBJECT442 Section: .init_array443 Value: 0x403DF8444 - Name: main.cpp445 Type: STT_FILE446 Index: SHN_ABS447 - Name: 'crtstuff.c (1)'448 Type: STT_FILE449 Index: SHN_ABS450 - Name: __FRAME_END__451 Type: STT_OBJECT452 Section: .eh_frame453 Value: 0x4020C0454 - Type: STT_FILE455 Index: SHN_ABS456 - Name: __GNU_EH_FRAME_HDR457 Section: .eh_frame_hdr458 Value: 0x402010459 - Name: _DYNAMIC460 Type: STT_OBJECT461 Section: .dynamic462 Value: 0x403E08463 - Name: _GLOBAL_OFFSET_TABLE_464 Type: STT_OBJECT465 Section: .got.plt466 Value: 0x403FE8467 - Name: _edata468 Section: .data469 Binding: STB_GLOBAL470 Value: 0x404004471 - Name: data_start472 Section: .data473 Binding: STB_WEAK474 Value: 0x404000475 - Name: _IO_stdin_used476 Type: STT_OBJECT477 Section: .rodata478 Binding: STB_GLOBAL479 Value: 0x402000480 Size: 0x4481 - Name: main482 Type: STT_FUNC483 Section: .text484 Binding: STB_GLOBAL485 Value: 0x401120486 Size: 0x1C487 - Name: __dso_handle488 Type: STT_OBJECT489 Section: .rodata490 Binding: STB_GLOBAL491 Value: 0x402008492 Other: [ STV_HIDDEN ]493 - Name: _fini494 Type: STT_FUNC495 Section: .fini496 Binding: STB_GLOBAL497 Value: 0x40113C498 Other: [ STV_HIDDEN ]499 - Name: '__libc_start_main@GLIBC_2.34'500 Type: STT_FUNC501 Binding: STB_GLOBAL502 - Name: _dl_relocate_static_pie503 Type: STT_FUNC504 Section: .text505 Binding: STB_GLOBAL506 Value: 0x401050507 Size: 0x5508 Other: [ STV_HIDDEN ]509 - Name: _start510 Type: STT_FUNC511 Section: .text512 Binding: STB_GLOBAL513 Value: 0x401020514 Size: 0x26515 - Name: _init516 Type: STT_FUNC517 Section: .init518 Binding: STB_GLOBAL519 Value: 0x401000520 Other: [ STV_HIDDEN ]521 - Name: __TMC_END__522 Type: STT_OBJECT523 Section: .data524 Binding: STB_GLOBAL525 Value: 0x404008526 Other: [ STV_HIDDEN ]527 - Name: __data_start528 Section: .data529 Binding: STB_GLOBAL530 Value: 0x404000531 - Name: _end532 Section: .bss533 Binding: STB_GLOBAL534 Value: 0x404008535 - Name: __bss_start536 Section: .bss537 Binding: STB_GLOBAL538 Value: 0x404004539 - Name: _Z3foov540 Type: STT_FUNC541 Section: .text542 Binding: STB_GLOBAL543 Value: 0x401110544 Size: 0x6545 - Name: _ITM_deregisterTMCloneTable546 Binding: STB_WEAK547 - Name: __gmon_start__548 Binding: STB_WEAK549 - Name: _ITM_registerTMCloneTable550 Binding: STB_WEAK551DynamicSymbols:552 - Name: __libc_start_main553 Type: STT_FUNC554 Binding: STB_GLOBAL555 - Name: _ITM_deregisterTMCloneTable556 Binding: STB_WEAK557 - Name: __gmon_start__558 Binding: STB_WEAK559 - Name: _ITM_registerTMCloneTable560 Binding: STB_WEAK561DWARF:562 debug_str:563 - '/tmp/test_dwo'564 - main_split-main.dwo565...566