Files
clang-p2996/llvm/test/tools/obj2yaml/ELF/invalid-section-name.yaml
James Henderson 5c1639fe06 [yaml2obj][obj2yaml] Support custom ELF section header string table name
This patch adds support for a new field in the FileHeader, which states
the name to use for the section header string table. This also allows
combining the string table with another string table in the object, e.g.
the symbol name string table. The field is optional. By default,
.shstrtab will continue to be used.

This partially fixes https://bugs.llvm.org/show_bug.cgi?id=50506.

Reviewed by: Higuoxing

Differential Revision: https://reviews.llvm.org/D104035
2021-06-16 10:02:23 +01:00

31 lines
843 B
YAML

## Check we do not crash/assert when dumping a broken section name.
## Here we replace the section name with a sequence of characters that
## are not representable as unsigned char.
## We used to assert for this case before.
# RUN: yaml2obj %s -o %t
# RUN: obj2yaml %t | FileCheck %s
# CHECK: --- !ELF
# CHECK-NEXT: FileHeader:
# CHECK-NEXT: Class: ELFCLASS64
# CHECK-NEXT: Data: ELFDATA2LSB
# CHECK-NEXT: Type: ET_REL
# CHECK-NEXT: SectionHeaderStringTable: {{.*}}
# CHECK-NEXT: Sections:
# CHECK-NEXT: - Name: "{{.*}}"
# CHECK-NEXT: Type: SHT_PROGBITS
# CHECK-NEXT: ...
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_REL
Sections:
- Name: foo
Type: SHT_PROGBITS
- Name: .shstrtab
Type: SHT_STRTAB
Content: "00FEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFEFE00"