3 # RUN: ld64.lld -arch x86_64 -macosx_version_min 10.8 %s \
4 # RUN: %p/Inputs/lazy-bind-x86_64.yaml %p/Inputs/lazy-bind-x86_64-2.yaml \
5 # RUN: %p/Inputs/lazy-bind-x86_64-3.yaml -o %t \
6 # RUN: %p/Inputs/x86_64/libSystem.yaml
7 # RUN: llvm-objdump -lazy-bind %t | FileCheck %s
8 # RUN: llvm-nm -m %t | FileCheck --check-prefix=CHECK-NM %s
9 # RUN: llvm-objdump -disassemble %t | FileCheck --check-prefix=CHECK-HELPERS %s
10 # RUN: llvm-objdump -private-headers %t | FileCheck --check-prefix=CHECK-DYLIBS %s
12 # Test that correct two-level namespace ordinals are used for lazy bindings.
18 flags: [ MH_SUBSECTIONS_VIA_SYMBOLS ]
23 attributes: [ S_ATTR_PURE_INSTRUCTIONS, S_ATTR_SOME_INSTRUCTIONS ]
24 address: 0x0000000000000000
25 content: [ 0x55, 0x48, 0x89, 0xE5, 0x31, 0xC0, 0xE8, 0x00,
26 0x00, 0x00, 0x00, 0x31, 0xC0, 0xE8, 0x00, 0x00,
27 0x00, 0x00, 0x31, 0xC0, 0xE8, 0x00, 0x00, 0x00,
28 0x00, 0x31, 0xC0, 0x5D, 0xC3 ]
31 type: X86_64_RELOC_BRANCH
37 type: X86_64_RELOC_BRANCH
43 type: X86_64_RELOC_BRANCH
53 value: 0x0000000000000000
58 value: 0x0000000000000000
62 value: 0x0000000000000000
66 value: 0x0000000000000000
76 # CHECK-NM: (undefined) external _bar (from libbar)
77 # CHECK-NM: (undefined) external _baz (from libbaz)
78 # CHECK-NM: (undefined) external _foo (from libfoo)
81 # CHECK-HELPERS:Disassembly of section __TEXT,__stub_helper:
82 # CHECK-HELPERS: 68 00 00 00 00 pushq $0
83 # CHECK-HELPERS: 68 0b 00 00 00 pushq $11
84 # CHECK-HELPERS: 68 16 00 00 00 pushq $22
86 # Make sure the stub helper is correctly aligned
87 # CHECK-DYLIBS: sectname __stub_helper
88 # CHECK-DYLIBS-NEXT: segname __TEXT
89 # CHECK-DYLIBS-NEXT: addr
90 # CHECK-DYLIBS-NEXT: size
91 # CHECK-DYLIBS-NEXT: offset
92 # CHECK-DYLIBS-NEXT: align 2^2 (4)
94 # Make sure the __nl_symbol_ptr section is used instea of __got as this is x86_64
95 # CHECK-DYLIBS: sectname __nl_symbol_ptr
96 # CHECK-DYLIBS-NEXT: segname __DATA
98 # CHECK-DYLIBS: cmd LC_LOAD_DYLIB
99 # CHECK-DYLIBS: name /usr/lib/libbar.dylib (offset 24)
100 # CHECK-DYLIBS: current version 2.3.0
101 # CHECK-DYLIBS: compatibility version 1.0.0
102 # CHECK-DYLIBS: cmd LC_LOAD_DYLIB
103 # CHECK-DYLIBS: name /usr/lib/libfoo.dylib (offset 24)
104 # CHECK-DYLIBS: current version 3.4.0
105 # CHECK-DYLIBS: compatibility version 2.0.0
106 # CHECK-DYLIBS: cmd LC_LOAD_DYLIB
107 # CHECK-DYLIBS: name /usr/lib/libbaz.dylib (offset 24)
108 # CHECK-DYLIBS: current version 4.5.0
109 # CHECK-DYLIBS: compatibility version 3.0.0