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
101 lines
3.5 KiB
Plaintext
101 lines
3.5 KiB
Plaintext
## This test checks the functionality of options --skip-symbol and --skip-symbols.
|
|
# RUN: yaml2obj %s -o %t.o
|
|
# RUN: echo 'foo[2-3]' > %t.skip.regex
|
|
|
|
## Check --skip-symbol functionality when changing symbol bindings.
|
|
# RUN: llvm-objcopy %t.o %t2.o --localize-hidden --skip-symbol=foo3
|
|
# RUN: llvm-readelf -s %t2.o | FileCheck %s --check-prefix=LH-SYM
|
|
# LH-SYM-DAG: LOCAL HIDDEN 1 foo1
|
|
# LH-SYM-DAG: LOCAL HIDDEN 1 foo2
|
|
# LH-SYM-DAG: GLOBAL HIDDEN 1 foo3
|
|
# LH-SYM-DAG: LOCAL HIDDEN 1 foo4
|
|
# LH-SYM-DAG: LOCAL HIDDEN 1 foo5
|
|
|
|
## Check --skip-symbols functionality when changing symbol bindings.
|
|
# RUN: llvm-objcopy %t.o %t1.o --localize-hidden --skip-symbols=%t.skip.regex --regex
|
|
# RUN: llvm-readelf -s %t1.o | FileCheck %s --check-prefix=LH-SYMS
|
|
# LH-SYMS-DAG: LOCAL HIDDEN 1 foo1
|
|
# LH-SYMS-DAG: GLOBAL HIDDEN 1 foo2
|
|
# LH-SYMS-DAG: GLOBAL HIDDEN 1 foo3
|
|
# LH-SYMS-DAG: LOCAL HIDDEN 1 foo4
|
|
# LH-SYMS-DAG: LOCAL HIDDEN 1 foo5
|
|
|
|
## Check --skip-symbol functionality when changing symbol names.
|
|
# RUN: echo -e "foo1 bar1\nfoo2 bar2" > %t.renames.list
|
|
# RUN: llvm-objcopy %t.o %t4.o --redefine-syms=%t.renames.list \
|
|
# RUN: --skip-symbol='fo*' --wildcard
|
|
# RUN: llvm-readelf -s %t4.o | FileCheck %s --check-prefix=RS-SYM
|
|
# RS-SYM-DAG: foo1
|
|
# RS-SYM-DAG: foo2
|
|
# RS-SYM-DAG: foo3
|
|
# RS-SYM-DAG: foo4
|
|
# RS-SYM-DAG: foo5
|
|
|
|
## Check --skip-symbols functionality when changing symbol names.
|
|
# RUN: llvm-objcopy %t.o %t3.o --redefine-syms=%t.renames.list \
|
|
# RUN: --skip-symbols=%t.skip.regex --regex
|
|
# RUN: llvm-readelf -s %t3.o | FileCheck %s --check-prefix=RS-SYMS
|
|
# RS-SYMS-DAG: bar1
|
|
# RS-SYMS-DAG: foo2
|
|
# RS-SYMS-DAG: foo3
|
|
# RS-SYMS-DAG: foo4
|
|
# RS-SYMS-DAG: foo5
|
|
|
|
## Check the functionality when using skip options multiple times.
|
|
# RUN: echo "foo3" > %t.symbol0.list
|
|
# RUN: echo "foo4" > %t.symbol1.list
|
|
# RUN: llvm-objcopy %t.o %t5.o --set-symbol-visibility='foo*'=internal --wildcard \
|
|
# RUN: --skip-symbol=foo1 --skip-symbol=foo2 \
|
|
# RUN: --skip-symbols=%t.symbol0.list --skip-symbols=%t.symbol1.list
|
|
# RUN: llvm-readelf -s %t5.o | FileCheck %s --check-prefix=BOTH
|
|
# BOTH-DAG: GLOBAL HIDDEN 1 foo1
|
|
# BOTH-DAG: GLOBAL HIDDEN 1 foo2
|
|
# BOTH-DAG: GLOBAL HIDDEN 1 foo3
|
|
# BOTH-DAG: GLOBAL HIDDEN 1 foo4
|
|
## Only foo5 is not skipped.
|
|
# BOTH-DAG: GLOBAL INTERNAL 1 foo5
|
|
|
|
## Check that using an invalid symbol name regex generates an error.
|
|
# RUN: echo '*.' > %t.symbols.regex
|
|
# RUN: not llvm-objcopy %t.o --skip-symbols=%t.symbols.regex --regex 2>&1 | \
|
|
# RUN: FileCheck %s --check-prefix=SYMBOL
|
|
# RUN: not llvm-objcopy %t.o --skip-symbol='*.' --regex 2>&1 | \
|
|
# RUN: FileCheck %s --check-prefix=SYMBOL
|
|
# SYMBOL: error: cannot compile regular expression '*.': repetition-operator operand invalid
|
|
|
|
## Check passing an invalid filename generates an error.
|
|
# RUN: not llvm-objcopy %t.o --skip-symbols=no_file 2>&1 | \
|
|
# RUN: FileCheck %s --check-prefix=FILE -DMSG=%errc_ENOENT
|
|
# FILE: error: 'no_file': [[MSG]]
|
|
|
|
!ELF
|
|
FileHeader:
|
|
Class: ELFCLASS64
|
|
Data: ELFDATA2LSB
|
|
Type: ET_REL
|
|
Machine: EM_X86_64
|
|
Sections:
|
|
- Name: .text
|
|
Type: SHT_PROGBITS
|
|
Symbols:
|
|
- Name: foo1
|
|
Section: .text
|
|
Binding: STB_GLOBAL
|
|
Other: [ STV_HIDDEN ]
|
|
- Name: foo2
|
|
Section: .text
|
|
Binding: STB_GLOBAL
|
|
Other: [ STV_HIDDEN ]
|
|
- Name: foo3
|
|
Section: .text
|
|
Binding: STB_GLOBAL
|
|
Other: [ STV_HIDDEN ]
|
|
- Name: foo4
|
|
Section: .text
|
|
Binding: STB_GLOBAL
|
|
Other: [ STV_HIDDEN ]
|
|
- Name: foo5
|
|
Section: .text
|
|
Binding: STB_GLOBAL
|
|
Other: [ STV_HIDDEN ]
|