[PATCH] D132367: [lld-macho][test] Check addresses in flat-namespace-interposable.s
Daniel Bertalan via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 24 14:51:08 PDT 2022
This revision was automatically updated to reflect the committed changes.
Closed by commit rG1b2d84a55311: [lld-macho][test] Check addresses in flat-namespace-interposable.s (authored by BertalanD).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
Changed prior to commit:
https://reviews.llvm.org/D132367?vs=454443&id=455388#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D132367/new/
https://reviews.llvm.org/D132367
Files:
lld/test/MachO/flat-namespace-interposable.s
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 0x[[#%X, WEAK_LAZY:]] 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 0x[[#%.8X, WEAK_LAZY]] 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 0x[[#%X, WEAK_LAZY:]] pointer
+# DYLIB-DAG: __DATA __la_symbol_ptr 0x[[#%X, EXTERN_LAZY:]] 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-NEXT: segment section address dylib symbol
+# DYLIB-NEXT: __DATA __la_symbol_ptr 0x[[#%.8X, EXTERN_LAZY]] 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 0x[[#%.8X, WEAK_LAZY]] 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132367.455388.patch
Type: text/x-patch
Size: 5706 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220824/12080130/attachment-0001.bin>
More information about the llvm-commits
mailing list