brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.8 KiB · f082e89 Raw
92 lines · yaml
1## Check how we dump SHT_GNU_verdef sections.2## Check we don't dump the `Info` field when its value is equal3## to the number of version definitions.4 5# RUN: yaml2obj %s -o %t6# RUN: obj2yaml %t | FileCheck %s7 8# CHECK:       - Name:         .gnu.version_d9# CHECK-NEXT:    Type:         SHT_GNU_verdef10# CHECK-NEXT:    Flags:        [ SHF_ALLOC ]11# CHECK-NEXT:    Address:      0x23012# CHECK-NEXT:    Link:         .dynstr13# CHECK-NEXT:    AddressAlign: 0x414# INFO-NEXT:     Info:         0x415# CHECK-NEXT:    Entries:16# CHECK-NEXT:      - Names:17# CHECK-NEXT:          - VERSION_018# CHECK-NEXT:      - Flags:      219# CHECK-NEXT:        VersionNdx: 220# CHECK-NEXT:        Hash:       10838792121# CHECK-NEXT:        Names:22# CHECK-NEXT:          - VERSION_123# CHECK-NEXT:      - Flags:      324# CHECK-NEXT:        VersionNdx: 325# CHECK-NEXT:        Hash:       10838792226# CHECK-NEXT:        Names:27# CHECK-NEXT:          - VERSION_228# CHECK-NEXT:          - VERSION_329# CHECK-NEXT:          - VERSION_430# CHECK-NEXT:  - Name:31 32--- !ELF33FileHeader:34  Class: ELFCLASS6435  Data:  ELFDATA2LSB36  Type:  ET_DYN37Sections:38  - Name:            .gnu.version_d39    Type:            SHT_GNU_verdef40    Flags:           [ SHF_ALLOC ]41    Address:         0x23042    AddressAlign:    0x443    Info:            [[INFO=<none>]]44    Entries:45## An entry that has all fields explicitly set to their default values.46## Used to check that we don't dump them.47      - Version:    [[VERSION=1]]48        Flags:      049        VersionNdx: 050        Hash:       051        VDAux:      2052        Names:53          - VERSION_054## An entry with arbitrary values.55      - Flags:      256        VersionNdx: 257        Hash:       10838792158        VDAux:      [[VDAUX=20]]59        Names:60          - VERSION_161## Another entry with arbitrary values and version predecessors.62      - Flags:      363        VersionNdx: 364        Hash:       10838792265        Names:66          - VERSION_267          - VERSION_368          - VERSION_469## Needed to emit the .dynstr section.70DynamicSymbols: []71 72## Check we dump the `Info` field when its value is not equal73## to the number of version definitions.74 75# RUN: yaml2obj %s -DINFO=0x4 -o %t.info76# RUN: obj2yaml %t.info | FileCheck %s --check-prefixes=CHECK,INFO77 78## Document that we are not able to dump a version definition which79## has a version revision (vd_version) that is not equal to 1.80 81# RUN: yaml2obj %s -DVERSION=2 -o %t.version82# RUN: not obj2yaml %t.version 2>&1 | \83# RUN:   FileCheck %s -DFILE=%t.version --check-prefix=VERSION-ERR84 85# VERSION-ERR: Error reading file: [[FILE]]: invalid SHT_GNU_verdef section version: 286 87# RUN: yaml2obj %s -DVDAUX=100 -o %t.vdaux88# RUN: not obj2yaml %t.vdaux 2>&1 | \89# RUN:   FileCheck %s -DFILE=%t.vdaux --check-prefix=VDAUX-ERR90 91# VDAUX-ERR: Error reading file: [[FILE]]: corrupted section: vd_aux value 100 in section verdef points past end of the section92