Files
TheRock/compiler/amd-llvm/llvm/test/tools/llvm-gsymutil/X86/elf-symtab-file.yaml
T
derek.holloway 7502bf64a4
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
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

151 lines
4.7 KiB
YAML

## Test the --symtab-file option to specify a separate file for the symbol table.
## We create two ELF files: one with DWARF debug info (but no function symbols)
## and one with function symbols (but no DWARF). Then we use --symtab-file to
## combine them during GSYM conversion.
# RUN: split-file %s %t
## Create the debug-only and symtab-only ELF files.
# RUN: yaml2obj %t/debug.yaml -o %t/debug.elf
# RUN: yaml2obj %t/symtab.yaml -o %t/symtab.elf
## Test 1: Basic --symtab-file usage.
# RUN: llvm-gsymutil --convert %t/debug.elf --symtab-file=%t/symtab.elf -o %t/out.gsym 2>&1 | FileCheck %s --check-prefix=BASIC
# BASIC: Input file: {{.*}}debug.elf
# BASIC: Output file (x86_64): {{.*}}out.gsym
# BASIC: Using symbol table file: {{.*}}symtab.elf
# BASIC: Loaded 2 functions from symbol table.
## Test 2: Architecture mismatch error.
# RUN: yaml2obj %t/aarch64-symtab.yaml -o %t/aarch64-symtab.elf
# RUN: not llvm-gsymutil --convert %t/debug.elf --symtab-file=%t/aarch64-symtab.elf -o %t/mismatch.gsym 2>&1 | FileCheck %s --check-prefix=MISMATCH
# MISMATCH: architecture mismatch: input file is x86_64 but symbol table file '{{.*}}aarch64-symtab.elf' is aarch64
## Test 3: Invalid symtab file error.
# RUN: not llvm-gsymutil --convert %t/debug.elf --symtab-file=%t/debug.yaml -o %t/invalid.gsym 2>&1 | FileCheck %s --check-prefix=INVALID
# INVALID: The file was not recognized as a valid object file
#--- debug.yaml
## An x86_64 ELF with DWARF debug info for one function (main) but no function
## symbols in the symbol table.
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_EXEC
Machine: EM_X86_64
Entry: 0x0000000000401000
Sections:
- Name: .text
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
Address: 0x0000000000401000
AddressAlign: 0x10
## Simple function: push rbp; mov rbp,rsp; xor eax,eax; pop rbp; ret
Content: 554889E531C05DC3
- Name: .debug_abbrev
Type: SHT_PROGBITS
AddressAlign: 0x1
## Abbrev 1: DW_TAG_compile_unit (DW_CHILDREN_yes)
## DW_AT_low_pc (DW_FORM_addr), DW_AT_high_pc (DW_FORM_data4),
## DW_AT_name (DW_FORM_strp)
## Abbrev 2: DW_TAG_subprogram (DW_CHILDREN_no)
## DW_AT_low_pc (DW_FORM_addr), DW_AT_high_pc (DW_FORM_data4),
## DW_AT_name (DW_FORM_strp)
Content: 01110100110112060000023F19030E3A0B3B0B491311011207401897421901130000022E003F19030E110112070000022E00110112060003080000
- Name: .debug_info
Type: SHT_PROGBITS
AddressAlign: 0x1
## Compile unit header + DIEs referencing .debug_abbrev and .debug_str
Content: 2900000004000000000008010010400000000000080000000000000002001040000000000008000000050000
- Name: .debug_str
Type: SHT_PROGBITS
Flags: [ SHF_MERGE, SHF_STRINGS ]
AddressAlign: 0x1
EntSize: 0x1
## "test.cpp\0main\0"
Content: 746573742E63707000006D61696E00
- Name: .debug_line
Type: SHT_PROGBITS
AddressAlign: 0x1
Content: 3300000002001F0000000101FB0E0D000101010100000001000001007465737400746573742E637070000000000000090200104000000000000105030A0101
ProgramHeaders:
- Type: PT_LOAD
Flags: [ PF_X, PF_R ]
VAddr: 0x0000000000400000
Align: 0x1000
FirstSec: .text
LastSec: .text
Symbols: []
...
#--- symtab.yaml
## An x86_64 ELF with function symbols but no DWARF debug info.
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_EXEC
Machine: EM_X86_64
Entry: 0x0000000000401000
Sections:
- Name: .text
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
Address: 0x0000000000401000
AddressAlign: 0x10
Content: 554889E531C05DC3
ProgramHeaders:
- Type: PT_LOAD
Flags: [ PF_X, PF_R ]
VAddr: 0x0000000000400000
Align: 0x1000
FirstSec: .text
LastSec: .text
Symbols:
- Name: main
Type: STT_FUNC
Section: .text
Binding: STB_GLOBAL
Value: 0x0000000000401000
Size: 0x0000000000000008
- Name: _start
Type: STT_FUNC
Section: .text
Binding: STB_GLOBAL
Value: 0x0000000000401000
Size: 0x0000000000000008
...
#--- aarch64-symtab.yaml
## An AArch64 ELF to test architecture mismatch.
--- !ELF
FileHeader:
Class: ELFCLASS64
Data: ELFDATA2LSB
Type: ET_EXEC
Machine: EM_AARCH64
Entry: 0x0000000000401000
Sections:
- Name: .text
Type: SHT_PROGBITS
Flags: [ SHF_ALLOC, SHF_EXECINSTR ]
Address: 0x0000000000401000
AddressAlign: 0x10
Content: C0035FD6
ProgramHeaders:
- Type: PT_LOAD
Flags: [ PF_X, PF_R ]
VAddr: 0x0000000000400000
Align: 0x1000
FirstSec: .text
LastSec: .text
Symbols:
- Name: main
Type: STT_FUNC
Section: .text
Binding: STB_GLOBAL
Value: 0x0000000000401000
Size: 0x0000000000000004
...