Files
TheRock/compiler/amd-llvm/lld/test/ELF/wrap-drop-shared-original.s
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

49 lines
1.9 KiB
ArmAsm

## If the original of a wrapped symbol becomes unreferenced after wrapping, it
## should be dropped from the dynamic symbol table even if defined in a shared
## library.
# REQUIRES: x86
# RUN: rm -rf %t && split-file %s %t
# RUN: llvm-mc -filetype=obj -triple=x86_64-elf %t/original.s -o %t/original.o
# RUN: llvm-mc -filetype=obj -triple=x86_64-elf %t/wrapped.s -o %t/wrapped.o
# RUN: llvm-mc -filetype=obj -triple=x86_64-elf %t/ref.s -o %t/ref.o
# RUN: ld.lld -shared -o %t/liboriginal.so -soname liboriginal.so %t/original.o
# RUN: ld.lld -shared -o %t/liboriginal-and-wrapped.so \
# RUN: -soname liboriginal-and-wrapped.so %t/original.o %t/wrapped.o
# RUN: ld.lld -shared -o %t/libref-with-original.so %t/ref.o \
# RUN: --as-needed %t/liboriginal.so --wrap foo
# RUN: llvm-readelf --dynamic --dyn-syms %t/libref-with-original.so | \
# RUN: FileCheck --check-prefix=ORIGINAL %s
# RUN: ld.lld -shared -o %t/libref-with-original-and-wrapped.so %t/ref.o \
# RUN: --as-needed %t/liboriginal-and-wrapped.so --wrap foo
# RUN: llvm-readelf --dynamic --dyn-syms %t/libref-with-original-and-wrapped.so | \
# RUN: FileCheck --check-prefix=ORIGINAL-AND-WRAPPED %s
# ORIGINAL-NOT: (NEEDED) Shared library: [liboriginal.so]
# ORIGINAL: Symbol table '.dynsym' contains 3 entries:
# ORIGINAL: NOTYPE LOCAL DEFAULT UND
# ORIGINAL-NEXT: NOTYPE GLOBAL DEFAULT UND __wrap_foo
# ORIGINAL-NEXT: NOTYPE GLOBAL DEFAULT 6 ref
# ORIGINAL-AND-WRAPPED: (NEEDED) Shared library: [liboriginal-and-wrapped.so]
# ORIGINAL-AND-WRAPPED: Symbol table '.dynsym' contains 3 entries:
# ORIGINAL-AND-WRAPPED: NOTYPE LOCAL DEFAULT UND
# ORIGINAL-AND-WRAPPED-NEXT: NOTYPE GLOBAL DEFAULT UND __wrap_foo
# ORIGINAL-AND-WRAPPED-NEXT: NOTYPE GLOBAL DEFAULT 6 ref
#--- original.s
.globl foo
foo:
retq
#--- wrapped.s
.globl __wrap_foo
__wrap_foo:
retq
#--- ref.s
.globl ref
ref:
jmp foo@plt