Index: lld/test/MachO/flat-namespace-interposable.s =================================================================== --- lld/test/MachO/flat-namespace-interposable.s +++ lld/test/MachO/flat-namespace-interposable.s @@ -11,40 +11,63 @@ # RUN: %lld -lSystem -flat_namespace -o %t/foo %t/foo.o # RUN: %lld -lSystem -dylib -flat_namespace -o %t/foo.dylib %t/foo.o # RUN: %lld -lSystem -bundle -flat_namespace -o %t/foo.bundle %t/foo.o -# RUN: llvm-objdump --macho --bind --lazy-bind --weak-bind %t/foo | FileCheck \ -# RUN: %s --check-prefix=EXEC --implicit-check-not=_private_extern -# RUN: llvm-objdump --macho --bind --lazy-bind --weak-bind %t/foo.dylib | \ -# RUN: FileCheck %s --check-prefix=DYLIB --implicit-check-not=_private_extern -# RUN: llvm-objdump --macho --bind --lazy-bind --weak-bind %t/foo.bundle | \ -# RUN: FileCheck %s --check-prefix=DYLIB --implicit-check-not=_private_extern +# RUN: llvm-objdump --macho --syms --rebase --bind --lazy-bind --weak-bind %t/foo | \ +# RUN: FileCheck %s --check-prefixes=SYMS,EXEC --implicit-check-not=_private_extern +# RUN: llvm-objdump --macho --syms --rebase --bind --lazy-bind --weak-bind %t/foo.dylib | \ +# RUN: FileCheck %s --check-prefixes=SYMS,DYLIB --implicit-check-not=_private_extern +# RUN: llvm-objdump --macho --syms --rebase --bind --lazy-bind --weak-bind %t/foo.bundle | \ +# RUN: FileCheck %s --check-prefixes=SYMS,DYLIB --implicit-check-not=_private_extern + +# SYMS: SYMBOL TABLE: +# SYMS-DAG: [[#%x, EXTERN_REF:]] l O __DATA,__data _extern_ref +# SYMS-DAG: [[#%x, LOCAL_REF:]] l O __DATA,__data _local_ref +# SYMS-DAG: [[#%x, WEAK_REF:]] l O __DATA,__data _weak_ref +# SYMS-DAG: [[#%x, TLV_REF:]] g O __DATA,__thread_vars _tlv ## Executables with -flat_namespace don't have interposable externs. -# EXEC: Bind table: +# EXEC: Rebase table: +# EXEC-NEXT: segment section address type +# EXEC-DAG: __DATA __la_symbol_ptr {{.*}} pointer +# EXEC-DAG: __DATA __data 0x[[#%.8x, EXTERN_REF]] pointer +# EXEC-DAG: __DATA __data 0x[[#%.8x, LOCAL_REF]] pointer +# EXEC-DAG: __DATA __data 0x[[#%.8x, WEAK_REF]] pointer +# EXEC-EMPTY: +# EXEC-NEXT: Bind table: # EXEC-NEXT: segment section address type addend dylib symbol # EXEC-EMPTY: # EXEC-NEXT: Lazy bind table: # EXEC-NEXT: segment section address dylib symbol # EXEC-EMPTY: # EXEC-NEXT: Weak bind table: -# EXEC-NEXT: segment section address type addend symbol -# EXEC-NEXT: __DATA __la_symbol_ptr {{.*}} pointer 0 _weak_extern -# EXEC-NEXT: __DATA __data {{.*}} pointer 0 _weak_extern +# EXEC-NEXT: segment section address type addend symbol +# EXEC-NEXT: __DATA __la_symbol_ptr {{.*}} pointer 0 _weak_extern +# EXEC-NEXT: __DATA __data 0x[[#%.8x, WEAK_REF]] pointer 0 _weak_extern # EXEC-EMPTY: -# DYLIB: Bind table: -# DYLIB-NEXT: segment section address type addend dylib symbol -# DYLIB-DAG: __DATA __data {{.*}} pointer 0 flat-namespace _extern -# DYLIB-DAG: __DATA __thread_ptrs {{.*}} pointer 0 flat-namespace _tlv -# DYLIB-DAG: __DATA_CONST __got {{.*}} pointer 0 flat-namespace dyld_stub_binder +# DYLIB: Rebase table: +# DYLIB-NEXT: segment section address type +# DYLIB-DAG: __DATA __la_symbol_ptr {{.*}} pointer +# DYLIB-DAG: __DATA __la_symbol_ptr {{.*}} pointer +# DYLIB-DAG: __DATA __data 0x[[#%.8x, EXTERN_REF]] pointer +# DYLIB-DAG: __DATA __data 0x[[#%.8x, LOCAL_REF]] pointer +# DYLIB-DAG: __DATA __data 0x[[#%.8x, WEAK_REF]] pointer +# DYLIB-DAG: __DATA __thread_ptrs 0x[[#%.8x, TLV_REF]] pointer +# DYLIB-EMPTY: +# DYLIB-NEXT: Bind table: +# DYLIB-NEXT: segment section address type addend dylib symbol +# DYLIB-DAG: __DATA_CONST __got {{.*}} pointer 0 flat-namespace dyld_stub_binder +# DYLIB-DAG: __DATA __data 0x[[#%.8x, EXTERN_REF]] pointer 0 flat-namespace _extern +# DYLIB-DAG: __DATA __thread_ptrs 0x[[#%.8x, TLV_REF]] pointer 0 flat-namespace _tlv # DYLIB-EMPTY: # DYLIB-NEXT: Lazy bind table: # DYLIB-NEXT: segment section address dylib symbol # DYLIB-NEXT: __DATA __la_symbol_ptr {{.*}} flat-namespace _extern # DYLIB-EMPTY: # DYLIB-NEXT: Weak bind table: -# DYLIB-NEXT: segment section address type addend symbol -# DYLIB-NEXT: __DATA __la_symbol_ptr {{.*}} pointer 0 _weak_extern -# DYLIB-NEXT: __DATA __data {{.*}} pointer 0 _weak_extern +# DYLIB-NEXT: segment section address type addend symbol +# DYLIB-NEXT: __DATA __la_symbol_ptr {{.*}} pointer 0 _weak_extern +# DYLIB-NEXT: __DATA __data 0x[[#%.8x, WEAK_REF]] pointer 0 _weak_extern +# DYLIB-EMPTY: #--- foo.s @@ -70,8 +93,11 @@ retq .data +_extern_ref: .quad _extern +_weak_ref: .quad _weak_extern +_local_ref: .quad _local .section __DATA,__thread_vars,thread_local_variables