brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.3 KiB · 5c34318 Raw
41 lines · plain
1# REQUIRES: x862 3# RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos %s -o %t.o4# RUN: %lld -dylib %t.o -o %t.dylib -lSystem5 6# RUN: llvm-objdump --macho --bind --weak-bind %t.dylib | FileCheck %s7# CHECK-NOT: __got8# CHECK-NOT: __la_symbol_ptr9 10# RUN: llvm-objdump --macho --private-header %t.dylib | \11# RUN:     FileCheck --check-prefix=HEADERS %s12# HEADERS-NOT: WEAK_DEFINES13# HEADERS-NOT: BINDS_TO_WEAK14 15## Check that N_WEAK_DEF isn't set in the symbol table.16## This is different from ld64, which makes private extern weak symbols non-weak17## for binds and relocations, but it still marks them as weak in the symbol table.18## Since `nm -m` doesn't look at N_WEAK_DEF for N_PEXT symbols this is not19## observable via nm, but it feels slightly more correct.20## (It is observable in `llvm-objdump --syms` output.)21# RUN: llvm-readobj --syms %t.dylib | FileCheck --check-prefix=SYMS %s22# SYMS-NOT: WeakDef (0x80)23 24.globl _use25_use:26  mov _weak_private_extern_gotpcrel@GOTPCREL(%rip), %rax27  callq _weak_private_extern28  retq29 30.private_extern _weak_private_extern31.globl _weak_private_extern32.weak_definition _weak_private_extern33_weak_private_extern:34  retq35 36.private_extern _weak_private_extern_gotpcrel37.globl _weak_private_extern_gotpcrel38.weak_definition _weak_private_extern_gotpcrel39_weak_private_extern_gotpcrel:40  .quad 0x123441