diff options
author | Xing GUO <higuoxing@gmail.com> | 2020-05-29 19:56:32 +0800 |
---|---|---|
committer | Xing GUO <higuoxing@gmail.com> | 2020-05-29 20:11:53 +0800 |
commit | ea7db621d289022f0733eb63bb10a837936cbb38 (patch) | |
tree | 3d82ad4634a5de90014136296a41696863528b15 /llvm/test/ObjectYAML/MachO | |
parent | 20b2af3e5559e50d1b5279311c6e5034a2d1928d (diff) | |
download | llvm-ea7db621d289022f0733eb63bb10a837936cbb38.zip llvm-ea7db621d289022f0733eb63bb10a837936cbb38.tar.gz llvm-ea7db621d289022f0733eb63bb10a837936cbb38.tar.bz2 |
[ObjectYAML][DWARF] Make the `PubSection` optional.
This patch helps make the `PubSection` optional in the DWARF structure.
Reviewed By: jhenderson, aprantl
Differential Revision: https://reviews.llvm.org/D80722
Diffstat (limited to 'llvm/test/ObjectYAML/MachO')
-rw-r--r-- | llvm/test/ObjectYAML/MachO/DWARF-pubsections.yaml | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/llvm/test/ObjectYAML/MachO/DWARF-pubsections.yaml b/llvm/test/ObjectYAML/MachO/DWARF-pubsections.yaml index f2eadd2..4faac06 100644 --- a/llvm/test/ObjectYAML/MachO/DWARF-pubsections.yaml +++ b/llvm/test/ObjectYAML/MachO/DWARF-pubsections.yaml @@ -1,3 +1,9 @@ +## This file contains test cases for generating .debug_pubnames/.debug_pubtypes +## section in object files from the DWARF entry of Mach-O YAML inputs + +## a) Test that yaml2obj emits the .debug_pubnames and .debug_pubtypes sections and +## obj2yaml converts them back. + # RUN: yaml2obj %s | obj2yaml | FileCheck %s --- !mach-o @@ -345,3 +351,87 @@ DWARF: #CHECK: - DieOffset: 0x00000071 #CHECK: Name: char #CHECK: ... + +## b) Test that yaml2obj will not emit the .debug_pubnames/.debug_pubtypes section's +## contents, if the "debug_pubnames"/"debug_pubtypes" entry doesn't exist in the +## "DWARF" entry. + +# RUN: yaml2obj --docnum=2 %s | obj2yaml | FileCheck %s --check-prefix=EMPTY + +# EMPTY: Sections: +# EMPTY-NEXT: - sectname: __debug_pubnames +# EMPTY-NEXT: segname: __DWARF +# EMPTY-NEXT: addr: 0x0000000000000000 +# EMPTY-NEXT: size: 0 +# EMPTY-NEXT: offset: 0x00000000 +# EMPTY-NEXT: align: 0 +# EMPTY-NEXT: reloff: 0x00000000 +# EMPTY-NEXT: nreloc: 0 +# EMPTY-NEXT: flags: 0x00000000 +# EMPTY-NEXT: reserved1: 0x00000000 +# EMPTY-NEXT: reserved2: 0x00000000 +# EMPTY-NEXT: reserved3: 0x00000000 +# EMPTY-NEXT: content: '' +# EMPTY-NEXT: - sectname: __debug_pubtypes +# EMPTY-NEXT: segname: __DWARF +# EMPTY-NEXT: addr: 0x0000000000000000 +# EMPTY-NEXT: size: 0 +# EMPTY-NEXT: offset: 0x00000720 +# EMPTY-NEXT: align: 0 +# EMPTY-NEXT: reloff: 0x00000000 +# EMPTY-NEXT: nreloc: 0 +# EMPTY-NEXT: flags: 0x00000000 +# EMPTY-NEXT: reserved1: 0x00000000 +# EMPTY-NEXT: reserved2: 0x00000000 +# EMPTY-NEXT: reserved3: 0x00000000 +# EMPTY-NEXT: content: '' +# EMPTY-NEXT: ... + +--- !mach-o +FileHeader: + magic: 0xFEEDFACF + cputype: 0x01000007 + cpusubtype: 0x00000003 + filetype: 0x0000000A + ncmds: 1 + sizeofcmds: 1800 + flags: 0x00000000 + reserved: 0x00000000 +LoadCommands: + - cmd: LC_SEGMENT_64 + cmdsize: 232 + segname: __DWARF + vmaddr: 0x00000000 + vmsize: 0x00000000 + fileoff: 0 + filesize: 0 + maxprot: 0 + initprot: 0 + nsects: 2 + flags: 0 + Sections: + - sectname: __debug_pubnames + segname: __DWARF + addr: 0x0000000000000000 + size: 0 + offset: 0x00000000 + align: 0 + reloff: 0x00000000 + nreloc: 0 + flags: 0x00000000 + reserved1: 0x00000000 + reserved2: 0x00000000 + reserved3: 0x00000000 + - sectname: __debug_pubtypes + segname: __DWARF + addr: 0x0000000000000000 + size: 0 + offset: 0x00000720 + align: 0 + reloff: 0x00000000 + nreloc: 0 + flags: 0x00000000 + reserved1: 0x00000000 + reserved2: 0x00000000 + reserved3: 0x00000000 +DWARF: |