CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
203 lines
6.0 KiB
YAML
203 lines
6.0 KiB
YAML
## Show that yaml2obj supports custom section data for Mach-O YAML inputs.
|
|
|
|
## Case 1: The size of content is greater than the section size.
|
|
# RUN: not yaml2obj --docnum=1 %s -o %t1 2>&1 | FileCheck %s --check-prefix=CASE1
|
|
# CASE1: error: Section size must be greater than or equal to the content size
|
|
|
|
--- !mach-o
|
|
FileHeader:
|
|
magic: 0xFEEDFACF
|
|
cputype: 0x01000007
|
|
cpusubtype: 0x00000003
|
|
filetype: 0x00000001
|
|
ncmds: 1
|
|
sizeofcmds: 232
|
|
flags: 0x00002000
|
|
reserved: 0x00000000
|
|
LoadCommands:
|
|
- cmd: LC_SEGMENT_64
|
|
cmdsize: 232
|
|
segname: ''
|
|
vmaddr: 0
|
|
vmsize: 4
|
|
fileoff: 392
|
|
filesize: 4
|
|
maxprot: 7
|
|
initprot: 7
|
|
nsects: 1
|
|
flags: 0
|
|
Sections:
|
|
- sectname: __data
|
|
segname: __DATA
|
|
addr: 0x0000000000000000
|
|
size: 0
|
|
offset: 0x00000188
|
|
align: 2
|
|
reloff: 0x00000000
|
|
nreloc: 0
|
|
flags: 0x00000000
|
|
reserved1: 0x00000000
|
|
reserved2: 0x00000000
|
|
reserved3: 0x00000000
|
|
content: CDAB3412
|
|
|
|
## Case 2: The content size equals the section size.
|
|
# RUN: yaml2obj --docnum=2 %s -o %t2
|
|
# RUN: llvm-readobj --sections --section-data %t2 | FileCheck %s --check-prefix=CASE2
|
|
# CASE2: Index: 0
|
|
# CASE2-NEXT: Name: __data (5F 5F 64 61 74 61 00 00 00 00 00 00 00 00 00 00)
|
|
# CASE2-NEXT: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
|
|
# CASE2-NEXT: Address: 0x0
|
|
# CASE2-NEXT: Size: 0x4
|
|
# CASE2-NEXT: Offset: 392
|
|
# CASE2-NEXT: Alignment: 2
|
|
# CASE2-NEXT: RelocationOffset: 0x0
|
|
# CASE2-NEXT: RelocationCount: 0
|
|
# CASE2-NEXT: Type: Regular (0x0)
|
|
# CASE2-NEXT: Attributes [ (0x0)
|
|
# CASE2-NEXT: ]
|
|
# CASE2-NEXT: Reserved1: 0x0
|
|
# CASE2-NEXT: Reserved2: 0x0
|
|
# CASE2-NEXT: Reserved3: 0x0
|
|
# CASE2-NEXT: SectionData (
|
|
# CASE2-NEXT: 0000: CDAB3412 |..4.|
|
|
# CASE2-NEXT: )
|
|
|
|
--- !mach-o
|
|
FileHeader:
|
|
magic: 0xFEEDFACF
|
|
cputype: 0x01000007
|
|
cpusubtype: 0x00000003
|
|
filetype: 0x00000001
|
|
ncmds: 1
|
|
sizeofcmds: 232
|
|
flags: 0x00002000
|
|
reserved: 0x00000000
|
|
LoadCommands:
|
|
- cmd: LC_SEGMENT_64
|
|
cmdsize: 232
|
|
segname: ''
|
|
vmaddr: 0
|
|
vmsize: 4
|
|
fileoff: 392
|
|
filesize: 4
|
|
maxprot: 7
|
|
initprot: 7
|
|
nsects: 1
|
|
flags: 0
|
|
Sections:
|
|
- sectname: __data
|
|
segname: __DATA
|
|
addr: 0x0000000000000000
|
|
size: 4
|
|
offset: 0x00000188
|
|
align: 2
|
|
reloff: 0x00000000
|
|
nreloc: 0
|
|
flags: 0x00000000
|
|
reserved1: 0x00000000
|
|
reserved2: 0x00000000
|
|
reserved3: 0x00000000
|
|
content: CDAB3412
|
|
|
|
## Case 3: The content size is less than the section size. In this case, the area
|
|
## after the custom content is filled with zeroes.
|
|
# RUN: yaml2obj --docnum=3 %s -o %t3
|
|
# RUN: llvm-readobj --sections --section-data %t3 | FileCheck %s --check-prefix=CASE3
|
|
# CASE3: Index: 0
|
|
# CASE3-NEXT: Name: __data (5F 5F 64 61 74 61 00 00 00 00 00 00 00 00 00 00)
|
|
# CASE3-NEXT: Segment: __DATA (5F 5F 44 41 54 41 00 00 00 00 00 00 00 00 00 00)
|
|
# CASE3-NEXT: Address: 0x0
|
|
# CASE3-NEXT: Size: 0x4
|
|
# CASE3-NEXT: Offset: 392
|
|
# CASE3-NEXT: Alignment: 2
|
|
# CASE3-NEXT: RelocationOffset: 0x0
|
|
# CASE3-NEXT: RelocationCount: 0
|
|
# CASE3-NEXT: Type: Regular (0x0)
|
|
# CASE3-NEXT: Attributes [ (0x0)
|
|
# CASE3-NEXT: ]
|
|
# CASE3-NEXT: Reserved1: 0x0
|
|
# CASE3-NEXT: Reserved2: 0x0
|
|
# CASE3-NEXT: Reserved3: 0x0
|
|
# CASE3-NEXT: SectionData (
|
|
# CASE3-NEXT: 0000: AA000000 |....|
|
|
# CASE3-NEXT: )
|
|
|
|
--- !mach-o
|
|
FileHeader:
|
|
magic: 0xFEEDFACF
|
|
cputype: 0x01000007
|
|
cpusubtype: 0x00000003
|
|
filetype: 0x00000001
|
|
ncmds: 1
|
|
sizeofcmds: 232
|
|
flags: 0x00002000
|
|
reserved: 0x00000000
|
|
LoadCommands:
|
|
- cmd: LC_SEGMENT_64
|
|
cmdsize: 232
|
|
segname: ''
|
|
vmaddr: 0
|
|
vmsize: 4
|
|
fileoff: 392
|
|
filesize: 4
|
|
maxprot: 7
|
|
initprot: 7
|
|
nsects: 1
|
|
flags: 0
|
|
Sections:
|
|
- sectname: __data
|
|
segname: __DATA
|
|
addr: 0x0000000000000000
|
|
size: 4
|
|
offset: 0x00000188
|
|
align: 2
|
|
reloff: 0x00000000
|
|
nreloc: 0
|
|
flags: 0x00000000
|
|
reserved1: 0x00000000
|
|
reserved2: 0x00000000
|
|
reserved3: 0x00000000
|
|
content: AA
|
|
|
|
## Case 4: Don't validate if size is missing.
|
|
# RUN: not yaml2obj --docnum=4 %s -o %t1 2>&1 | FileCheck %s --check-prefix=CASE4 --implicit-check-not=error:
|
|
# CASE4: error: missing required key 'size'
|
|
# CASE4: error: failed to parse YAML
|
|
|
|
--- !mach-o
|
|
FileHeader:
|
|
magic: 0xFEEDFACF
|
|
cputype: 0x01000007
|
|
cpusubtype: 0x00000003
|
|
filetype: 0x00000001
|
|
ncmds: 1
|
|
sizeofcmds: 232
|
|
flags: 0x00002000
|
|
reserved: 0x00000000
|
|
LoadCommands:
|
|
- cmd: LC_SEGMENT_64
|
|
cmdsize: 232
|
|
segname: ''
|
|
vmaddr: 0
|
|
vmsize: 4
|
|
fileoff: 392
|
|
filesize: 4
|
|
maxprot: 7
|
|
initprot: 7
|
|
nsects: 1
|
|
flags: 0
|
|
Sections:
|
|
- sectname: __data
|
|
segname: __DATA
|
|
addr: 0x0000000000000000
|
|
content: AA
|
|
offset: 0x00000188
|
|
align: 2
|
|
reloff: 0x00000000
|
|
nreloc: 0
|
|
flags: 0x00000000
|
|
reserved1: 0x00000000
|
|
reserved2: 0x00000000
|
|
reserved3: 0x00000000
|