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
132 lines
5.6 KiB
Plaintext
132 lines
5.6 KiB
Plaintext
## In this test we test how llvm-readelf prints file headers.
|
|
|
|
## Case 1: Test EM_386 object.
|
|
# RUN: yaml2obj %s --docnum=1 -o %t1
|
|
# RUN: llvm-readelf -h %t1 | FileCheck %s --check-prefix=I386
|
|
# RUN: llvm-readelf --file-header %t1 \
|
|
# RUN: | FileCheck %s --strict-whitespace --match-full-lines --check-prefix=I386
|
|
# RUN: llvm-readelf --file-headers %t1 \
|
|
# RUN: | FileCheck %s --strict-whitespace --match-full-lines --check-prefix=I386
|
|
|
|
# I386:ELF Header:
|
|
# I386-NEXT: Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
|
|
# I386-NEXT: Class: ELF32
|
|
# I386-NEXT: Data: 2's complement, little endian
|
|
# I386-NEXT: Version: 1 (current)
|
|
# I386-NEXT: OS/ABI: UNIX - System V
|
|
# I386-NEXT: ABI Version: 0
|
|
# I386-NEXT: Type: REL (Relocatable file)
|
|
# I386-NEXT: Machine: Intel 80386
|
|
# I386-NEXT: Version: 0x1
|
|
# I386-NEXT: Entry point address: 0x11223344
|
|
# I386-NEXT: Start of program headers: 52 (bytes into file)
|
|
# I386-NEXT: Start of section headers: 112 (bytes into file)
|
|
# I386-NEXT: Flags: 0x0
|
|
# I386-NEXT: Size of this header: 52 (bytes)
|
|
# I386-NEXT: Size of program headers: 32 (bytes)
|
|
# I386-NEXT: Number of program headers: 1
|
|
# I386-NEXT: Size of section headers: 40 (bytes)
|
|
# I386-NEXT: Number of section headers: 4
|
|
# I386-NEXT: Section header string table index: 3
|
|
|
|
--- !ELF
|
|
FileHeader:
|
|
Class: ELFCLASS32
|
|
Data: ELFDATA2LSB
|
|
Type: ET_REL
|
|
Machine: EM_386
|
|
Entry: 0x11223344
|
|
Sections:
|
|
- Name: .foo
|
|
Type: SHT_PROGBITS
|
|
ProgramHeaders:
|
|
- Type: PT_LOAD
|
|
Flags: [ PF_R ]
|
|
|
|
## Case 2: Test EM_X86_64 object.
|
|
# RUN: yaml2obj %s --docnum=2 -o %t2
|
|
# RUN: llvm-readelf -h %t2 | FileCheck %s --check-prefix=X86-64
|
|
# RUN: llvm-readelf --file-header %t2 \
|
|
# RUN: | FileCheck %s --check-prefix=X86-64 --strict-whitespace --match-full-lines
|
|
# RUN: llvm-readelf --file-headers %t2 \
|
|
# RUN: | FileCheck %s --check-prefix=X86-64 --strict-whitespace --match-full-lines
|
|
|
|
# X86-64:ELF Header:
|
|
# X86-64-NEXT: Magic: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00
|
|
# X86-64-NEXT: Class: ELF64
|
|
# X86-64-NEXT: Data: 2's complement, little endian
|
|
# X86-64-NEXT: Version: 1 (current)
|
|
# X86-64-NEXT: OS/ABI: UNIX - System V
|
|
# X86-64-NEXT: ABI Version: 0
|
|
# X86-64-NEXT: Type: REL (Relocatable file)
|
|
# X86-64-NEXT: Machine: Advanced Micro Devices X86-64
|
|
# X86-64-NEXT: Version: 0x1
|
|
# X86-64-NEXT: Entry point address: 0x1122334455667788
|
|
# X86-64-NEXT: Start of program headers: 64 (bytes into file)
|
|
# X86-64-NEXT: Start of section headers: 152 (bytes into file)
|
|
# X86-64-NEXT: Flags: 0x0
|
|
# X86-64-NEXT: Size of this header: 64 (bytes)
|
|
# X86-64-NEXT: Size of program headers: 56 (bytes)
|
|
# X86-64-NEXT: Number of program headers: 1
|
|
# X86-64-NEXT: Size of section headers: 64 (bytes)
|
|
# X86-64-NEXT: Number of section headers: 4
|
|
# X86-64-NEXT: Section header string table index: 3
|
|
|
|
--- !ELF
|
|
FileHeader:
|
|
Class: ELFCLASS64
|
|
Data: ELFDATA2LSB
|
|
Type: ET_REL
|
|
Machine: EM_X86_64
|
|
Entry: 0x1122334455667788
|
|
Sections:
|
|
- Name: .foo
|
|
Type: SHT_PROGBITS
|
|
ProgramHeaders:
|
|
- Type: PT_LOAD
|
|
Flags: [ PF_R ]
|
|
|
|
## Case 3: Use an arbitrary machine type that allows to show how we print Flags.
|
|
## Here we use an EM_MIPS object for that.
|
|
# RUN: yaml2obj %s --docnum=3 -o %t3
|
|
# RUN: llvm-readelf -h %t3 | FileCheck %s --check-prefix=MIPSEL
|
|
# RUN: llvm-readelf --file-header %t3 \
|
|
# RUN: | FileCheck %s --check-prefix=MIPSEL --strict-whitespace --match-full-lines
|
|
# RUN: llvm-readelf --file-headers %t3 \
|
|
# RUN: | FileCheck %s --check-prefix=MIPSEL --strict-whitespace --match-full-lines
|
|
|
|
# MIPSEL:ELF Header:
|
|
# MIPSEL-NEXT: Magic: 7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00
|
|
# MIPSEL-NEXT: Class: ELF32
|
|
# MIPSEL-NEXT: Data: 2's complement, little endian
|
|
# MIPSEL-NEXT: Version: 1 (current)
|
|
# MIPSEL-NEXT: OS/ABI: UNIX - System V
|
|
# MIPSEL-NEXT: ABI Version: 0
|
|
# MIPSEL-NEXT: Type: REL (Relocatable file)
|
|
# MIPSEL-NEXT: Machine: MIPS R3000
|
|
# MIPSEL-NEXT: Version: 0x1
|
|
# MIPSEL-NEXT: Entry point address: 0x0
|
|
# MIPSEL-NEXT: Start of program headers: 52 (bytes into file)
|
|
# MIPSEL-NEXT: Start of section headers: 112 (bytes into file)
|
|
# MIPSEL-NEXT: Flags: 0x50001000, o32, mips32
|
|
# MIPSEL-NEXT: Size of this header: 52 (bytes)
|
|
# MIPSEL-NEXT: Size of program headers: 32 (bytes)
|
|
# MIPSEL-NEXT: Number of program headers: 1
|
|
# MIPSEL-NEXT: Size of section headers: 40 (bytes)
|
|
# MIPSEL-NEXT: Number of section headers: 4
|
|
# MIPSEL-NEXT: Section header string table index: 3
|
|
|
|
--- !ELF
|
|
FileHeader:
|
|
Class: ELFCLASS32
|
|
Data: ELFDATA2LSB
|
|
Type: ET_REL
|
|
Machine: EM_MIPS
|
|
Flags: [ EF_MIPS_ARCH_32, EF_MIPS_ABI_O32 ]
|
|
Sections:
|
|
- Name: .foo
|
|
Type: SHT_PROGBITS
|
|
ProgramHeaders:
|
|
- Type: PT_LOAD
|
|
Flags: [ PF_R ]
|