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
90 lines
3.6 KiB
ArmAsm
90 lines
3.6 KiB
ArmAsm
# REQUIRES: x86
|
|
# RUN: rm -rf %t; split-file %s %t
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/foo.o %t/foo.s
|
|
# RUN: %lld -dylib -o %t/foo.dylib %t/foo.o
|
|
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/main.o %t/main.s
|
|
|
|
# _foo starts out as a (non-weak) dynamically looked up symbol and is merged
|
|
# against the Undefined from foo.o. _bar isn't referenced in any object file,
|
|
# but starts out as Undefined because of the -u flag. _baz isn't referenced
|
|
# at all.
|
|
# RUN: %lld -lSystem %t/main.o -U _foo -U _bar -u _bar -U _baz -o %t/out
|
|
# RUN: llvm-objdump --macho --lazy-bind %t/out | FileCheck --check-prefix=DYNAMIC %s
|
|
# RUN: llvm-nm -m %t/out | FileCheck --check-prefix=DYNAMICSYM %s
|
|
|
|
# Same thing should happen if _foo starts out as an Undefined.
|
|
# `-U _foo` being passed twice shouldn't have an effect either.
|
|
# RUN: %lld -lSystem %t/main.o -u _foo -U _foo -U _foo -u _bar -U _bar -U _baz -o %t/out
|
|
# RUN: llvm-objdump --macho --lazy-bind %t/out | FileCheck --check-prefix=DYNAMIC %s
|
|
# RUN: llvm-nm -m %t/out | FileCheck --check-prefix=DYNAMICSYM %s
|
|
|
|
# Unreferenced dynamic lookup symbols don't make it into the bind tables, but
|
|
# they do make it into the symbol table in ld64 if they're an undefined from -u
|
|
# for some reason. lld happens to have the same behavior when no explicit code
|
|
# handles this case, so match ld64's behavior.
|
|
|
|
# DYNAMIC-NOT: _bar
|
|
# DYNAMIC-NOT: _baz
|
|
# DYNAMIC: flat-namespace _foo
|
|
|
|
# DYNAMICSYM: (undefined) external _bar (dynamically looked up)
|
|
# DYNAMICSYM-NOT: (undefined) external _bar (dynamically looked up)
|
|
# DYNAMICSYM-NEXT: (undefined) external _foo (dynamically looked up)
|
|
|
|
# Test with a Defined. Here, foo.o provides _foo and the symbol doesn't need
|
|
# to be imported.
|
|
# RUN: %lld -lSystem %t/main.o %t/foo.o -U _foo -o %t/out
|
|
# RUN: llvm-objdump --macho --lazy-bind %t/out | FileCheck --check-prefix=NOTDYNAMIC %s
|
|
|
|
# NOTDYNAMIC-NOT: _foo
|
|
|
|
# Here, foo.dylib provides _foo and the symbol doesn't need to be imported
|
|
# dynamically.
|
|
# RUN: %lld -lSystem %t/main.o %t/foo.dylib -U _foo -o %t/out
|
|
# RUN: llvm-objdump --macho --lazy-bind %t/out | FileCheck --check-prefix=TWOLEVEL %s
|
|
# RUN: llvm-nm -m %t/out | FileCheck --check-prefix=TWOLEVELSYM %s
|
|
|
|
# TWOLEVEL: foo _foo
|
|
# TWOLEVELSYM: (undefined) external _foo (from foo)
|
|
|
|
# Test resolving dynamic lookup symbol with weak defined.
|
|
# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos -o %t/weak-foo.o %t/weak-foo.s
|
|
# RUN: %lld -dylib -o %t/weak-foo.dylib %t/weak-foo.o -U _foo
|
|
# RUN: llvm-objdump --macho --bind --lazy-bind --weak-bind %t/weak-foo.dylib | FileCheck --check-prefix=WEAKDEF %s
|
|
# RUN: llvm-nm -m %t/weak-foo.dylib | FileCheck --check-prefix=WEAKDEFSYM %s
|
|
# WEAKDEF-NOT: _foo
|
|
# WEAKDEFSYM: weak external _foo
|
|
|
|
# Same if foo.dylib provides _foo weakly, except that the symbol is weak then.
|
|
# RUN: %lld -lSystem %t/main.o %t/weak-foo.dylib -U _foo -o %t/out
|
|
# RUN: llvm-objdump --macho --bind --lazy-bind --weak-bind %t/out | FileCheck --check-prefix=TWOLEVELWEAK %s
|
|
# RUN: llvm-nm -m %t/out | FileCheck --check-prefix=TWOLEVELWEAKSYM %s
|
|
|
|
# TWOLEVELWEAK-LABEL: Bind table:
|
|
# TWOLEVELWEAK: __DATA __la_symbol_ptr 0x[[#%x,ADDR:]] pointer 0 weak-foo _foo
|
|
# TWOLEVELWEAK-LABEL: Lazy bind table:
|
|
# TWOLEVELWEAK-NOT: weak-foo _foo
|
|
# TWOLEVELWEAK-LABEL: Weak bind table:
|
|
# TWOLEVELWEAK: __DATA __la_symbol_ptr 0x[[#ADDR]] pointer 0 _foo
|
|
|
|
# TWOLEVELWEAKSYM: (undefined) weak external _foo (from weak-foo)
|
|
|
|
#--- foo.s
|
|
.globl _foo
|
|
_foo:
|
|
ret
|
|
|
|
#--- weak-foo.s
|
|
.globl _foo
|
|
.weak_definition _foo
|
|
_foo:
|
|
ret
|
|
|
|
#--- main.s
|
|
.globl _main
|
|
_main:
|
|
callq _foo
|
|
ret
|