1 ## This is a generic test for SHT_REL/SHT_RELA sections.
3 ## Check that we do not print excessive default
4 ## fields for SHT_REL[A] sections.
5 # RUN: yaml2obj %s -o %t1
6 # RUN: obj2yaml %t1 | FileCheck %s --check-prefix=YAML
8 ## Note: it is important to have at least two sections with sh_info == 0.
9 ## Previously we printed a broken Info field in this case.
10 # YAML: - Name: .rela.dyn
11 # YAML-NEXT: Type: SHT_RELA
12 # YAML-NEXT: - Name: .rel.dyn
13 # YAML-NEXT: Type: SHT_REL
26 ## Trigger the .dynsym emission.
29 ## Test the behavior when the sh_entsize field is broken.
30 ## Here we use the 0xFE value instead of expected 0x18/0x10.
32 # RUN: yaml2obj -DTYPE=SHT_RELA --docnum=2 %s -o %t2.rela
33 # RUN: not obj2yaml %t2.rela 2>&1 | FileCheck %s --check-prefix=ERR1
34 # RUN: yaml2obj -DTYPE=SHT_REL --docnum=2 %s -o %t2.rel
35 # RUN: not obj2yaml %t2.rel 2>&1 | FileCheck %s --check-prefix=ERR2
37 # ERR1: section [index 1] has invalid sh_entsize: expected 24, but got 254
38 # ERR2: section [index 1] has invalid sh_entsize: expected 16, but got 254