brintos

brintos / llvm-project-archived public Read only

0
0
Text · 27.1 KiB · 6a8dc84 Raw
649 lines · yaml
1## Test that yaml2obj emits .debug_addr section.2 3## a) Generate and verify a little endian DWARF32 .debug_addr section in a 64-bit object file.4 5# RUN: yaml2obj --docnum=1 -DENDIAN=ELFDATA2LSB %s -o %t1.dwarf32.le.o6# RUN: llvm-readobj --sections --section-data %t1.dwarf32.le.o | \7# RUN:   FileCheck %s -DSIZE=264 -DADDRALIGN=1 --check-prefixes=SHDR,DWARF32-LE8 9#            SHDR: Index: 110#       SHDR-NEXT: Name: .debug_addr (1)11#       SHDR-NEXT: Type: SHT_PROGBITS (0x1)12#       SHDR-NEXT: Flags [ (0x0)13#       SHDR-NEXT: ]14#       SHDR-NEXT: Address: 0x015#       SHDR-NEXT: Offset: 0x4016#       SHDR-NEXT: Size: [[SIZE]]17#       SHDR-NEXT: Link: 018#       SHDR-NEXT: Info: 019#       SHDR-NEXT: AddressAlignment: [[ADDRALIGN]]20#       SHDR-NEXT: EntrySize: 021# DWARF32-LE-NEXT: SectionData (22# DWARF32-LE-NEXT:   0000: 0C000000 05000400 34120000 7856000023##                         |        |   | |  |        |24##                         |        |   | |  |        +------- address (4-byte)25##                         |        |   | |  +------- address (4-byte)26##                         |        |   | +- segment_selector_size (1-byte)27##                         |        |   +- address_size (1-byte)28##                         |        +--- version (2-byte)29##                         +------- 1) unit_length (4-byte)30##31# DWARF32-LE-NEXT:   0010: 14000000 05000800 21430000 0000000032##                         |        |   | |  |33##                         |        |   | |  +---------------- address (8-byte)34##                         |        |   | +- segment_selector_size (1-byte)35##                         |        |   +- address_size (1-byte)36##                         |        +--- version (2-byte)37##                         +------- 2) unit_length (4-byte)38##39# DWARF32-LE-NEXT:   0020: 65870000 00000000 0C000000 0500000440##                         |                 |        |   | |41##                         |                 |        |   | +- segment_selector_size (1-byte)42##                         |                 |        |   +- address_size (1-byte)43##                         |                 |        +--- version (2-byte)44##                         |                 +------- 3) unit_length (4-byte)45##                         +---------------- address (8-byte)46##47# DWARF32-LE-NEXT:   0030: 34120000 78560000 14000000 0500000848##                         |        |        |        |   | |49##                         |        |        |        |   | +- segment_selector_size (1-byte)50##                         |        |        |        |   +- address_size (1-byte)51##                         |        |        |        +--- version (2-byte)52##                         |        |        +------- 4) unit_length (4-byte)53##                         |        +------- segment (4-byte)54##                         +------- segment (4-byte)55##56# DWARF32-LE-NEXT:   0040: 21430000 00000000 65870000 0000000057##                         |                 |58##                         |                 +---------------- segment (8-byte)59##                         +---------------- segment (8-byte)60##61# DWARF32-LE-NEXT:   0050: 1C000000 05000404 34120000 7856000062##                         |        |   | |  |        |63##                         |        |   | |  |        +------- address (4-byte)64##                         |        |   | |  +------- segment (4-byte)65##                         |        |   | +- segment_selector_size (4-byte)66##                         |        |   +- address_size (4-byte)67##                         |        +--- version (2-byte)68##                         +------- 5) unit_length (4-byte)69##70# DWARF32-LE-NEXT:   0060: 21430000 00000000 00000000 2143000071##                         |        |        |        |72##                         |        |        |        +------- address (4-byte)73##                         |        |        +------- segment (4-byte)74##                         |        +------- address (4-byte)75##                         +------- segment (4-byte)76##77# DWARF32-LE-NEXT:   0070: 34000000 05000808 34120000 0000000078##                         |        |   | |  |79##                         |        |   | |  +---------------- segment (8-byte)80##                         |        |   | +- segment_size (1-byte)81##                         |        |   +- address_size (1-byte)82##                         |        +--- version (2-byte)83##                         +------- 6) unit_length (4-byte)84##85# DWARF32-LE-NEXT:   0080: 78560000 00000000 21430000 0000000086##                         |                 |87##                         |                 +---------------- segment (8-byte)88##                         +---------------- address (8-byte)89##90# DWARF32-LE-NEXT:   0090: 00000000 00000000 00000000 0000000091##                         |                 +---------------- segment (8-byte)92##                         +---------------- address (8-byte)93##94# DWARF32-LE-NEXT:   00A0: 21430000 00000000 28000000 0500040895##                         |                 |        |   | |96##                         |                 |        |   | +- segment_size (1-byte)97##                         |                 |        |   +- address_size (1-byte)98##                         |                 |        +--- version (2-byte)99##                         |                 +------- 7) unit_length (4-byte)100##                         +---------------- address (8-byte)101##102# DWARF32-LE-NEXT:   00B0: 34120000 00000000 78560000 21430000103##                         |                 |        |104##                         |                 |        +------- segment (8-byte)105##                         |                 +------- address (4-byte)106##                         +---------------- segment (8-byte)107##108# DWARF32-LE-NEXT:   00C0: 00000000 00000000 00000000 00000000109##                         |        |        +---------------- segment (8-byte)110##                         |        +------- address (4-btye)111##                         +------- higher 4-byte of segment112##113# DWARF32-LE-NEXT:   00D0: 21430000 28000000 05000804 34120000114##                         |        |        |   | |  +------- segment (4-byte)115##                         |        |        |   | +- segment_size (1-byte)116##                         |        |        |   +- address_size (1-byte)117##                         |        |        +--- version (2-byte)118##                         |        +------- 8) unit_length (4-byte)119##                         +------- address (4-byte)120##121# DWARF32-LE-NEXT:   00E0: 78560000 00000000 21430000 00000000122##                         |                 |        |123##                         |                 |        +------- address (8-byte)124##                         |                 +------- segment (4-byte)125##                         +---------------- address (8-byte)126##127# DWARF32-LE-NEXT:   00F0: 00000000 00000000 21430000 00000000128##                         |        |        |129##                         |        |        +---------------- address (8-byte)130##                         |        +------- segment (4-byte)131##                         +------- higher 4-byte of address132##133# DWARF32-LE-NEXT:   0100: 34120000 02000400134##                         |        |   | |135##                         |        |   | +- segment_size (1-byte)136##                         |        |   +- address_size (1-byte)137##                         |        +--- version (2-byte)138##                         +------- 9) unit_length (4-byte)139# DWARF32-LE-NEXT: )140 141--- !ELF142FileHeader:143  Class: ELFCLASS64144  Data:  [[ENDIAN]]145  Type:  ET_EXEC146DWARF:147  debug_addr:148    ## 1) Only address (4-byte) exists.149    - Version:     5150      AddressSize: 0x04151      Entries:152        - Address: 0x1234153        - Address: 0x5678154    ## 2) Only address (8-byte) exists (AddressSize is derived from FileHeader).155    - Version: 5156      Entries:157        - Address: 0x4321158        - Address: 0x8765159    ## 3) Only segment (4-byte) exists.160    - Version:             5161      AddressSize:         0x00162      SegmentSelectorSize: 0x04163      Entries:164        - Segment: 0x1234165        - Segment: 0x5678166    ## 4) Only segment (8-byte) exists.167    - Version:             5168      AddressSize:         0x00169      SegmentSelectorSize: 0x08170      Entries:171        - Segment: 0x4321172        - Segment: 0x8765173    ## 5) Both address (4-byte) and segment (4-byte) exist.174    - Version:             5175      AddressSize:         0x04176      SegmentSelectorSize: 0x04177      Entries:178        - Segment: 0x1234179          Address: 0x5678180        - Segment: 0x4321181          ## Segment exists, while address takes the default value 0x00.182        - Address: 0x4321183          ## Address exists, while segment takes the default value 0x00.184    ## 6) Both address (8-byte) and segment (8-byte) exist (AddressSize is derived from FileHeader).185    - Version:             5186      SegmentSelectorSize: 0x08187      Entries:188        - Segment: 0x1234189          Address: 0x5678190        - Segment: 0x4321191          ## Segment exists, while address takes the default value 0x00.192        - Address: 0x4321193          ## Address exists, while segment takes the default value 0x00.194    ## 7) Both address (4-byte) and segment (8-byte) exist.195    - Version:             5196      AddressSize:         0x04197      SegmentSelectorSize: 0x08198      Entries:199        - Segment: 0x1234200          Address: 0x5678201        - Segment: 0x4321202          ## Segment exists, while address takes the default value 0x00.203        - Address: 0x4321204          ## Address exists, while segment takes the default value 0x00.205    ## 8) Both address (8-byte) and segment (4-byte) exist (AddressSize is derived from FileHeader).206    - Version:             5207      SegmentSelectorSize: 0x04208      Entries:209        - Segment: 0x1234210          Address: 0x5678211        - Segment: 0x4321212          ## Segment exists, while address takes the default value 0x00.213        - Address: 0x4321214          ## Address exists, while segment takes the default value 0x00.215    ## 9) Explicitly assign a value to 'Length'.216    - Length:              0x1234217      Version:             0x02218      AddressSize:         0x04219      SegmentSelectorSize: 0x00220      Entries:             []221 222## b) Generate and verify a big endian DWARF32 .debug_addr section.223 224# RUN: yaml2obj --docnum=1 -DENDIAN=ELFDATA2MSB %s -o %t1.dwarf32.be.o225# RUN: llvm-readobj --sections --section-data %t1.dwarf32.be.o | \226# RUN:   FileCheck %s -DSIZE=264 -DADDRALIGN=1 --check-prefixes=SHDR,DWARF32-BE227 228# DWARF32-BE-NEXT: SectionData (229# DWARF32-BE-NEXT:   0000: 0000000C 00050400 00001234 00005678230##                         |        |   | |  |        |231##                         |        |   | |  |        +------- address (4-byte)232##                         |        |   | |  +------- address (4-byte)233##                         |        |   | +- segment_selector_size (1-byte)234##                         |        |   +- address_size (1-byte)235##                         |        +--- version (2-byte)236##                         +------- 1) unit_length (4-byte)237##238# DWARF32-BE-NEXT:   0010: 00000014 00050800 00000000 00004321239##                         |        |   | |  |240##                         |        |   | |  +---------------- address (8-byte)241##                         |        |   | +- segment_selector_size (1-byte)242##                         |        |   +- address_size (1-byte)243##                         |        +--- version (2-byte)244##                         +------- 2) unit_length (4-byte)245##246# DWARF32-BE-NEXT:   0020: 00000000 00008765 0000000C 00050004247##                         |                 |        |   | |248##                         |                 |        |   | +- segment_selector_size (1-byte)249##                         |                 |        |   +- address_size (1-byte)250##                         |                 |        +--- version (2-byte)251##                         |                 +------- 3) unit_length (4-byte)252##                         +---------------- address (8-byte)253##254# DWARF32-BE-NEXT:   0030: 00001234 00005678 00000014 00050008255##                         |        |        |        |   | |256##                         |        |        |        |   | +- segment_selector_size (1-byte)257##                         |        |        |        |   +- address_size (1-byte)258##                         |        |        |        +--- version (2-byte)259##                         |        |        +------- 4) unit_length (4-byte)260##                         |        +------- segment (4-byte)261##                         +------- segment (4-byte)262##263# DWARF32-BE-NEXT:   0040: 00000000 00004321 00000000 00008765264##                         |                 |265##                         |                 +---------------- segment (8-byte)266##                         +---------------- segment (8-byte)267##268# DWARF32-BE-NEXT:   0050: 0000001C 00050404 00001234 00005678269##                         |        |   | |  |        |270##                         |        |   | |  |        +------- address (4-byte)271##                         |        |   | |  +------- segment (4-byte)272##                         |        |   | +- segment_selector_size (4-byte)273##                         |        |   +- address_size (4-byte)274##                         |        +--- version (2-byte)275##                         +------- 5) unit_length (4-byte)276##277# DWARF32-BE-NEXT:   0060: 00004321 00000000 00000000 00004321278##                         |        |        |        |279##                         |        |        |        +------- address (4-byte)280##                         |        |        +------- segment (4-byte)281##                         |        +------- address (4-byte)282##                         +------- segment (4-byte)283##284# DWARF32-BE-NEXT:   0070: 00000034 00050808 00000000 00001234285##                         |        |   | |  |286##                         |        |   | |  +---------------- segment (8-byte)287##                         |        |   | +- segment_size (1-byte)288##                         |        |   +- address_size (1-byte)289##                         |        +--- version (2-byte)290##                         +------- 6) unit_length (4-byte)291##292# DWARF32-BE-NEXT:   0080: 00000000 00005678 00000000 00004321293##                         |                 |294##                         |                 +---------------- segment (8-byte)295##                         +---------------- address (8-byte)296##297# DWARF32-BE-NEXT:   0090: 00000000 00000000 00000000 00000000298##                         |                 |299##                         |                 +---------------- segment (8-byte)300##                         +---------------- address (8-byte)301##302# DWARF32-BE-NEXT:   00A0: 00000000 00004321 00000028 00050408303##                         |                 |        |   | |304##                         |                 |        |   | +- segment_size (1-byte)305##                         |                 |        |   +- address_size (1-byte)306##                         |                 |        +--- version (2-byte)307##                         |                 +------- 7) unit_length (4-byte)308##                         +---------------- address (8-byte)309##310# DWARF32-BE-NEXT:   00B0: 00000000 00001234 00005678 00000000311##                         |                 |        |312##                         |                 |        +------- segment (8-byte)313##                         |                 +------- address (4-byte)314##                         +---------------- segment (8-byte)315##316# DWARF32-BE-NEXT:   00C0: 00004321 00000000 00000000 00000000317##                         |        |        |318##                         |        |        +---------------- segment (8-byte)319##                         |        +------- address (4-btye)320##                         +------- lower 4-byte of segment321##322# DWARF32-BE-NEXT:   00D0: 00004321 00000028 00050804 00001234323##                         |        |        |   | |  |324##                         |        |        |   | |  +------- segment (4-byte)325##                         |        |        |   | +- segment_size (1-byte)326##                         |        |        |   +- address_size (1-byte)327##                         |        |        +--- version (2-byte)328##                         |        +------- 8) unit_length (4-byte)329##                         +------- address (4-byte)330##331# DWARF32-BE-NEXT:   00E0: 00000000 00005678 00004321 00000000332##                         |                 |        |333##                         |                 |        +------- address (8-byte)334##                         |                 +------- segment (4-byte)335##                         +---------------- address (8-byte)336##337# DWARF32-BE-NEXT:   00F0: 00000000 00000000 00000000 00004321338##                         |        |        |339##                         |        |        +---------------- address (8-byte)340##                         |        +------- segment (4-byte)341##                         +------- lower 4-byte of address342##343# DWARF32-BE-NEXT:   0100: 00001234 00020400344##                         |        |   | |345##                         |        |   | +- segment_size (1-byte)346##                         |        |   +- address_size (1-byte)347##                         |        +--- version (2-byte)348##                         +------- 9) unit_length (4-byte)349# DWARF32-BE-NEXT: )350 351## c) Generate and verify a little endian DWARF64 .debug_addr section.352 353# RUN: yaml2obj --docnum=2 -DENDIAN=ELFDATA2LSB %s -o %t2.dwarf64.le.o354# RUN: llvm-readobj --sections --section-data %t2.dwarf64.le.o | \355# RUN:   FileCheck %s -DSIZE=56 -DADDRALIGN=1 --check-prefixes=SHDR,DWARF64-LE356 357# DWARF64-LE-NEXT: SectionData (358# DWARF64-LE-NEXT:   0000: FFFFFFFF 0C000000 00000000 05000400359##                         |                          |   | |360##                         |                          |   | +- segment_selector_size (1-byte)361##                         |                          |   +- address_size (1-byte)362##                         |                          +--- version (2-byte)363##                         +------------------------- unit_length (12-byte)364##365# DWARF64-LE-NEXT:   0010: 34120000 78560000 FFFFFFFF 14000000366##                         |        |        |367##                         |        |        +---------------- unit_length (12-byte)368##                         |        +------- address (4-byte)369##                         +------- address (4-byte)370##371# DWARF64-LE-NEXT:   0020: 00000000 05000800 21430000 00000000372##                         |        |   | |  |373##                         |        |   | |  +---------------- address (8-byte)374##                         |        |   | +- segment_selector_size (1-byte)375##                         |        |   +- address_size (1-byte)376##                         |        +--- version (2-byte)377##                         +------- last 4-byte of unit_length378##379# DWARF64-LE-NEXT:   0030: 65870000 00000000380##                         |381##                         +---------------- address (8-byte)382# DWARF64-LE-NEXT: )383 384--- !ELF385FileHeader:386  Class: ELFCLASS64387  Data:  [[ENDIAN]]388  Type:  ET_EXEC389DWARF:390  debug_addr:391    - Format:      DWARF64392      Version:     5393      AddressSize: 0x04394      Entries:395        - Address: 0x1234396        - Address: 0x5678397    - Format:   DWARF64398      Version:  5399      Entries:400        - Address: 0x4321401        - Address: 0x8765402 403## d) Generate and verify a big endian DWARF64 .debug_addr section.404 405# RUN: yaml2obj --docnum=2 -DENDIAN=ELFDATA2MSB %s -o %t2.dwarf64.be.o406# RUN: llvm-readobj --sections --section-data %t2.dwarf64.be.o | \407# RUN:   FileCheck %s -DSIZE=56 -DADDRALIGN=1 --check-prefixes=SHDR,DWARF64-BE408 409# DWARF64-BE-NEXT: SectionData (410# DWARF64-BE-NEXT:   0000: FFFFFFFF 00000000 0000000C 00050400411##                         |                          |   | |412##                         |                          |   | +- segment_selector_size (1-byte)413##                         |                          |   +- address_size (1-byte)414##                         |                          +--- version (2-byte)415##                         +------------------------- unit_length (12-byte)416##417# DWARF64-BE-NEXT:   0010: 00001234 00005678 FFFFFFFF 00000000418##                         |        |        |419##                         |        |        +---------------- unit_length (12-byte)420##                         |        +------- address (4-byte)421##                         +------- address (4-byte)422##423# DWARF64-BE-NEXT:   0020: 00000014 00050800 00000000 00004321424##                         |        |   | |  |425##                         |        |   | |  +---------------- address (8-byte)426##                         |        |   | +- segment_selector_size (1-byte)427##                         |        |   +- address_size (1-byte)428##                         |        +--- version (2-byte)429##                         +------- last 4-byte of unit_length430##431# DWARF64-BE-NEXT:   0030: 00000000 00008765432##                         |433##                         +---------------- address (8-byte)434# DWARF64-BE-NEXT: )435 436## e) Test that yaml2obj emits an error message if the 'Version' fields is missing.437 438# RUN: not yaml2obj --docnum=3 %s 2>&1 | FileCheck %s --check-prefix=MISSING-VERSION439 440# MISSING-VERSION: error: missing required key 'Version'441 442--- !ELF443FileHeader:444  Class: ELFCLASS64445  Data:  ELFDATA2LSB446  Type:  ET_EXEC447DWARF:448  debug_addr:449    - Entries: []450 451## f) Generate the .debug_addr section from raw section content.452 453# RUN: yaml2obj --docnum=4 %s -o %t4.o454# RUN: llvm-readobj --sections --section-data %t4.o | \455# RUN:   FileCheck %s -DADDRALIGN=0 -DSIZE=3 --check-prefixes=SHDR,ARBITRARY-CONTENT456 457#      ARBITRARY-CONTENT: SectionData (458# ARBITRARY-CONTENT-NEXT:   0000: 112233459# ARBITRARY-CONTENT-NEXT: )460 461--- !ELF462FileHeader:463  Class: ELFCLASS64464  Data:  ELFDATA2LSB465  Type:  ET_EXEC466Sections:467  - Name:    .debug_addr468    Type:    SHT_PROGBITS469    Content: "112233"470 471## g) Generate the .debug_addr section when the "Size" is specified.472 473# RUN: yaml2obj --docnum=5 %s -o %t5.o474# RUN: llvm-readelf --hex-dump=.debug_addr %t5.o | FileCheck %s --check-prefix=SIZE475 476#       SIZE: Hex dump of section '.debug_addr':477#  SIZE-NEXT: 0x00000000 00000000 00000000 00000000 00000000 ................478# SIZE-EMPTY:479 480--- !ELF481FileHeader:482  Class: ELFCLASS64483  Data:  ELFDATA2LSB484  Type:  ET_EXEC485Sections:486  - Name: .debug_addr487    Type: SHT_PROGBITS488    Size: 0x10489 490## h) Test that yaml2obj emits an error message when both the "Size" and the491## "debug_addr" entry are specified at the same time.492 493# RUN: not yaml2obj --docnum=6 %s 2>&1 | FileCheck %s --check-prefix=ERROR494 495# ERROR: yaml2obj: error: cannot specify section '.debug_addr' contents in the 'DWARF' entry and the 'Content' or 'Size' in the 'Sections' entry at the same time496 497--- !ELF498FileHeader:499  Class: ELFCLASS64500  Data:  ELFDATA2LSB501  Type:  ET_EXEC502Sections:503  - Name: .debug_addr504    Type: SHT_PROGBITS505    Size: 0x10506DWARF:507  debug_addr:508    - Version: 5509      Entries: []510 511## i) Test that yaml2obj emits an error message when both the "Content" and the512## "debug_addr" entry are specified at the same time.513 514# RUN: not yaml2obj --docnum=7 %s 2>&1 | FileCheck %s --check-prefix=ERROR515 516--- !ELF517FileHeader:518  Class: ELFCLASS64519  Data:  ELFDATA2LSB520  Type:  ET_EXEC521Sections:522  - Name:    .debug_addr523    Type:    SHT_PROGBITS524    Content: "00"525DWARF:526  debug_addr:527    - Version: 5528      Entries: []529 530## j) Test that all the properties can be overridden by the section header when531## the "debug_addr" entry doesn't exist.532 533# RUN: yaml2obj --docnum=8 %s -o %t8.o534# RUN: llvm-readelf --sections %t8.o | FileCheck %s --check-prefix=OVERRIDDEN535 536#      OVERRIDDEN: [Nr] Name        Type   Address          Off    Size   ES Flg Lk Inf Al537#      OVERRIDDEN: [ 1] .debug_addr STRTAB 0000000000002020 000050 000008 01   A  2   1  2538# OVERRIDDEN-NEXT: [ 2] .sec        STRTAB 0000000000000000 000058 000000 00      0   0  0539 540--- !ELF541FileHeader:542  Class: ELFCLASS64543  Data:  ELFDATA2LSB544  Type:  ET_EXEC545Sections:546  - Name:         .debug_addr547    Type:         SHT_STRTAB  ## SHT_PROGBITS by default.548    Flags:        [SHF_ALLOC] ## 0 by default.549    Link:         .sec        ## 0 by default.550    EntSize:      1           ## 0 by default.551    Info:         1           ## 0 by default.552    AddressAlign: 2           ## 0 by default.553    Address:      0x2020      ## 0x00 by default.554    Offset:       0x50        ## 0x40 for the first section.555    Size:         0x08        ## Set the "Size" so that we can reuse the check tag "OVERRIDDEN".556  - Name:         .sec        ## Linked by .debug_addr.557    Type:         SHT_STRTAB558 559## k) Test that all the properties can be overridden by the section header when560## the "debug_addr" entry exists.561 562# RUN: yaml2obj --docnum=9 %s -o %t9.o563# RUN: llvm-readelf --sections %t9.o | FileCheck %s --check-prefix=OVERRIDDEN564 565--- !ELF566FileHeader:567  Class: ELFCLASS64568  Data:  ELFDATA2LSB569  Type:  ET_EXEC570Sections:571  - Name:         .debug_addr572    Type:         SHT_STRTAB  ## SHT_PROGBITS by default.573    Flags:        [SHF_ALLOC] ## 0 by default.574    Link:         .sec        ## 0 by default.575    EntSize:      1           ## 0 by default.576    Info:         1           ## 0 by default.577    AddressAlign: 2           ## 1 by default.578    Address:      0x2020      ## 0x00 by default.579    Offset:       0x50        ## 0x40 for the first section.580  - Name:         .sec        ## Linked by .debug_addr.581    Type:         SHT_STRTAB582DWARF:583  debug_addr:584    - Version: 5585      Entries: []586 587## l) Test that yaml2obj still generates a .debug_addr section if we assign an invalid value588## to 'AddressSize' or 'SegmentSelectorSize' when the 'Entries' list is empty.589 590# RUN: yaml2obj --docnum=10 -DSIZENAME=AddressSize %s -o %t10.addr.o591# RUN: llvm-readelf --hex-dump=.debug_addr %t10.addr.o | \592# RUN:   FileCheck -DADDRSIZE=03 -DSEGSIZE=00 %s --check-prefix=ADDR-SEG-SIZE593 594# RUN: yaml2obj --docnum=10 -DSIZENAME=SegmentSelectorSize %s -o %t10.seg.o595# RUN: llvm-readelf --hex-dump=.debug_addr %t10.seg.o | \596# RUN:   FileCheck -DADDRSIZE=08 -DSEGSIZE=03 %s --check-prefix=ADDR-SEG-SIZE597 598#      ADDR-SEG-SIZE: Hex dump of section '.debug_addr':599# ADDR-SEG-SIZE-NEXT: 0x00000000 04000000 0500[[ADDRSIZE]][[SEGSIZE]]600 601--- !ELF602FileHeader:603  Class: ELFCLASS64604  Data:  ELFDATA2LSB605  Type:  ET_EXEC606DWARF:607  debug_addr:608    - Version:      5609      [[SIZENAME]]: 3610      Entries:      []611 612## m) Test that yaml2obj emits an error message if we try to assign an invalid value to613## 'AddressSize' or 'SegmentSelectorSize' when the 'Entries' list isn't empty.614 615# RUN: not yaml2obj --docnum=11 -DSIZENAME=AddressSize %s 2>&1 | \616# RUN:   FileCheck -DFIELD=address %s --check-prefix=INVALID-SIZE617 618# RUN: not yaml2obj --docnum=11 -DSIZENAME=SegmentSelectorSize %s 2>&1 | \619# RUN:   FileCheck -DFIELD=segment %s --check-prefix=INVALID-SIZE620 621# INVALID-SIZE: yaml2obj: error: unable to write debug_addr [[FIELD]]: invalid integer write size: 3622 623--- !ELF624FileHeader:625  Class: ELFCLASS64626  Data:  ELFDATA2LSB627  Type:  ET_EXEC628DWARF:629  debug_addr:630    - Version:      5631      [[SIZENAME]]: 3632      Entries:633        - Address: 0x1234634 635## n) Test that the .debug_addr section header is emitted if the "debug_addr"636## entry is empty.637 638# RUN: yaml2obj --docnum=12 %s -o %t12.o639# RUN: llvm-readobj --sections %t12.o | \640# RUN:   FileCheck %s -DSIZE=0 -DADDRALIGN=1 --check-prefix=SHDR641 642--- !ELF643FileHeader:644  Class: ELFCLASS64645  Data:  ELFDATA2LSB646  Type:  ET_EXEC647DWARF:648  debug_addr: []649