3 # RUN: llvm-mc -filetype=obj -triple=x86_64-apple-macos %s -o %t.o
4 # RUN: %lld -dylib %t.o -o %t.dylib -lSystem
6 # RUN: llvm-objdump --macho --bind --weak-bind %t.dylib | FileCheck %s
8 # CHECK-NOT: __la_symbol_ptr
10 # RUN: llvm-objdump --macho --private-header %t.dylib | \
11 # RUN: FileCheck --check-prefix=HEADERS %s
12 # HEADERS-NOT: WEAK_DEFINES
13 # HEADERS-NOT: BINDS_TO_WEAK
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-weak
17 ## 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 not
19 ## 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 %s
22 # SYMS-NOT: WeakDef (0x80)
26 mov _weak_private_extern_gotpcrel@GOTPCREL
(%rip
), %rax
27 callq _weak_private_extern
30 .private_extern _weak_private_extern
31 .globl _weak_private_extern
32 .weak_definition _weak_private_extern
36 .private_extern _weak_private_extern_gotpcrel
37 .globl _weak_private_extern_gotpcrel
38 .weak_definition _weak_private_extern_gotpcrel
39 _weak_private_extern_gotpcrel
: